2017-03-25 06:22:02 +01:00
|
|
|
From 16b591982a8417b9f551dd06a73d25cdf82842e1 Mon Sep 17 00:00:00 2001
|
2014-11-28 02:17:45 +01:00
|
|
|
From: Byteflux <byte@byteflux.net>
|
2016-03-01 00:09:49 +01:00
|
|
|
Date: Tue, 1 Mar 2016 14:27:13 -0600
|
2014-11-28 02:17:45 +01:00
|
|
|
Subject: [PATCH] Configurable speed for water flowing over lava
|
|
|
|
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2017-03-25 04:18:58 +01:00
|
|
|
index 8cdeb34d4..62e6830aa 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2017-03-25 04:18:58 +01:00
|
|
|
@@ -131,4 +131,10 @@ public class PaperWorldConfig {
|
2016-03-01 00:09:49 +01:00
|
|
|
if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
|
|
|
|
if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int waterOverLavaFlowSpeed;
|
|
|
|
+ private void waterOverLawFlowSpeed() {
|
|
|
|
+ waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5);
|
|
|
|
+ log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
|
|
|
|
+ }
|
|
|
|
}
|
2014-11-28 02:17:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
|
2017-03-25 04:18:58 +01:00
|
|
|
index c9294a58d..f4ac7bafa 100644
|
2014-11-28 02:17:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
|
2016-12-10 01:07:35 +01:00
|
|
|
@@ -30,7 +30,7 @@ public class BlockFlowing extends BlockFluids {
|
2014-11-28 02:17:45 +01:00
|
|
|
b0 = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
- int j = this.a(world);
|
2016-03-01 00:09:49 +01:00
|
|
|
+ int j = this.getFlowSpeed(world, blockposition); // Paper
|
2014-11-28 02:17:45 +01:00
|
|
|
int k;
|
|
|
|
|
|
|
|
if (i > 0) {
|
2016-12-10 01:07:35 +01:00
|
|
|
@@ -261,8 +261,22 @@ public class BlockFlowing extends BlockFluids {
|
2014-11-28 02:17:45 +01:00
|
|
|
|
|
|
|
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
if (!this.e(world, blockposition, iblockdata)) {
|
|
|
|
- world.a(blockposition, (Block) this, this.a(world));
|
2016-03-01 00:09:49 +01:00
|
|
|
+ world.a(blockposition, (Block) this, this.getFlowSpeed(world, blockposition)); // Paper
|
2014-11-28 02:17:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
2016-03-01 00:09:49 +01:00
|
|
|
+ * Paper - Get flow speed. Throttle if its water and flowing adjacent to lava
|
2014-11-28 02:17:45 +01:00
|
|
|
+ */
|
|
|
|
+ public int getFlowSpeed(World world, BlockPosition blockposition) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (this.material == Material.WATER && (
|
|
|
|
+ world.getType(blockposition.north(1)).getBlock().material == Material.LAVA ||
|
|
|
|
+ world.getType(blockposition.south(1)).getBlock().material == Material.LAVA ||
|
|
|
|
+ world.getType(blockposition.west(1)).getBlock().material == Material.LAVA ||
|
|
|
|
+ world.getType(blockposition.east(1)).getBlock().material == Material.LAVA)) {
|
|
|
|
+ return world.paperConfig.waterOverLavaFlowSpeed;
|
2014-11-28 02:17:45 +01:00
|
|
|
+ }
|
|
|
|
+ return super.a(world);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2017-03-25 04:18:58 +01:00
|
|
|
2.12.0.windows.1
|
2014-11-28 02:17:45 +01:00
|
|
|
|