aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0053-Configurable-lava-flow-speed.patch
blob: 5a3acc57327b588deb3daaa17b9bcd8cbe87a4b7 (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
40
From 70a6bd60d4c817a5d2420fdefcc6ad1d4afe869a Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 1 Jul 2015 00:38:10 -0700
Subject: [PATCH] Configurable lava flow speed


diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
index fc3fc48..23130ba 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -276,6 +276,9 @@ public class BlockFlowing extends BlockFluids {
      * PaperSpigot - Get flow speed. Throttle if its water and flowing adjacent to lava
      */
     public int getFlowSpeed(World world, BlockPosition blockposition) {
+        if (this.getMaterial() == Material.LAVA) {
+            return world.worldProvider.o() ? world.paperSpigotConfig.lavaFlowSpeedNether : world.paperSpigotConfig.lavaFlowSpeedNormal;
+        }
         if (this.getMaterial() == Material.WATER && (
                 world.getType(blockposition.north(1)).getBlock().getMaterial() == Material.LAVA ||
                         world.getType(blockposition.south(1)).getBlock().getMaterial() == Material.LAVA ||
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 56c8433..349f77a 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -320,4 +320,12 @@ public class PaperSpigotWorldConfig
         fastDrainLava = getBoolean( "fast-drain.lava", false );
         fastDrainWater = getBoolean( "fast-drain.water", false );
     }
+
+    public int lavaFlowSpeedNormal;
+    public int lavaFlowSpeedNether;
+    private void lavaFlowSpeed()
+    {
+        lavaFlowSpeedNormal = getInt( "lava-flow-speed.normal", 30 );
+        lavaFlowSpeedNether = getInt( "lava-flow-speed.nether", 10 );
+    }
 }
-- 
2.7.0