petrolpark / Destroy

A chemistry-themed add-on to the Minecraft mod, Create
https://modrinth.com/mod/destroy
81 stars 31 forks source link

Game crashes when a Vat explodes with "Immersive Aircraft" installed #400

Open Theodorteo opened 1 month ago

Theodorteo commented 1 month ago

Filling a vat with too much of a solution will make it explode. If Immersive Aircraft is installed, the game crashes instead. When relaunching the game and reopening the world, no sign of explosion is present and the vat controller doesn't recognise the vat structure until you right-click it.

Installed Mods Create 0.5.1f Destroy 0.8 Immersive Aircraft 1.0.1

Crash Message The game crashed whilst ticking block entity Error: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.Entity.m9236()" because "source" is null Exit Code: -1

Crash Report

debug.log

Build I used to produce this bug: image

MC Username: Theodorteo

Lukas0094 commented 1 month ago

Apparently this occurs because the “ia$vehicleTrace” method in Immersive Aircraft's “ProjectileUtilMixin” class is executed when the vat controller explodes. I haven't looked into why this happens, but within this method there is a parameter “source”. The method tries to call the “level” method of “source”. The problem is that whenever destroy calls the method by mistake, the parameter “source” is null. This triggers a NullPointerExeption and the game crashes. A temporary solution would be to check if “source” is null and if so, exit the method. I take no responsibility if this solution does not work in some cases or if this solution causes other problems! I'm not able to upload the .jar file, but I suggest you also contact the owner of Immersive Aircraft. fix