mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
SPIGOT-945 - random light ticking not called whenoptimal chunks is zero.
This commit is contained in:
@@ -70,10 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ int optimalChunks = spigotConfig.chunksPerTick;
|
+ int optimalChunks = spigotConfig.chunksPerTick;
|
||||||
+ // Quick conditions to allow us to exist early
|
+ // Quick conditions to allow us to exist early
|
||||||
+ if ( optimalChunks <= 0 || players.isEmpty() )
|
+ if ( optimalChunks > 0 ) {
|
||||||
+ {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // Keep chunks with growth inside of the optimal chunk range
|
+ // 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 chunksPerPlayer = Math.min( 200, Math.max( 1, (int) ( ( ( optimalChunks - players.size() ) / (double) players.size() ) + 0.5 ) ) );
|
||||||
+ int randRange = 3 + chunksPerPlayer / 30;
|
+ int randRange = 3 + chunksPerPlayer / 30;
|
||||||
@@ -107,10 +104,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ chunkTickList.put( hash, (short) -1 ); // no players
|
+ chunkTickList.put( hash, (short) -1 ); // no players
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ // Spigot End
|
|
||||||
}
|
}
|
||||||
|
+ // Spigot End
|
||||||
|
+ }
|
||||||
|
|
||||||
this.methodProfiler.b();
|
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
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
|
Reference in New Issue
Block a user