From aac39a3a0b04781e1c8ccb55004df18c70bbe745 Mon Sep 17 00:00:00 2001 From: steve <50219120+steveb05@users.noreply.github.com> Date: Sat, 15 Feb 2025 20:50:00 +0100 Subject: [PATCH] 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. --- api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java b/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java index 99d5155..27a50cf 100644 --- a/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java +++ b/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java @@ -123,7 +123,7 @@ public class WrapperEntity implements Tickable { } } if (veloX == 0 && veloY == 0 && veloZ == 0) { - velocity = Optional.empty(); + velocity = Optional.of(Vector3d.zero()); } else { velocity = Optional.of(new Vector3d(veloX, veloY, veloZ)); }