aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0039-Configurable-lava-flow-speed.patch
blob: 5c51e4ea281b53be9cd7c1299dbb863a30c4919a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 4e9c8a5c496584442c77125e51fda1f54f8bfa8f Mon Sep 17 00:00:00 2001
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
--- 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 {
         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
index de10bc4..2eb8622 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -280,6 +280,9 @@ public class BlockFlowing extends BlockFluids {
      * 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 ||
-- 
2.8.2