JoeFoxe / Hexerei-1.19

0.2.1 update (the book)
12 stars 21 forks source link

Broom Movement being rendered is Crashing players #57

Open Zyrafosii opened 1 year ago

Zyrafosii commented 1 year ago

Description: Rendering entity in world

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.phys.Vec3.m7098()" because "broom.deltaMovementOld" is null

When exploring, another user flew by on their broom and it crashed me and another user. I'm not using any shaders or resource packs that would change how it renders Crashlog attached

crash-2023-06-13_16.04.22-client.txt

Zyrafosii commented 1 year ago

We've narrowed it down, it only crashes the players if the broom has a Broom Seat equipped

cjnix35 commented 1 year ago

I have the same issue. crash-2023-07-04_20.07.24-client.txt

NielsPilgaard commented 1 year ago

It also happens in Enigmatica 9 1.10.2: https://github.com/EnigmaticaModpacks/Enigmatica9/issues/590

alikhamesy commented 1 year ago

Pretty sure this is the issue: src/main/java/net/joefoxe/hexerei/mixin/LivingEntityRendererMixin.java

31.    float deltaMovementY = Mth.lerp(partialTicks, (float)broom.deltaMovementOld.y(), (float)broom.getDeltaMovement().y());

and should be fixable by not lerping if it's null:

float deltaMovementY = broom.deltaMovementOld == null ? (float)broom.getDeltaMovement().y() : Mth.lerp(partialTicks, (float)broom.deltaMovementOld.y(), (float)broom.getDeltaMovement().y());

I noticed that this error occurs right around when players often come into each others rendering range so I think it's just an edge case on the first render pass before deltaMovementOld is set.