mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Tick fluids config
This commit is contained in:
committed by
granny
parent
1fa2faad53
commit
1f2ee74cab
@@ -1,58 +0,0 @@
|
|||||||
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/net/minecraft/world/level/block/LiquidBlock.java b/net/minecraft/world/level/block/LiquidBlock.java
|
|
||||||
index a2d023ff011f71f80032f02430a53d6a08a23623..8c1c24e98f79888faee204129145746279d5d159 100644
|
|
||||||
--- a/net/minecraft/world/level/block/LiquidBlock.java
|
|
||||||
+++ b/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;
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
--- a/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
|
@@ -134,7 +_,7 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||||
|
- if (this.shouldSpreadLiquid(level, pos, state)) {
|
||||||
|
+ if (level.purpurConfig.tickFluids && this.shouldSpreadLiquid(level, pos, state)) { // Purpur - Tick fluids config
|
||||||
|
level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -169,7 +_,7 @@
|
||||||
|
BlockState neighborState,
|
||||||
|
RandomSource random
|
||||||
|
) {
|
||||||
|
- if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) {
|
||||||
|
+ if (level.getWorldBorder().world.purpurConfig.tickFluids && state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { // Purpur - Tick fluids config
|
||||||
|
scheduledTickAccess.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(level));
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -178,7 +_,7 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
||||||
|
- if (this.shouldSpreadLiquid(level, pos, state)) {
|
||||||
|
+ if (level.purpurConfig.tickFluids && this.shouldSpreadLiquid(level, pos, state)) { // Purpur - Tick fluids config
|
||||||
|
level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -127,6 +127,7 @@ public class PurpurWorldConfig {
|
|||||||
public boolean imposeTeleportRestrictionsOnGateways = false;
|
public boolean imposeTeleportRestrictionsOnGateways = false;
|
||||||
public boolean imposeTeleportRestrictionsOnNetherPortals = false;
|
public boolean imposeTeleportRestrictionsOnNetherPortals = false;
|
||||||
public boolean imposeTeleportRestrictionsOnEndPortals = false;
|
public boolean imposeTeleportRestrictionsOnEndPortals = false;
|
||||||
|
public boolean tickFluids = true;
|
||||||
private void miscGameplayMechanicsSettings() {
|
private void miscGameplayMechanicsSettings() {
|
||||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||||
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
||||||
@@ -146,7 +147,7 @@ public class PurpurWorldConfig {
|
|||||||
imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
|
imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
|
||||||
imposeTeleportRestrictionsOnNetherPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-nether-portals", imposeTeleportRestrictionsOnNetherPortals);
|
imposeTeleportRestrictionsOnNetherPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-nether-portals", imposeTeleportRestrictionsOnNetherPortals);
|
||||||
imposeTeleportRestrictionsOnEndPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-end-portals", imposeTeleportRestrictionsOnEndPortals);
|
imposeTeleportRestrictionsOnEndPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-end-portals", imposeTeleportRestrictionsOnEndPortals);
|
||||||
|
tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int daytimeTicks = 12000;
|
public int daytimeTicks = 12000;
|
||||||
|
|||||||
Reference in New Issue
Block a user