From 2d37e27b3709f7da4b63d47cfa210d346315d99b Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 6 Oct 2015 23:27:01 -0500 Subject: [PATCH] Remove an unused list of TileEntities slowing down removal --- .../Optimize-TileEntity-Ticking.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch index fbb36a0b39..758187ef3e 100644 --- a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch @@ -208,6 +208,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public Entity remove(int index) { +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + }; + // Spigot end + protected final List g = Lists.newArrayList(); +- public final List h = Lists.newArrayList(); ++ //public final List h = Lists.newArrayList(); // PaperSpigot - Remove unused list + public final List tileEntityList = Lists.newArrayList(); + private final List b = Lists.newArrayList(); + private final List c = Lists.newArrayList(); @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -233,4 +242,49 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + // CraftBukkit start - From below, clean up tile entities before ticking them + if (!this.c.isEmpty()) { + this.tileEntityList.removeAll(this.c); +- this.h.removeAll(this.c); ++ //this.h.removeAll(this.c); // PaperSpigot - Remove unused list + this.c.clear(); + } + // CraftBukkit end +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + if (tileentity.x()) { + tilesThisCycle--; + this.tileEntityList.remove(tileTickPosition--); +- this.h.remove(tileentity); ++ //this.h.remove(tileentity); // PaperSpigot - Remove unused list + if (this.isLoaded(tileentity.getPosition())) { + this.getChunkAtWorldCoords(tileentity.getPosition()).e(tileentity.getPosition()); + } +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + } + + public boolean a(TileEntity tileentity) { +- boolean flag = this.h.add(tileentity); ++ boolean flag = true; // PaperSpigot - Remove unused list + + if (flag && tileentity instanceof IUpdatePlayerListBox) { + this.tileEntityList.add(tileentity); +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + while (iterator.hasNext()) { + TileEntity tileentity = (TileEntity) iterator.next(); + +- this.h.add(tileentity); ++ //this.h.add(tileentity); // PaperSpigot - Remove unused list + if (tileentity instanceof IUpdatePlayerListBox) { + this.tileEntityList.add(tileentity); + } +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + } else { + if (tileentity != null) { + this.b.remove(tileentity); +- this.h.remove(tileentity); ++ //this.h.remove(tileentity); // PaperSpigot - Remove unused list + this.tileEntityList.remove(tileentity); + } + -- \ No newline at end of file