Occultism

Occultism

19M Downloads

[1.16.5] Lumberjack causes crash.

shinji257 opened this issue ยท 3 comments

commented

Describe the bug
When joining a world with a Foliot Lumberjack it causes the game to crash.

To Reproduce
This is actually the same issue as this report but it is for 1.16.5 rather than 1.18. Given the code I suspect the same fix may work.
#607

System (please complete the following information):

Additional context
Originally reported on multiplayer it is also reproducible in singleplayer. The latter causes the world to no longer work since it crashes near the end when it goes to load the entity.

commented

Single player crash

java.lang.NullPointerException: Cannot invoke "com.github.klikli_dev.occultism.common.entity.ai.FellTreesGoal.shouldUseLumberjackDimensions()" because "this.fellTreesGoal" is null
	at com.github.klikli_dev.occultism.common.job.LumberjackJob.getDimensions(LumberjackJob.java:102)
	at com.github.klikli_dev.occultism.common.entity.spirit.SpiritEntity.lambda$getDimensions$14(SpiritEntity.java:638)
	at java.base/java.util.Optional.map(Unknown Source)
	at com.github.klikli_dev.occultism.common.entity.spirit.SpiritEntity.func_213305_a(SpiritEntity.java:638)
	at net.minecraft.entity.Entity.func_213323_x_(Entity.java:2359)
	at net.gigabit101.shrink.events.PlayerEvents.joinWorldEvent(PlayerEvents.java:83)
	at net.minecraftforge.eventbus.ASMEventHandler_31_PlayerEvents_joinWorldEvent_EntityJoinWorldEvent.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at net.minecraft.world.server.ServerWorld.func_217440_f(ServerWorld.java:829)
	at net.minecraft.world.server.ChunkManager.func_219237_a_(ChunkManager.java:594)
	at com.mojang.datafixers.util.Either.lambda$mapLeft$0(Either.java:162)
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
	at com.mojang.datafixers.util.Either.mapLeft(Either.java:162)
	at net.minecraft.world.server.ChunkManager.func_219193_a_(ChunkManager.java:569)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
	at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.func_219083_b(SourceFile:58)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144)
	at net.minecraft.world.server.ServerChunkProvider$ChunkExecutor.func_213166_h(ServerChunkProvider.java:519)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118)
	at net.minecraft.world.server.ServerChunkProvider$ChunkExecutor.func_213168_p(ServerChunkProvider.java:527)
	at net.minecraft.world.server.ServerChunkProvider.func_217234_d(ServerChunkProvider.java:272)
	at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:722)
	at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:711)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(SourceFile:127)
	at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServer.java:697)
	at net.minecraft.server.MinecraftServer.func_213186_a(MinecraftServer.java:469)
	at net.minecraft.server.MinecraftServer.func_240800_l__(MinecraftServer.java:310)
	at net.minecraft.server.integrated.IntegratedServer.func_71197_b(IntegratedServer.java:60)
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:621)
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232)
	at java.base/java.lang.Thread.run(Unknown Source)
commented

Applied this patch to a locally built version of Occultism using 1.24.1 code for 1.16.5 and verified it works to resolve the issue on that release as well.

f498868

commented

Thanks for testing the 1.18 fix on 1.16 - I'll apply it and release a build ASAP!