2018-06-15 06:11:39 +02:00
From 8c155ab653d16ddc8cf6850af419983467abf449 Mon Sep 17 00:00:00 2001
Don't blindly send unlit chunks when lighting updates are allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.
Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.
as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
2017-12-18 08:37:50 +01:00
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 18 Dec 2017 07:26:56 +0000
Subject: [PATCH] Don't blindly send unlit chunks when lighting updates are
allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.
Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.
as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
2018-06-15 06:11:39 +02:00
index aecfa331d..7cd537a59 100644
Don't blindly send unlit chunks when lighting updates are allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.
Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.
as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
2017-12-18 08:37:50 +01:00
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -39,7 +39,7 @@ public class Chunk {
final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this); // Paper
private boolean done;
private boolean lit;
- private boolean r;
+ private boolean r; private boolean isTicked() { return r; }; // Paper - OBFHELPER
private boolean s;
private boolean t;
private long lastSaved;
2018-06-15 06:11:39 +02:00
@@ -1137,7 +1137,11 @@ public class Chunk {
Don't blindly send unlit chunks when lighting updates are allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.
Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.
as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
2017-12-18 08:37:50 +01:00
* We cannot unfortunately do this lighting stage during chunk gen as it appears to put a lot more noticeable load on the server, than when it is done at play time.
* For now at least we will simply send all chunks, in accordance with pre 1.7 behaviour.
*/
- return true;
+ // Paper Start
2018-06-12 16:46:08 +02:00
+ // if randomLightUpdates are disabled, we should always return true, otherwise chunks may never send
Don't blindly send unlit chunks when lighting updates are allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.
Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.
as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
2017-12-18 08:37:50 +01:00
+ // to the client due to not being lit, otherwise retain standard behavior and only send properly lit chunks.
+ return !this.world.spigotConfig.randomLightUpdates || (this.isTicked() && this.done && this.lit);
+ // Paper End
// Spigot End
}
--
2018-06-12 16:46:08 +02:00
2.17.1
Don't blindly send unlit chunks when lighting updates are allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.
Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.
as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
2017-12-18 08:37:50 +01:00