CavePVP-Stuff/cSpigot-master/spigot-server-Patches/0068-Configurable-lava-flow...

41 lines
1.9 KiB
Diff

From 61e8a516913e5564e5281a45a17c33e469a3f3a8 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 24 Jun 2015 07:02:21 -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 2b5866f2f..41bdebd53 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -310,6 +310,9 @@ public class BlockFlowing extends BlockFluids {
* PaperSpigot - Get flow speed. Throttle if its water and flowing adjacent to lava
*/
public int getFlowSpeed(World world, int x, int y, int z) {
+ if (this.getMaterial() == Material.LAVA) {
+ return world.worldProvider.g ? world.paperSpigotConfig.lavaFlowSpeedNether : world.paperSpigotConfig.lavaFlowSpeedNormal;
+ }
if (this.getMaterial() == Material.WATER && (
world.getType(x, y, z - 1).getMaterial() == Material.LAVA ||
world.getType(x, y, z + 1).getMaterial() == Material.LAVA ||
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 0aea20787..cbfc9b15e 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -273,4 +273,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.13.3