From 8ddd9ddefcea02d1a2eb98750c883a06018cfc77 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 17:29:10 -0400 Subject: [PATCH] Missed a case where to remove a chunk lookup on TE removal (performance, not bug fix) --- ...oid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index d3341af446..4a9ef8c75b 100644 --- a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -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);