Automatically set the new instance of an entity when adding it to an instance

This commit is contained in:
jglrxavpok 2020-05-01 23:32:25 +02:00
parent 9b465830e0
commit 2fd7f2b310
1 changed files with 2 additions and 0 deletions

View File

@ -274,6 +274,8 @@ public abstract class Instance implements BlockModifier, DataContainer {
lastInstance.removeEntity(entity); // If entity is in another instance, remove it from there and add it to this
}
entity.setInstance(this);
long[] visibleChunksEntity = ChunkUtils.getChunksInRange(entity.getPosition(), MinecraftServer.ENTITY_VIEW_DISTANCE);
boolean isPlayer = entity instanceof Player;