From 19619f84508038765ed2a6e4fbfcd4059e341c92 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 --- .../0022-Optimize-TileEntity-Ticking.patch | 60 ++++++++++++++++++- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch index b133229435..c325c1e578 100644 --- a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch @@ -1,4 +1,4 @@ -From f86213eb2c1cef2e9cc2ccabf338ebd388c12dcb Mon Sep 17 00:00:00 2001 +From fe6d356b654fa7db3d8af58223ee4fb0ab50698a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 8 Mar 2015 22:55:25 -0600 Subject: [PATCH] Optimize TileEntity Ticking @@ -186,7 +186,7 @@ index 794cdc8..00fceda 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 641db2a..8a2d2c0 100644 +index 641db2a..53438b1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -28,6 +28,18 @@ public abstract class World implements IBlockAccess { @@ -208,6 +208,15 @@ index 641db2a..8a2d2c0 100644 @Override public Entity remove(int index) { +@@ -52,7 +64,7 @@ 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(); @@ -1394,10 +1406,22 @@ public abstract class World implements IBlockAccess { guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -233,6 +242,51 @@ index 641db2a..8a2d2c0 100644 tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end +@@ -1450,7 +1474,7 @@ 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 +@@ -1496,7 +1520,7 @@ 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()); + } +@@ -1543,7 +1567,7 @@ 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); +@@ -1561,7 +1585,7 @@ 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); + } +@@ -1997,7 +2021,7 @@ 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); + } + -- -2.6.0 +2.6.1.windows.1