mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-07 00:48:28 +01:00
Check with the position field instead of the parameter
This commit is contained in:
parent
e5903c23a3
commit
5a1eb83f49
@ -1115,13 +1115,14 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
|
|||||||
/**
|
/**
|
||||||
* Updates internal fields and sends updates.
|
* Updates internal fields and sends updates.
|
||||||
*
|
*
|
||||||
* @param position the new position
|
* @param newPosition the new position
|
||||||
*/
|
*/
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
public void refreshPosition(@NotNull final Pos position, boolean ignoreView) {
|
public void refreshPosition(@NotNull final Pos newPosition, boolean ignoreView) {
|
||||||
final var previousPosition = this.position;
|
final var previousPosition = this.position;
|
||||||
this.position = ignoreView ? previousPosition.withCoord(position) : position;
|
final Pos position = ignoreView ? previousPosition.withCoord(newPosition) : newPosition;
|
||||||
if (position.equals(lastSyncedPosition)) return;
|
if (position.equals(lastSyncedPosition)) return;
|
||||||
|
this.position = position;
|
||||||
if (!position.samePoint(previousPosition)) {
|
if (!position.samePoint(previousPosition)) {
|
||||||
refreshCoordinate(position);
|
refreshCoordinate(position);
|
||||||
}
|
}
|
||||||
@ -1148,8 +1149,8 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
public void refreshPosition(@NotNull final Pos position) {
|
public void refreshPosition(@NotNull final Pos newPosition) {
|
||||||
refreshPosition(position, false);
|
refreshPosition(newPosition, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user