PaperMC/Spigot-Server-Patches/0035-Configurable-lava-flow-speed.patch
Zach Brown a4152b2ad1
Fix missed diff causing lava to move too quickly
Missed diff from old patch file was causing lava to always move at the
faster 'nether' speed, ignoring the slower overworld speed entirely.
This is why we use obfuscation helpers now.

Fixes GH-521
2016-12-21 15:29:50 -06:00

51 lines
2.3 KiB
Diff

From 43136d69e680c2f35f3b55b07f6ff59de2b57f6b 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 2ec5068..b5a106d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -198,4 +198,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 8e9de3b..0a28236 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -272,6 +272,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.isSkyMissing() ? 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 ||
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
index 660f3bc..a27512c 100644
--- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -114,6 +114,7 @@ public abstract class WorldProvider {
return this.f;
}
+ public final boolean isSkyMissing() { return this.n(); } // Paper - OBFHELPER
public boolean n() {
return this.e;
}
--
2.9.3