Add a config to turn off Optimized TickList #3145
Set: settings: - use-optimized-ticklist: false If you are having issues with block updates and want to see if this fixes it. Please report confirmations on #3145 ticket
This commit is contained in:
@@ -41,6 +41,24 @@ and -Dpaper.ticklist-excessive-delay-threshold=ticks which
|
||||
sets the excessive tick delay to the specified ticks (defaults to
|
||||
60 * 20 ticks, aka 60 seconds)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index f4836e2da1..647f6fc8ef 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
maxBookTotalSizeMultiplier = getDouble("settings.book-size.total-multiplier", maxBookTotalSizeMultiplier);
|
||||
}
|
||||
|
||||
+ public static boolean useOptimizedTickList = true;
|
||||
+ private static void useOptimizedTickList() {
|
||||
+ if (config.contains("settings.use-optimized-ticklist")) { // don't add default, hopefully temporary config
|
||||
+ useOptimizedTickList = config.getBoolean("settings.use-optimized-ticklist");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public static boolean asyncChunks = false;
|
||||
private static void asyncChunks() {
|
||||
ConfigurationSection section;
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java
|
||||
new file mode 100644
|
||||
index 0000000000..ce653f6b4b
|
||||
@@ -877,7 +895,7 @@ index e650a2e48d..2d07d350d2 100644
|
||||
return this.b(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index 57e797cd86..2e63f64783 100644
|
||||
index e67e006535..ca1b5b3b09 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -1143,7 +1161,7 @@ index f533860bbe..3f1aa5ced6 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 95860454da..b74f701b9e 100644
|
||||
index 9a2b4fa7a2..9b9e242432 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -1152,8 +1170,10 @@ index 95860454da..b74f701b9e 100644
|
||||
|
||||
+ // Paper start - rewrite ticklistserver
|
||||
+ void onChunkSetTicking(int chunkX, int chunkZ) {
|
||||
+ ((com.destroystokyo.paper.server.ticklist.PaperTickList)this.nextTickListBlock).onChunkSetTicking(chunkX, chunkZ);
|
||||
+ ((com.destroystokyo.paper.server.ticklist.PaperTickList)this.nextTickListFluid).onChunkSetTicking(chunkX, chunkZ);
|
||||
+ if (com.destroystokyo.paper.PaperConfig.useOptimizedTickList) {
|
||||
+ ((com.destroystokyo.paper.server.ticklist.PaperTickList) this.nextTickListBlock).onChunkSetTicking(chunkX, chunkZ);
|
||||
+ ((com.destroystokyo.paper.server.ticklist.PaperTickList) this.nextTickListFluid).onChunkSetTicking(chunkX, chunkZ);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - rewrite ticklistserver
|
||||
+
|
||||
@@ -1165,12 +1185,28 @@ index 95860454da..b74f701b9e 100644
|
||||
worlddata.world = this;
|
||||
// CraftBukkit end
|
||||
- this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
||||
+ this.nextTickListBlock = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (block) -> { // Paper - optimise TickListServer
|
||||
return block == null || block.getBlockData().isAir();
|
||||
}, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
||||
- return block == null || block.getBlockData().isAir();
|
||||
- }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
||||
- this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> {
|
||||
+ this.nextTickListFluid = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (fluidtype) -> { // Paper - optimise TickListServer
|
||||
return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
}, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
||||
- return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
- }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
||||
+ if (com.destroystokyo.paper.PaperConfig.useOptimizedTickList) {
|
||||
+ this.nextTickListBlock = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (block) -> { // Paper - optimise TickListServer
|
||||
+ return block == null || block.getBlockData().isAir();
|
||||
+ }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
||||
+ this.nextTickListFluid = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (fluidtype) -> { // Paper - optimise TickListServer
|
||||
+ return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
+ }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
||||
+ } else {
|
||||
+ this.nextTickListBlock = new TickListServer<>(this, (block) -> { // Paper - optimise TickListServer
|
||||
+ return block == null || block.getBlockData().isAir();
|
||||
+ }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
||||
+ this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> { // Paper - optimise TickListServer
|
||||
+ return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
+ }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
||||
+ }
|
||||
+
|
||||
this.navigators = Sets.newHashSet();
|
||||
this.I = new ObjectLinkedOpenHashSet();
|
||||
this.dataManager = worldnbtstorage;
|
||||
--
|
||||
Reference in New Issue
Block a user