mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Only synchronize position if entity has been affected by its velocity
This commit is contained in:
parent
86472003f8
commit
a7b0b2685b
@ -523,6 +523,9 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
|
||||
// Apply the position if changed
|
||||
if (!finalVelocityPosition.samePoint(position)) {
|
||||
refreshPosition(finalVelocityPosition, true);
|
||||
if (!isNettyClient) {
|
||||
synchronizePosition(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Update velocity
|
||||
@ -548,10 +551,6 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
|
||||
}
|
||||
}
|
||||
|
||||
// Synchronization and packets...
|
||||
if (!isNettyClient) {
|
||||
synchronizePosition(true);
|
||||
}
|
||||
// Verify if velocity packet has to be sent
|
||||
if (hasVelocity() || (!isNettyClient && gravityTickCount > 0)) {
|
||||
sendPacketToViewersAndSelf(getVelocityPacket());
|
||||
|
Loading…
Reference in New Issue
Block a user