From 2dae4212905ef35ac13a03d43a2986e3f13efe06 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Fri, 17 Apr 2015 03:54:46 -0700 Subject: [PATCH] Configurable tickNextTickListCap bypass for redstone --- .../Fix-redstone-lag-issues.patch | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/Fix-redstone-lag-issues.patch b/Spigot-Server-Patches/Fix-redstone-lag-issues.patch index 8d1a79077..9a58909f0 100644 --- a/Spigot-Server-Patches/Fix-redstone-lag-issues.patch +++ b/Spigot-Server-Patches/Fix-redstone-lag-issues.patch @@ -29,6 +29,30 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.methodProfiler.a("cleaning"); +@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { + this.V.add(nextticklistentry); + } + ++ // PaperSpigot start - Allow redstone ticks to bypass the tickNextTickListCap ++ if (paperSpigotConfig.tickNextTickListCapIgnoresRedstone) { ++ Iterator iterator = this.M.iterator(); ++ while (iterator.hasNext()) { ++ NextTickListEntry next = iterator.next(); ++ if (!flag && next.b > this.worldData.getTime()) { ++ break; ++ } ++ ++ if (next.a().isPowerSource() || next.a() instanceof IContainer) { ++ iterator.remove(); ++ this.V.add(next); ++ } ++ } ++ } ++ // PaperSpigot end ++ + this.methodProfiler.b(); + this.methodProfiler.a("ticking"); + Iterator iterator = this.V.iterator(); diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java @@ -39,10 +63,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + + public int tickNextTickCap; ++ public boolean tickNextTickListCapIgnoresRedstone; + private void tickNextTickCap() + { + tickNextTickCap = getInt( "tick-next-tick-list-cap", 10000 ); // Higher values will be friendlier to vanilla style mechanics (to a point) but may hurt performance ++ tickNextTickListCapIgnoresRedstone = getBoolean( "tick-next-tick-list-cap-ignores-redstone", false ); // Redstone TickNextTicks will always bypass the preceding cap. + log( "WorldServer TickNextTick cap set at " + tickNextTickCap ); ++ log( "WorldServer TickNextTickList cap always processes redstone: " + tickNextTickListCapIgnoresRedstone ); + } } --- \ No newline at end of file +-- +1.9.4.msysgit.2 +