fix: avoid returning empty optional velocity for entity spawn packets

Returning an empty optional for the entity spawn velocity packets would apply a negative velocity (-1 on all axes) due to PacketEvents implementation. This affects client-side updated entities like fireworks.
This commit is contained in:
steve 2025-02-15 20:50:00 +01:00
parent f62986892a
commit aac39a3a0b
No known key found for this signature in database
GPG key ID: 0F9283F0F2E9E304

View file

@ -123,7 +123,7 @@ public class WrapperEntity implements Tickable {
} }
} }
if (veloX == 0 && veloY == 0 && veloZ == 0) { if (veloX == 0 && veloY == 0 && veloZ == 0) {
velocity = Optional.empty(); velocity = Optional.of(Vector3d.zero());
} else { } else {
velocity = Optional.of(new Vector3d(veloX, veloY, veloZ)); velocity = Optional.of(new Vector3d(veloX, veloY, veloZ));
} }