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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user