mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-11 09:51:35 +01:00
Do not send additional velocity packets to players
This commit is contained in:
parent
ae3884efdc
commit
3924d2c0a2
@ -526,8 +526,8 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
|
||||
final var finalVelocityPosition = CollisionUtils.applyWorldBorder(instance, position, newPosition);
|
||||
if (finalVelocityPosition.samePoint(position)) {
|
||||
this.velocity = Vec.ZERO;
|
||||
if (hasVelocity) {
|
||||
sendPacketToViewersAndSelf(getVelocityPacket());
|
||||
if (hasVelocity && !isSocketClient) {
|
||||
sendPacketToViewers(getVelocityPacket());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -563,8 +563,8 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
|
||||
}
|
||||
}
|
||||
// Verify if velocity packet has to be sent
|
||||
if (hasVelocity || gravityTickCount > 0) {
|
||||
sendPacketToViewersAndSelf(getVelocityPacket());
|
||||
if ((hasVelocity || gravityTickCount > 0) && !isSocketClient) {
|
||||
sendPacketToViewers(getVelocityPacket());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user