Paper/Spigot-Server-Patches/0039-Configurable-lava-flow-speed.patch

40 lines
1.8 KiB
Diff
Raw Normal View History

2016-06-09 05:57:14 +02:00
From b24e5f750fea9cddda7c7379f0e0d3a041c6c4d3 Mon Sep 17 00:00:00 2001
2016-03-01 00:09:49 +01:00
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 12:27:07 -0600
Subject: [PATCH] Configurable lava flow speed
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f8b90e3..004d4c0 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
@@ -207,4 +207,11 @@ public class PaperWorldConfig {
2016-03-01 00:09:49 +01:00
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);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
2016-06-09 05:57:14 +02:00
index 0b5bc19..0336b9c 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
2016-05-12 04:07:46 +02:00
@@ -280,6 +280,9 @@ public class BlockFlowing extends BlockFluids {
2016-03-01 00:09:49 +01:00
* Paper - Get flow speed. Throttle if its water and flowing adjacent to lava
*/
public int getFlowSpeed(World world, BlockPosition blockposition) {
+ if (this.material == Material.LAVA) {
+ return world.worldProvider.m() ? world.paperConfig.lavaFlowSpeedNether : world.paperConfig.lavaFlowSpeedNormal;
+ }
if (this.material == Material.WATER && (
world.getType(blockposition.north(1)).getBlock().material == Material.LAVA ||
world.getType(blockposition.south(1)).getBlock().material == Material.LAVA ||
--
2016-06-09 05:57:14 +02:00
2.8.3
2016-03-01 00:09:49 +01:00