From b0095e91dc3036caebf32bd5febc8ed8d307100c Mon Sep 17 00:00:00 2001 From: Byteflux Date: Sat, 18 Apr 2015 02:31:53 -0700 Subject: [PATCH] Optimize draining --- .../0044-Optimize-draining.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Spigot-Server-Patches/0044-Optimize-draining.patch diff --git a/Spigot-Server-Patches/0044-Optimize-draining.patch b/Spigot-Server-Patches/0044-Optimize-draining.patch new file mode 100644 index 0000000000..162fd0eafe --- /dev/null +++ b/Spigot-Server-Patches/0044-Optimize-draining.patch @@ -0,0 +1,48 @@ +From 852a6da14b49302a346b8e6ded8c99ae1f746499 Mon Sep 17 00:00:00 2001 +From: Byteflux +Date: Fri, 10 Apr 2015 02:24:20 -0700 +Subject: [PATCH] Optimize draining + + +diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java +index de1dddb..d8de1fc 100644 +--- a/src/main/java/net/minecraft/server/BlockFlowing.java ++++ b/src/main/java/net/minecraft/server/BlockFlowing.java +@@ -88,7 +88,18 @@ public class BlockFlowing extends BlockFluids { + iblockdata = iblockdata.set(BlockFlowing.LEVEL, Integer.valueOf(i1)); + world.setTypeAndData(blockposition, iblockdata, 2); + world.a(blockposition, (Block) this, j); +- world.applyPhysics(blockposition, this); ++ // PaperSpigot start - Optimize draining ++ if (world.paperSpigotConfig.optimizeDraining) { ++ world.d(blockposition.west(), this); ++ world.d(blockposition.east(), this); ++ world.d(blockposition.up(), this); ++ world.d(blockposition.north(), this); ++ world.d(blockposition.south(), this); ++ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot ++ } else { ++ world.applyPhysics(blockposition, this); ++ } ++ // PaperSpigot end + } + } + } else { +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +index dc8bebd..1ca8b0d 100644 +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -240,4 +240,10 @@ public class PaperSpigotWorldConfig + useAsyncLighting = getBoolean( "use-async-lighting", false ); + log( "World async lighting: " + useAsyncLighting ); + } ++ ++ public boolean optimizeDraining; ++ private void optimizeDraining() ++ { ++ optimizeDraining = getBoolean( "optimize-draining", false ); ++ } + } +-- +2.3.5 +