Fix entity currentChunk being null

This commit is contained in:
TheMode 2021-04-12 04:50:45 +02:00
parent 4932262750
commit adfb487140

View File

@ -462,6 +462,11 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
return; return;
} }
// Fix current chunk being null if the entity has been spawned before
if (currentChunk == null) {
currentChunk = instance.getChunkAt(position);
}
// Check if the entity chunk is loaded // Check if the entity chunk is loaded
if (!ChunkUtils.isLoaded(currentChunk)) { if (!ChunkUtils.isLoaded(currentChunk)) {
// No update for entities in unloaded chunk // No update for entities in unloaded chunk