SPIGOT-945 - random light ticking not called whenoptimal chunks is zero.

This commit is contained in:
md_5 2015-06-01 17:06:20 +10:00
parent 38aa4c080b
commit f2e9b61f57

View File

@ -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