mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +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;
|
final Pos currentPosition = this.position;
|
||||||
if (currentPosition.sameView(yaw, pitch)) return;
|
if (currentPosition.sameView(yaw, pitch)) return;
|
||||||
this.position = currentPosition.withView(yaw, pitch);
|
this.position = currentPosition.withView(yaw, pitch);
|
||||||
sendPacketToViewersAndSelf(new EntityHeadLookPacket(getEntityId(), yaw));
|
synchronizeView();
|
||||||
sendPacketToViewersAndSelf(new EntityRotationPacket(getEntityId(), yaw, pitch, onGround));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1570,6 +1569,11 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
|||||||
this.lastSyncedPosition = posCache;
|
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.
|
* Asks for a synchronization (position) to happen during next entity tick.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user