2016-01-17 03:04:07 +00:00
|
|
|
From 89acd9868cbace41415af5c22266009e9e7b8764 Mon Sep 17 00:00:00 2001
|
2014-11-28 01:17:45 +00:00
|
|
|
From: Byteflux <byte@byteflux.net>
|
2015-03-08 01:16:09 +00:00
|
|
|
Date: Sat, 7 Mar 2015 22:17:03 -0600
|
2014-11-28 01:17:45 +00:00
|
|
|
Subject: [PATCH] Configurable speed for water flowing over lava
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
|
2015-06-04 10:57:23 +00:00
|
|
|
index 5d36af3..de1dddb 100644
|
2014-11-28 01:17:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
|
|
|
|
@@ -35,7 +35,7 @@ public class BlockFlowing extends BlockFluids {
|
|
|
|
b0 = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
- int j = this.a(world);
|
|
|
|
+ int j = this.getFlowSpeed(world, blockposition); // PaperSpigot
|
|
|
|
int k;
|
|
|
|
|
|
|
|
if (i > 0) {
|
2015-03-08 01:16:09 +00:00
|
|
|
@@ -259,8 +259,22 @@ public class BlockFlowing extends BlockFluids {
|
2014-11-28 01:17:45 +00:00
|
|
|
|
|
|
|
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
if (!this.e(world, blockposition, iblockdata)) {
|
|
|
|
- world.a(blockposition, (Block) this, this.a(world));
|
|
|
|
+ world.a(blockposition, (Block) this, this.getFlowSpeed(world, blockposition)); // PaperSpigot
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * PaperSpigot - Get flow speed. Throttle if its water and flowing adjacent to lava
|
|
|
|
+ */
|
|
|
|
+ public int getFlowSpeed(World world, BlockPosition blockposition) {
|
|
|
|
+ if (this.getMaterial() == Material.WATER && (
|
|
|
|
+ world.getType(blockposition.north(1)).getBlock().getMaterial() == Material.LAVA ||
|
|
|
|
+ world.getType(blockposition.south(1)).getBlock().getMaterial() == Material.LAVA ||
|
|
|
|
+ world.getType(blockposition.west(1)).getBlock().getMaterial() == Material.LAVA ||
|
|
|
|
+ world.getType(blockposition.east(1)).getBlock().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
|
2016-01-17 03:04:07 +00:00
|
|
|
index 52c05a8..781cf75 100644
|
2014-11-28 01:17:45 +00:00
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
2016-01-17 03:04:07 +00:00
|
|
|
@@ -166,4 +166,11 @@ public class PaperSpigotWorldConfig
|
|
|
|
log( "TNT Entity Height Limit set to Y: " + tntEntityHeightNerf );
|
2014-11-28 01:17:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int waterOverLavaFlowSpeed;
|
|
|
|
+ private void waterOverLavaFlowSpeed()
|
|
|
|
+ {
|
|
|
|
+ waterOverLavaFlowSpeed = getInt( "water-over-lava-flow-speed", 5 );
|
|
|
|
+ log( "Water over lava flow speed: " + waterOverLavaFlowSpeed );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2016-01-17 03:04:07 +00:00
|
|
|
2.7.0
|
2014-11-28 01:17:45 +00:00
|
|
|
|