CraftCanvasMC / Canvas

Empowering the impossible within Minecraft
https://canvasmc.io
75 stars 6 forks source link

Occasional NullPointerException when server attempts to process AI goals #28

Closed TheDeafCreeper closed 4 months ago

TheDeafCreeper commented 4 months ago

Spark link

N/A (I can grab this in a sec if it's really important)

Stack trace

[11:47:00 ERROR]: Entity threw exception at world:-529.0,76.0,629.0
java.lang.NullPointerException: Cannot invoke "java.lang.Byte.byteValue()" because the return value of "it.unimi.dsi.fastutil.longs.Long2ByteMap.remove(Object)" is null
        at net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint.runUpdates(DynamicGraphMinFixedPoint.java:136) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.DistanceManager$FixedPlayerDistanceChunkTracker.runAllUpdates(DistanceManager.java:333) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.DistanceManager.hasPlayersNearby(DistanceManager.java:202) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.ChunkMap.anyPlayerCloseEnoughForSpawning(ChunkMap.java:731) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.ChunkMap.anyPlayerCloseEnoughForSpawning(ChunkMap.java:719) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.entity.ai.goal.EatBlockGoal.canUse(EatBlockGoal.java:35) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.entity.ai.goal.WrappedGoal.canUse(WrappedGoal.java:22) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.entity.ai.goal.GoalSelector.tick(GoalSelector.java:105) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.entity.Mob.inactiveTick(Mob.java:247) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.entity.AgeableMob.inactiveTick(AgeableMob.java:33) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1639) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.level.Level.guardEntityTick(Level.java:1104) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.ServerLevel.lambda$tick$10(ServerLevel.java:1089) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:41) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.ServerLevel.lambda$tick$11(ServerLevel.java:1068) ~[?:1.21-DEV-c8a38cd]
        at net.minecraft.server.level.ServerLevel.runWorld(ServerLevel.java:833) ~[?:1.21-DEV-c8a38cd]
        at me.dueris.canvas.thread.WorldTickThread.run(WorldTickThread.java:19) ~[?:1.21-DEV-c8a38cd]```

Actions to reproduce (if known)

No response

Canvas version

Current Purpur Version: 1.21-DEV-c8a38cd (MC: 1.21)*

Agreements

Other

Plugins: None (Also happened with ViaVersion and ViaBackwards installed however)

Client: 1.21 (also happened with 1.20.6)

Dueris commented 4 months ago

This has to do with my light engine changes, I'll fix that in a moment.

Dueris commented 4 months ago

Testing this fix rn

Dueris commented 4 months ago

i no longer encounter this issue with the fix, new build will be up soon.