Check with the position field instead of the parameter

This commit is contained in:
TheMode 2021-08-13 06:04:44 +02:00
parent e5903c23a3
commit 5a1eb83f49
1 changed files with 6 additions and 5 deletions

View File

@ -1115,13 +1115,14 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
/**
* Updates internal fields and sends updates.
*
* @param position the new position
* @param newPosition the new position
*/
@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;
this.position = ignoreView ? previousPosition.withCoord(position) : position;
final Pos position = ignoreView ? previousPosition.withCoord(newPosition) : newPosition;
if (position.equals(lastSyncedPosition)) return;
this.position = position;
if (!position.samePoint(previousPosition)) {
refreshCoordinate(position);
}
@ -1148,8 +1149,8 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
}
@ApiStatus.Internal
public void refreshPosition(@NotNull final Pos position) {
refreshPosition(position, false);
public void refreshPosition(@NotNull final Pos newPosition) {
refreshPosition(newPosition, false);
}
/**