From af52f138da1df92bd9641a988824f443bf5892ab 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 --- .../0364-Optimize-Light-Recalculations.patch | 38 ++----------------- ...event-players-from-moving-into-unloa.patch | 6 +-- .../0396-Optimize-redstone-algorithm.patch | 6 +-- ...al-Spawned-mobs-towards-natural-spaw.patch | 6 +-- 4 files changed, 12 insertions(+), 44 deletions(-) diff --git a/Spigot-Server-Patches/0364-Optimize-Light-Recalculations.patch b/Spigot-Server-Patches/0364-Optimize-Light-Recalculations.patch index 77646cd2ce..ed3da3bb51 100644 --- a/Spigot-Server-Patches/0364-Optimize-Light-Recalculations.patch +++ b/Spigot-Server-Patches/0364-Optimize-Light-Recalculations.patch @@ -1,36 +1,13 @@ -From 68e14a1e03878d225c0026275611d94a77947081 Mon Sep 17 00:00:00 2001 +From 74a659caa33a7279b1be97385ce24e7e55082a65 Mon Sep 17 00:00:00 2001 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 -@@ -523,6 +523,11 @@ 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 @@ -353,7 +353,7 @@ public class Chunk implements IChunkAccess { @@ -42,15 +19,6 @@ index fb00e7a9c..fdf062b8b 100644 } this.x = true; -@@ -563,7 +563,7 @@ 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/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch index b09e84c96d..1194efca95 100644 --- a/Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -1,4 +1,4 @@ -From a934c12a69f5fe8a16185e217602893fe736bc7d Mon Sep 17 00:00:00 2001 +From 03c3c45382dd0a1fc06143cb5bd31f0e0722d6a1 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Mon, 22 Oct 2018 17:34:10 +0200 Subject: [PATCH] Add option to prevent players from moving into unloaded @@ -6,10 +6,10 @@ 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 -@@ -579,4 +579,9 @@ public class PaperWorldConfig { +@@ -574,4 +574,9 @@ public class PaperWorldConfig { replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList("stone", "planks")); log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Chunk Edge Mode: " + chunkEdgeMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); } diff --git a/Spigot-Server-Patches/0396-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0396-Optimize-redstone-algorithm.patch index 570f7d2b72..3a54c43d57 100644 --- a/Spigot-Server-Patches/0396-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0396-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From 9392c69898ef0bcbd528eedb4588c9d1d64675a3 Mon Sep 17 00:00:00 2001 +From 18012a69f5b8fb4eac4d7fb7e868eddba581a77b Mon Sep 17 00:00:00 2001 From: theosib Date: Thu, 27 Sep 2018 01:43:35 -0600 Subject: [PATCH] Optimize redstone algorithm @@ -19,10 +19,10 @@ 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 -@@ -584,4 +584,14 @@ public class PaperWorldConfig { +@@ -579,4 +579,14 @@ public class PaperWorldConfig { private void preventMovingIntoUnloadedChunks() { preventMovingIntoUnloadedChunks = getBoolean("prevent-moving-into-unloaded-chunks", false); } diff --git a/Spigot-Server-Patches/0424-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/Spigot-Server-Patches/0424-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch index 71b7dae3dd..3becad69bf 100644 --- a/Spigot-Server-Patches/0424-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch +++ b/Spigot-Server-Patches/0424-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch @@ -1,4 +1,4 @@ -From 01abbf425677bc6dbfe5159b84545fb3bbd1a036 Mon Sep 17 00:00:00 2001 +From 9e85ab2027dac98fc5f8252b955be863a7cb64f3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 24 Mar 2019 01:01:32 -0400 Subject: [PATCH] Only count Natural Spawned mobs towards natural spawn mob @@ -17,10 +17,10 @@ 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 -@@ -594,4 +594,14 @@ public class PaperWorldConfig { +@@ -589,4 +589,14 @@ public class PaperWorldConfig { log("Using vanilla redstone algorithm."); } }