mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-20 07:02:32 +01:00
Use proper method for refreshing position
This commit is contained in:
parent
8b35e0db9a
commit
ce8e14ede1
@ -531,7 +531,7 @@ 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)) {
|
||||||
refreshCoordinate(finalVelocityPosition);
|
refreshPosition((Pos) finalVelocityPosition, true);
|
||||||
sendPositionUpdate(true);
|
sendPositionUpdate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1318,7 +1318,6 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
|
|||||||
* @param newPosition the new position
|
* @param newPosition the new position
|
||||||
*/
|
*/
|
||||||
private void refreshCoordinate(Point newPosition) {
|
private void refreshCoordinate(Point newPosition) {
|
||||||
position = position.withCoord(newPosition);
|
|
||||||
if (hasPassenger()) {
|
if (hasPassenger()) {
|
||||||
for (Entity passenger : getPassengers()) {
|
for (Entity passenger : getPassengers()) {
|
||||||
passenger.refreshCoordinate(newPosition);
|
passenger.refreshCoordinate(newPosition);
|
||||||
|
Loading…
Reference in New Issue
Block a user