Small cleanup

This commit is contained in:
Felix Cravic 2020-12-04 18:25:24 +01:00
parent d6c0a24bed
commit 9b8579eaf4
2 changed files with 4 additions and 3 deletions

View File

@ -1072,7 +1072,8 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
final Chunk lastChunk = instance.getChunkAt(lastX, lastZ);
final Chunk newChunk = instance.getChunkAt(x, z);
if (forceUpdate || (lastChunk != null && newChunk != null && lastChunk != newChunk)) {
final boolean chunkChange = lastChunk != null && newChunk != null && lastChunk != newChunk;
if (forceUpdate || chunkChange) {
instance.switchEntityChunk(this, lastChunk, newChunk);
if (this instanceof Player) {
// Refresh player view

View File

@ -314,14 +314,14 @@ public abstract class EntityCreature extends LivingEntity implements NavigableEn
@Override
public void pathFindingTick(float speed) {
synchronized (pathLock){
synchronized (pathLock) {
NavigableEntity.super.pathFindingTick(speed);
}
}
@Override
public boolean setPathTo(@Nullable Position position) {
synchronized (pathLock){
synchronized (pathLock) {
return NavigableEntity.super.setPathTo(position);
}
}