testserver/patches/server/0366-Increase-Light-Queue-S...

44 lines
2.3 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 8 Apr 2020 21:24:05 -0400
Subject: [PATCH] Increase Light Queue Size
Wiz mentioned that large WorldEdit operations cause light to run on
main thread. The queue was small, set to 5.. this bumps it to 20
but makes it configurable per-world.
The main risk of increasing this higher is during shutdown, some
queued light updates may be lost because mojang did not flush the
light engine on shutdown...
The queue size only puts a cap on max loss, doesn't solve that problem.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-06-16 06:25:38 +00:00
index bf704993d0abd50dba91682a7fbb575e3696be62..a91a7d8f56a068b18d50a8b987b71510b0a19d5b 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-06-16 06:25:38 +00:00
@@ -479,5 +479,10 @@ public class PaperWorldConfig {
2021-06-13 19:29:58 +00:00
disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents);
log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled"));
2021-06-11 12:02:28 +00:00
}
+
+ public int lightQueueSize = 20;
+ private void lightQueueSize() {
+ lightQueueSize = getInt("light-queue-size", lightQueueSize);
+ }
}
2021-06-13 19:29:58 +00:00
2021-06-11 12:02:28 +00:00
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
2021-06-13 19:29:58 +00:00
index 312be2221e1acc44aaf6936533b0eb968f796dc6..494a3afaaa0e3496d30e8d97edbab62b21610dfe 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
2021-06-13 19:29:58 +00:00
@@ -832,7 +832,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
2021-06-11 12:02:28 +00:00
this.executeModerately();
// CraftBukkit end
if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper
- chunkproviderserver.getLightEngine().setTaskPerBatch(5);
+ chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig.lightQueueSize); // Paper - increase light queue size
// CraftBukkit start
// this.updateSpawnFlags();
worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals());