From 4e0a1533d0da0ae55377eb86a37cae8a421ba0b4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 27 Mar 2019 20:46:46 -0400 Subject: [PATCH] Remove light optimization getting lots of bug reports on light. just going to drop this even though I really don't see how it could be the source due to my understanding of the games light engine... Fixes #1920 --- ...event-players-from-moving-into-unloa.patch | 2 +- ...al-Spawned-mobs-towards-natural-spaw.patch | 2 +- .../Optimize-Light-Recalculations.patch | 36 ++----------------- .../Optimize-redstone-algorithm.patch | 2 +- 4 files changed, 5 insertions(+), 37 deletions(-) diff --git a/Spigot-Server-Patches/Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/Add-option-to-prevent-players-from-moving-into-unloa.patch index c7896da363..fc124ae641 100644 --- a/Spigot-Server-Patches/Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d723868fc..8210b22eb 100644 +index 30985cdfc..2add466ac 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { diff --git a/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch index 30e698640a..47dbceaf2d 100644 --- a/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch +++ b/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch @@ -17,7 +17,7 @@ This should fully solve all of the issues around it so that only natural influences natural spawns. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f259c4e51..fa1d88aa8 100644 +index b499c58b7..fc7ac2bc0 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { diff --git a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch index e0d75f3845..dce807da88 100644 --- a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch +++ b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch @@ -3,34 +3,11 @@ From: Aikar Date: Fri, 28 Sep 2018 20:46:29 -0400 Subject: [PATCH] Optimize Light Recalculations -The server triggers light recalculations even if the new block -is the same as the old block. At this time, BlockData Properties -do not impact light calculations. - -So the only way light should change, is if the block itself -changes from 1 block to another. - -Also optimizes to not repeatedly look up the same chunk for +Optimizes to not repeatedly look up the same chunk for light lookups. -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index e04204055..0b54b7d78 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -0,0 +0,0 @@ public class PaperWorldConfig { - log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default"); - } - -+ public boolean optimizeLight = true; -+ private void optimizeLight() { -+ this.optimizeLight = getBoolean("optimize-light", optimizeLight); -+ } -+ - public boolean antiXray; - public boolean asynchronous; - public EngineMode engineMode; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fb00e7a9c..fdf062b8b 100644 +index fb00e7a9c..fabfc315c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -42,15 +19,6 @@ index fb00e7a9c..fdf062b8b 100644 } this.x = true; -@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - } else { - if (flag1) { - this.initLighting(); -- } else { -+ } else if (!world.paperConfig.optimizeLight || block != block1) { // Paper - Optimize light recalculations - this.runOrQueueLightUpdate(() -> { // Paper - Queue light update - int i1 = iblockdata.b(this.world, blockposition); - int j1 = iblockdata1.b(this.world, blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 739fbecac..739448d8b 100644 --- a/src/main/java/net/minecraft/server/World.java diff --git a/Spigot-Server-Patches/Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/Optimize-redstone-algorithm.patch index 4cd69a746c..3b89d912a7 100644 --- a/Spigot-Server-Patches/Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/Optimize-redstone-algorithm.patch @@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee Just added Bukkit's event system and took a few liberties with dead code and comment misspellings. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 8210b22eb..f259c4e51 100644 +index 2add466ac..b499c58b7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig {