mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +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
|
// Apply the position if changed
|
||||||
if (!finalVelocityPosition.samePoint(position)) {
|
if (!finalVelocityPosition.samePoint(position)) {
|
||||||
refreshPosition(finalVelocityPosition, true);
|
refreshPosition(finalVelocityPosition, true);
|
||||||
|
if (!isNettyClient) {
|
||||||
|
synchronizePosition(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update velocity
|
// 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
|
// Verify if velocity packet has to be sent
|
||||||
if (hasVelocity() || (!isNettyClient && gravityTickCount > 0)) {
|
if (hasVelocity() || (!isNettyClient && gravityTickCount > 0)) {
|
||||||
sendPacketToViewersAndSelf(getVelocityPacket());
|
sendPacketToViewersAndSelf(getVelocityPacket());
|
||||||
|
Loading…
Reference in New Issue
Block a user