From f2e9b61f5720aa6869d63b106a8d2bca6f67feb9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 1 Jun 2015 17:06:20 +1000 Subject: [PATCH] SPIGOT-945 - random light ticking not called whenoptimal chunks is zero. --- .../0006-Better-Chunk-Tick-Selection.patch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch b/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch index a0d41d63c0..d190494b76 100644 --- a/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch +++ b/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch @@ -70,10 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Spigot start + int optimalChunks = spigotConfig.chunksPerTick; + // Quick conditions to allow us to exist early -+ if ( optimalChunks <= 0 || players.isEmpty() ) -+ { -+ return; -+ } ++ if ( optimalChunks > 0 ) { + // Keep chunks with growth inside of the optimal chunk range + int chunksPerPlayer = Math.min( 200, Math.max( 1, (int) ( ( ( optimalChunks - players.size() ) / (double) players.size() ) + 0.5 ) ) ); + int randRange = 3 + chunksPerPlayer / 30; @@ -107,10 +104,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + chunkTickList.put( hash, (short) -1 ); // no players } } -+ // Spigot End } ++ // Spigot End ++ } this.methodProfiler.b(); + if (this.L > 0) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java