summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorMike Primm <mike@primmhome.com>2011-12-14 08:58:01 -0600
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 16:47:57 +0000
commitcc05bea457976aed4ec213499ede7677118a8843 (patch)
tree5bad25b3f04a26f5c0ff7157d3717a82030bbd24 /src/main/java/net
parent52c526f313f1f701cbe042612db572da0edcc600 (diff)
downloadcraftbukkit-cc05bea457976aed4ec213499ede7677118a8843.tar
craftbukkit-cc05bea457976aed4ec213499ede7677118a8843.tar.gz
craftbukkit-cc05bea457976aed4ec213499ede7677118a8843.tar.lz
craftbukkit-cc05bea457976aed4ec213499ede7677118a8843.tar.xz
craftbukkit-cc05bea457976aed4ec213499ede7677118a8843.zip
Prevent unbounded TickList growth on busy servers (>1000 events/tick). This completes another Bleeding request.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/World.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7f2517eb..53a7ea28 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) {