diff --git a/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch new file mode 100644 index 0000000000..162bebdade --- /dev/null +++ b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Fri, 16 Oct 2015 21:39:07 -0500 +Subject: [PATCH] Disable spigot tick limiters + + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 { + int entitiesThisCycle = 0; + if (tickPosition < 0) tickPosition = 0; + for (entityLimiter.initTick(); +- entitiesThisCycle < entityList.size() && (entitiesThisCycle % 10 != 0 || entityLimiter.shouldContinue()); ++ entitiesThisCycle < entityList.size() /*&& (entitiesThisCycle % 10 == 0 || entityLimiter.shouldContinue())*/; // PaperSpigot - Disable tick limiters + tickPosition++, entitiesThisCycle++) { + tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; + entity = (Entity) this.entityList.get(this.tickPosition); +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + // Spigot start + int tilesThisCycle = 0; + for (tileLimiter.initTick(); +- tilesThisCycle < tileEntityList.size() && (tilesThisCycle % 10 != 0 || tileLimiter.shouldContinue()); ++ tilesThisCycle < tileEntityList.size() /*&& (tilesThisCycle % 10 == 0 || tileLimiter.shouldContinue())*/; // PaperSpigot - Disable tick limiters + tileTickPosition++, tilesThisCycle++) { + tileTickPosition = (tileTickPosition < tileEntityList.size()) ? tileTickPosition : 0; + TileEntity tileentity = (TileEntity) this.tileEntityList.get(tileTickPosition); +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch index 5d2d49388d..0eb6359b71 100644 --- a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch @@ -189,25 +189,6 @@ diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 { - // Spigot start - guard entity list from removals - public final List entityList = new java.util.ArrayList() - { -+ // PaperSpigot start - move always activated entities to top of tick list -+ @Override -+ public boolean add(Entity e) { -+ if (e.defaultActivationState) { -+ super.add(0, e); -+ return true; -+ } else { -+ return super.add(e); -+ } -+ } -+ // PaperSpigot end -+ - @Override - public Entity remove(int index) - { @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { }; // Spigot end @@ -217,31 +198,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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 - int entitiesThisCycle = 0; -+ -+ // PaperSpigot start - Compute minimum tick index -+ int minTickIndex = -1; -+ ListIterator e = entityList.listIterator(); -+ while (e.hasNext()) { -+ if (!e.next().defaultActivationState) { -+ minTickIndex = e.previousIndex(); -+ break; -+ } -+ } -+ // PaperSpigot end -+ - if (tickPosition < 0) tickPosition = 0; - for (entityLimiter.initTick(); -- entitiesThisCycle < entityList.size() && (entitiesThisCycle % 10 != 0 || entityLimiter.shouldContinue()); -- tickPosition++, entitiesThisCycle++) { -+ entitiesThisCycle < entityList.size() && (tickPosition <= minTickIndex || entitiesThisCycle % 10 != 0 || entityLimiter.shouldContinue()); // PaperSpigot -+ tickPosition++, entitiesThisCycle++) { - 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()) {