Missed a case where to remove a chunk lookup on TE removal (performance, not bug fix)

This commit is contained in:
Aikar 2018-07-04 17:29:10 -04:00
parent 233a81a4ba
commit 8ddd9ddefc

View file

@ -22,7 +22,7 @@ index 71d0db3f3..a51b648c5 100644
this.a(entity, entity.ac);
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c0816b9f8..623290caa 100644
index c0816b9f8..b1e7b63e0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
@ -76,13 +76,15 @@ index c0816b9f8..623290caa 100644
this.tileEntityListTick.remove(tileTickPosition--);
//this.tileEntityList.remove(tileentity); // Paper - remove unused list
- if (this.isLoaded(tileentity.getPosition())) {
- this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition());
+ // Paper start
+ net.minecraft.server.Chunk chunk = tileentity.getCurrentChunk();
+ if (chunk != null) {
+ chunk.removeTileEntity(tileentity.getPosition());
+ // Paper end
this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition());
}
}
}
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
int k = MathHelper.floor(entity.locZ / 16.0D);