Files
Purpur/patches/server/0133-Tick-fluids-config.patch
2024-12-20 15:44:16 -08:00

59 lines
4.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Mon, 15 Mar 2021 03:52:17 -0500
Subject: [PATCH] Tick fluids config
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
index a2d023ff011f71f80032f02430a53d6a08a23623..8c1c24e98f79888faee204129145746279d5d159 100644
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
@@ -140,7 +140,7 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
- if (this.shouldSpreadLiquid(world, pos, state)) {
+ if (world.purpurConfig.tickFluids && this.shouldSpreadLiquid(world, pos, state)) { // Purpur - Tick fluids config
world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
}
@@ -168,7 +168,7 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
- if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) {
+ if (world.getWorldBorder().world.purpurConfig.tickFluids && state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { // Purpur - Tick fluids config
tickView.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
}
@@ -177,7 +177,7 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) {
- if (this.shouldSpreadLiquid(world, pos, state)) {
+ if (world.purpurConfig.tickFluids && this.shouldSpreadLiquid(world, pos, state)) { // Purpur - Tick fluids config
world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index c1f1c20bfa038e66e3fc2dab1a2d5ccc1bbbd3f2..dd33aa2d92296090d6d75d294e91f2272b57e6fc 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -135,6 +135,7 @@ public class PurpurWorldConfig {
public boolean imposeTeleportRestrictionsOnGateways = false;
public boolean imposeTeleportRestrictionsOnNetherPortals = false;
public boolean imposeTeleportRestrictionsOnEndPortals = false;
+ public boolean tickFluids = true;
private void miscGameplayMechanicsSettings() {
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
@@ -154,7 +155,7 @@ public class PurpurWorldConfig {
imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
imposeTeleportRestrictionsOnNetherPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-nether-portals", imposeTeleportRestrictionsOnNetherPortals);
imposeTeleportRestrictionsOnEndPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-end-portals", imposeTeleportRestrictionsOnEndPortals);
-
+ tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids);
}
public int daytimeTicks = 12000;