From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Tue, 22 Dec 2020 21:12:05 -0800
Subject: [PATCH] Prevent light queue overfill when no players are online

block changes don't queue light updates (and they shouldn't)

diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index ce0bb4d228a73d8353d67828529879e1c99682f9..18270d44185b0ec41b9b6e1d2135e7aae3b33261 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -1221,7 +1221,7 @@ public class ChunkProviderServer extends IChunkProvider {
             if (ChunkProviderServer.this.tickDistanceManager()) {
                 return true;
             } else {
-                //ChunkProviderServer.this.lightEngine.queueUpdate(); // Paper - not needed
+                ChunkProviderServer.this.lightEngine.queueUpdate(); // Paper - not needed // Tuinity - prevent queue overflow when no players are in this world
                 return super.executeNext() || execChunkTask; // Paper
             }
         } finally {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 2eb9663a3c9cedad01cd810066d6fc06ee46290c..2814846acb8b855050a865770dcc12e00fb780d1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1164,7 +1164,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
             }
             gameprofilerfiller.exit();
             timings.chunkTicksBlocks.stopTiming(); // Paper
-            getChunkProvider().getLightEngine().queueUpdate(); // Paper
+            //getChunkProvider().getLightEngine().queueUpdate(); // Paper // Tuinity - no longer needed here, moved into task execution
             // Paper end
         }
     }
