Paper 1.9
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Byteflux <byte@byteflux.net>
|
||||
Date: Sat, 7 Mar 2015 22:17:03 -0600
|
||||
Date: Tue, 1 Mar 2016 14:27:13 -0600
|
||||
Subject: [PATCH] Configurable speed for water flowing over lava
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
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);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
|
||||
@@ -13,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
- int j = this.a(world);
|
||||
+ int j = this.getFlowSpeed(world, blockposition); // PaperSpigot
|
||||
+ int j = this.getFlowSpeed(world, blockposition); // Paper
|
||||
int k;
|
||||
|
||||
if (i > 0) {
|
||||
@@ -22,39 +37,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
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
|
||||
+ world.a(blockposition, (Block) this, this.getFlowSpeed(world, blockposition)); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * PaperSpigot - Get flow speed. Throttle if its water and flowing adjacent to lava
|
||||
+ * Paper - 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;
|
||||
+ 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;
|
||||
+ }
|
||||
+ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
|
||||
log( "TNT Entity Height Limit set to Y: " + tntEntityHeightNerf );
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public int waterOverLavaFlowSpeed;
|
||||
+ private void waterOverLavaFlowSpeed()
|
||||
+ {
|
||||
+ waterOverLavaFlowSpeed = getInt( "water-over-lava-flow-speed", 5 );
|
||||
+ log( "Water over lava flow speed: " + waterOverLavaFlowSpeed );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user