PaperMC/Spigot-Server-Patches/Configurable-lava-flow-speed.patch

37 lines
1.8 KiB
Diff
Raw Normal View History

2015-07-01 00:39:31 -07:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
2016-02-29 17:09:49 -06:00
Date: Wed, 2 Mar 2016 12:27:07 -0600
2015-07-01 00:39:31 -07:00
Subject: [PATCH] Configurable lava flow speed
2016-02-29 17:09:49 -06:00
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-12-09 18:07:35 -06:00
index 2ec50685c..b5a106d5b 100644
2016-02-29 17:09:49 -06:00
--- 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 {
fastDrainLava = getBoolean("fast-drain.lava", false);
fastDrainWater = getBoolean("fast-drain.water", false);
}
+
+ public int lavaFlowSpeedNormal;
+ public int lavaFlowSpeedNether;
+ private void lavaFlowSpeeds() {
+ lavaFlowSpeedNormal = getInt("lava-flow-speed.normal", 30);
+ lavaFlowSpeedNether = getInt("lava-flow-speed.nether", 10);
+ }
}
2015-07-01 00:39:31 -07:00
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
2016-12-09 18:07:35 -06:00
index 8e9de3bcb..765a37160 100644
2015-07-01 00:39:31 -07:00
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
2016-02-29 17:09:49 -06:00
* Paper - Get flow speed. Throttle if its water and flowing adjacent to lava
2015-07-01 00:39:31 -07:00
*/
public int getFlowSpeed(World world, BlockPosition blockposition) {
2016-02-29 17:09:49 -06:00
+ if (this.material == Material.LAVA) {
+ return world.worldProvider.m() ? world.paperConfig.lavaFlowSpeedNether : world.paperConfig.lavaFlowSpeedNormal;
2015-07-01 00:39:31 -07:00
+ }
2016-02-29 17:09:49 -06:00
if (this.material == Material.WATER && (
world.getType(blockposition.north(1)).getBlock().material == Material.LAVA ||
world.getType(blockposition.south(1)).getBlock().material == Material.LAVA ||
--