From 8c8c10cefa59b065f6377024d2b86605159f1c47 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Sun, 3 Aug 2014 21:23:18 -0500 Subject: [PATCH] Configurable speed for water flowing over lava Higher values = Slower water movement = better performance http://hastebin.com/axuzaralas.vhdl --- ...le-speed-for-water-flowing-over-lava.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Spigot-Server-Patches/0030-Configurable-speed-for-water-flowing-over-lava.patch diff --git a/Spigot-Server-Patches/0030-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0030-Configurable-speed-for-water-flowing-over-lava.patch new file mode 100644 index 0000000000..7e6a5e0b89 --- /dev/null +++ b/Spigot-Server-Patches/0030-Configurable-speed-for-water-flowing-over-lava.patch @@ -0,0 +1,66 @@ +From eb0b830ce23ab89758193eb1c2a9e1ae9ac00df2 Mon Sep 17 00:00:00 2001 +From: Byteflux +Date: Sun, 3 Aug 2014 21:20:42 -0500 +Subject: [PATCH] Configurable speed for water flowing over lava + +Basic info: http://hastebin.com/axuzaralas.vhdl + +diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java +index cdce3ff..6409391 100644 +--- a/src/main/java/net/minecraft/server/BlockFlowing.java ++++ b/src/main/java/net/minecraft/server/BlockFlowing.java +@@ -38,7 +38,7 @@ public class BlockFlowing extends BlockFluids { + } + + boolean flag = true; +- int i1 = this.a(world); ++ int i1 = this.getFlowSpeed(world, i, j, k); // PaperSpigot + int j1; + + if (l > 0) { +@@ -289,11 +289,25 @@ public class BlockFlowing extends BlockFluids { + public void onPlace(World world, int i, int j, int k) { + super.onPlace(world, i, j, k); + if (world.getType(i, j, k) == this) { +- world.a(i, j, k, this, this.a(world)); ++ world.a(i, j, k, this, this.getFlowSpeed(world, i, j, k)); // PaperSpigot + } + } + + public boolean L() { + return true; + } ++ ++ /** ++ * PaperSpigot - Get flow speed. Throttle if its water and flowing adjacent to lava ++ */ ++ public int getFlowSpeed(World world, int x, int y, int z) { ++ if (this.getMaterial() == Material.WATER && ( ++ world.getType(x, y, z - 1).getMaterial() == Material.LAVA || ++ world.getType(x, y, z + 1).getMaterial() == Material.LAVA || ++ world.getType(x - 1, y, z).getMaterial() == Material.LAVA || ++ world.getType(x + 1, y, z).getMaterial() == Material.LAVA)) { ++ return world.paperSpigotConfig.waterOverLavaFlowSpeed; ++ } ++ return super.a(world); ++ } + } +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +index 5e72313..dccb780 100644 +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -176,4 +176,11 @@ public class PaperSpigotWorldConfig + // Technically a little disingenuous as it applies to all falling blocks but alas, backwards compat prevails! + fallingBlockHeightNerf = getDouble( "tnt-entity-height-nerf", 0 ); + } ++ ++ public int waterOverLavaFlowSpeed; ++ private void waterOverLavaFlowSpeed() ++ { ++ waterOverLavaFlowSpeed = getInt( "water-over-lava-flow-speed", 5 ); ++ log( "Water over lava flow speed: " + waterOverLavaFlowSpeed); ++ } + } +-- +1.9.1 +