Move sync time reset (#504)

This commit is contained in:
Moulberry 2021-10-27 22:02:33 +08:00 committed by GitHub
parent b7ad2fef5c
commit 723bee2ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1178,6 +1178,7 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
final Chunk chunk = getChunk();
if (distanceX > 8 || distanceY > 8 || distanceZ > 8) {
PacketUtils.prepareViewablePacket(chunk, new EntityTeleportPacket(getEntityId(), position, isOnGround()), this);
this.lastAbsoluteSynchronizationTime = System.currentTimeMillis();
} else if (positionChange && viewChange) {
PacketUtils.prepareViewablePacket(chunk, EntityPositionAndRotationPacket.getPacket(getEntityId(), position,
lastSyncedPosition, isOnGround()), this);
@ -1189,7 +1190,6 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
PacketUtils.prepareViewablePacket(chunk, new EntityHeadLookPacket(getEntityId(), position.yaw()), this);
PacketUtils.prepareViewablePacket(chunk, new EntityRotationPacket(getEntityId(), position.yaw(), position.pitch(), onGround), this);
}
this.lastAbsoluteSynchronizationTime = System.currentTimeMillis();
this.lastSyncedPosition = position;
}