From cc05bea457976aed4ec213499ede7677118a8843 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Wed, 14 Dec 2011 08:58:01 -0600 Subject: [PATCH] Prevent unbounded TickList growth on busy servers (>1000 events/tick). This completes another Bleeding request. --- src/main/java/net/minecraft/server/World.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 7f2517ebfc..53a7ea2831 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -2306,7 +2306,13 @@ public class World implements IBlockAccess { throw new IllegalStateException("TickNextTick list out of synch"); } else { if (i > 1000) { - i = 1000; + // CraftBukkit start - if the server has too much to process over time, try to alleviate that + if(i > 20 * 1000) { + i = i / 20; + } else { + i = 1000; + } + // CraftBukkit end } for (int j = 0; j < i; ++j) {