Mithion / Mana-And-Artifice

Ars Magica 3: Mana and Artifice
52 stars 7 forks source link

[FTB One 2.8.2] [CRITICAL] [Server Crash] Binding Mana and Artifice programming sheet to golem causes null reference exception if sheet is not fully filled out #655

Open SplenectomY opened 7 months ago

SplenectomY commented 7 months ago

Describe the bug Using the golem delegation station, binding a golem to a visual script with a "take item" command when no container has been specified causes an unhandled null reference exception. This fully prevents the server from operating and you must restore the server from a backup.

Log: https://pastebin.com/3ftnzgE9

[12Dec2023 22:55:20.989] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception net.minecraft.ReportedException: Ticking entity at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:870) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:292) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:806) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at java.lang.Thread.run(Unknown Source) [?:?] Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.core.Vec3i.m_123341_()" because "p_82513_" is null at net.minecraft.world.phys.Vec3.m_82512_(Vec3.java:33) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at com.mna.api.entities.construct.ai.ConstructCommandTileEntityInteract.m_8056_(ConstructCommandTileEntityInteract.java:92) ~[mna-forge-1.19.2-2.1.0.4-all.jar%23589!/:2.1.0.4] at com.mna.entities.constructs.ai.ConstructTakeItem.m_8056_(ConstructTakeItem.java:148) ~[mna-forge-1.19.2-2.1.0.4-all.jar%23589!/:2.1.0.4] at com.mna.entities.constructs.ai.ConstructCommandFollowLodestar.advanceTask(ConstructCommandFollowLodestar.java:153) ~[mna-forge-1.19.2-2.1.0.4-all.jar%23589!/:2.1.0.4] at com.mna.entities.constructs.ai.ConstructCommandFollowLodestar.m_8036_(ConstructCommandFollowLodestar.java:56) ~[mna-forge-1.19.2-2.1.0.4-all.jar%23589!/:2.1.0.4] at net.minecraft.world.entity.ai.goal.WrappedGoal.m_8036_(WrappedGoal.java:22) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.entity.ai.goal.GoalSelector.m_25373_(GoalSelector.java:98) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.entity.Mob.m_6140_(Mob.java:725) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.entity.LivingEntity.m_8107_(LivingEntity.java:2546) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.entity.Mob.m_8107_(Mob.java:517) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.entity.LivingEntity.m_8119_(LivingEntity.java:2291) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.entity.Mob.m_8119_(Mob.java:318) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at com.mna.entities.constructs.animated.Construct.m_8119_(Construct.java:412) ~[mna-forge-1.19.2-2.1.0.4-all.jar%23589!/:2.1.0.4] at net.minecraft.server.level.ServerLevel.m_8647_(ServerLevel.java:658) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.level.Level.m_46653_(MixinLevel.java:457) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.level.ServerLevel.m_184063_(ServerLevel.java:323) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.world.level.entity.EntityTickList.m_156910_(EntityTickList.java:54) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.level.ServerLevel.m_8793_(ServerLevel.java:303) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:866) ~[server-1.19.2-20220805.130853-srg.jar%23707!/:?] ... 5 more [12Dec2023 22:55:21.166] [Server thread/FATAL] [net.minecraftforge.common.ForgeMod/]: Preparing crash report with UUID 05dd2b82-9764-491a-8b9c-46757cef6b03

To Reproduce Steps to reproduce the behavior:

  1. Create a standard wicker golem in mana and artifice
  2. Create the delegation station and create a script for a golem to do. In my case, I created a loop where a golem would take two items from two different containers and place them in a separate container, then wait until processing was done. It would then retrieve the new item, put it in a "finished" container and start the loop over
  3. Bind the golem to the delegation station script

Expected behavior The exception should have been handled in the code, or better yet, the null value should have been anticipated.

Screenshots If applicable, add screenshots to help explain your problem.

Version Information (please complete the following information):

Additional context I can't compare the versioning of the mod in FTB One compared to the version on the website ... the naming of the jar says 1.0.6 but has features from some of the later versions. Since the source code for Mana and Artifice is not available online, I assume you are in talks with those folks.

Bug also reported at FTB: https://github.com/FTBTeam/FTB-Modpack-Issues/issues/4467

janlout commented 7 months ago

I can confirm this bug.

Log: https://pastebin.com/MYXxCcpx

Version Information:

Additional context: We fixed this for our server by removing the construct with the nbt explorer

H8Misery commented 7 months ago

I can confirm this bug.

Log: https://pastebin.com/MYXxCcpx

Version Information:

  • Minecraft 1.19.2
  • Forge 43.3.5
  • MNA mna-forge-1.19.2-2.1.0.4-all.jar

Additional context: We fixed this for our server by removing the construct with the nbt explorer

Hi! Can you describe please how to remove nbt explorer?

Mithion commented 5 months ago

There is also a forge config to remove erroring entities, which should resolve this issue in the meantime.