geforkt von Mirrors/Paper
19b4f78b55
Replaces the "use-chunk-inhabited-timer" config option with the options "use-fixed-chunk-inhabited-time" and "fixed-chunk-inhabited-time". When using "use-fixed-chunk-inhabited-time=false" everything will be the same like it was with "use-chunk-inhabited-timer=true". When using "use-fixed-chunk-inhabited-time=true" and "fixed-chunk-inhabited-time=0" everything will be the same like it was with "use-chunk-inhabited-timer=false". Instead of just using 0 when all chunks should be treated equally this allows to fine-tune vanilla gameplay.
69 Zeilen
3.2 KiB
Diff
69 Zeilen
3.2 KiB
Diff
From f9207700a1c84a637d183465d863ecc241360f02 Mon Sep 17 00:00:00 2001
|
|
From: Byteflux <byte@byteflux.net>
|
|
Date: Wed, 8 Aug 2018 16:33:21 -0600
|
|
Subject: [PATCH] Configurable speed for water flowing over lava
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 2220a18d9..94c544714 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -472,6 +472,12 @@ public class PaperWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public int waterOverLavaFlowSpeed;
|
|
+ private void waterOverLavaFlowSpeed() {
|
|
+ waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5);
|
|
+ log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
|
|
+ }
|
|
+
|
|
public enum DuplicateUUIDMode {
|
|
SAFE_REGEN, DELETE, NOTHING, WARN
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java
|
|
index 56f26da41..ddf2fc67e 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockFluids.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockFluids.java
|
|
@@ -78,11 +78,27 @@ public class BlockFluids extends Block implements IFluidSource {
|
|
|
|
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) {
|
|
if (this.a(world, blockposition, iblockdata)) {
|
|
- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
|
|
+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
|
|
}
|
|
|
|
}
|
|
|
|
+ // Paper start - Get flow speed. Throttle if its water and flowing adjacent to lava
|
|
+ public int getFlowSpeed(World world, BlockPosition blockposition) {
|
|
+ if (this.material == Material.WATER) {
|
|
+ if (
|
|
+ world.getMaterialIfLoaded(blockposition.north(1)) == Material.LAVA ||
|
|
+ world.getMaterialIfLoaded(blockposition.south(1)) == Material.LAVA ||
|
|
+ world.getMaterialIfLoaded(blockposition.west(1)) == Material.LAVA ||
|
|
+ world.getMaterialIfLoaded(blockposition.east(1)) == Material.LAVA
|
|
+ ) {
|
|
+ return world.paperConfig.waterOverLavaFlowSpeed;
|
|
+ }
|
|
+ }
|
|
+ return this.a(world);
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
|
if (iblockdata.s().d() || iblockdata1.s().d()) {
|
|
generatoraccess.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess));
|
|
@@ -93,7 +109,7 @@ public class BlockFluids extends Block implements IFluidSource {
|
|
|
|
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) {
|
|
if (this.a(world, blockposition, iblockdata)) {
|
|
- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
|
|
+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
|
|
}
|
|
|
|
}
|
|
--
|
|
2.20.0
|
|
|