9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 18:09:17 +00:00

fix async tracker cause player velocity not updated (#432)

* fix async tracker player velocity not updated

* fix velocity packet not send to self
This commit is contained in:
hayanesuru
2025-07-27 04:56:11 +09:00
committed by GitHub
parent 42caad5a46
commit 2f8499fb3c

View File

@@ -91,12 +91,7 @@ public final class TrackerCtx {
}
public void playerVelocity(ServerPlayer player) {
if (PlayerVelocityEvent.getHandlerList().getRegisteredListeners().length == 0) {
player.hurtMarked = false;
player.moonrise$getTrackedEntity().leafBroadcastAndSend(this, new ClientboundSetEntityMotionPacket(player));
} else {
bukkitVelocityEvent.add(player);
}
bukkitVelocityEvent.add(player);
}
public void citizensEntity(Entity entity) {
@@ -168,7 +163,7 @@ public final class TrackerCtx {
if (!cancelled) {
player.hurtMarked = false;
ChunkMap.TrackedEntity trackedEntity = player.moonrise$getTrackedEntity();
trackedEntity.leafBroadcast(this, new ClientboundSetEntityMotionPacket(player));
trackedEntity.leafBroadcastAndSend(this, new ClientboundSetEntityMotionPacket(player));
}
}
bukkitVelocityEvent.clear();