mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
hollow-cube/entity-teleport-head-fix
This commit is contained in:
parent
74ca1041f3
commit
4da527c25a
@ -333,8 +333,7 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
||||
final Pos currentPosition = this.position;
|
||||
if (currentPosition.sameView(yaw, pitch)) return;
|
||||
this.position = currentPosition.withView(yaw, pitch);
|
||||
sendPacketToViewersAndSelf(new EntityHeadLookPacket(getEntityId(), yaw));
|
||||
sendPacketToViewersAndSelf(new EntityRotationPacket(getEntityId(), yaw, pitch, onGround));
|
||||
synchronizeView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1570,6 +1569,11 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
||||
this.lastSyncedPosition = posCache;
|
||||
}
|
||||
|
||||
private void synchronizeView() {
|
||||
sendPacketToViewersAndSelf(new EntityHeadLookPacket(getEntityId(), position.yaw()));
|
||||
sendPacketToViewersAndSelf(new EntityRotationPacket(getEntityId(), position.yaw(), position.pitch(), onGround));
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks for a synchronization (position) to happen during next entity tick.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user