mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-15 12:02:49 +01:00
Use this world instead of the one in the entity. Fixes BUKKIT-2315
In some situations an entity or tile entity can be added to the world but have its own 'world' field be null or otherwise incorrect. As the entity was added to this world to be ticked assume it actually is in this world.
This commit is contained in:
parent
fc0e35a67c
commit
244a39d209
1 changed files with 3 additions and 3 deletions
|
@ -1064,7 +1064,7 @@ public abstract class World implements IBlockAccess {
|
|||
continue;
|
||||
}
|
||||
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) entity.world).chunkProviderServer;
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
|
||||
if (chunkProviderServer.unloadQueue.contains(MathHelper.floor(entity.locX) >> 4, MathHelper.floor(entity.locZ) >> 4)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ public abstract class World implements IBlockAccess {
|
|||
entity = (Entity) this.entityList.get(i);
|
||||
|
||||
// CraftBukkit start - don't tick entities in chunks queued for unload
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) entity.world).chunkProviderServer;
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
|
||||
if (chunkProviderServer.unloadQueue.contains(MathHelper.floor(entity.locX) >> 4, MathHelper.floor(entity.locZ) >> 4)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1149,7 +1149,7 @@ public abstract class World implements IBlockAccess {
|
|||
TileEntity tileentity = (TileEntity) iterator.next();
|
||||
|
||||
// CraftBukkit start - don't tick entities in chunks queued for unload
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) tileentity.world).chunkProviderServer;
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
|
||||
if (chunkProviderServer.unloadQueue.contains(tileentity.x >> 4, tileentity.z >> 4)) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue