From 2d3b1e36f98bc00fcb414fa6819871d363b2ec13 Mon Sep 17 00:00:00 2001 From: khj xiaogu <54445543+khjxiaogu@users.noreply.github.com> Date: Mon, 13 Sep 2021 23:30:31 +0800 Subject: [PATCH] Added Option to fill infinite resources (#2071) - Added fill infinite config option - Option to make hose pulley fill infinite sources --- .../contraptions/fluids/actors/FluidFillingBehaviour.java | 2 +- .../fluids/actors/FluidManipulationBehaviour.java | 6 +++++- .../java/com/simibubi/create/foundation/config/CFluids.java | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java index 7ac14a5e9..612b82201 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java @@ -127,7 +127,7 @@ public class FluidFillingBehaviour extends FluidManipulationBehaviour { boolean evaporate = world.dimensionType() .ultraWarm() && fluid.is(FluidTags.WATER); - if (infinite || evaporate) { + if ((!fillInfinite() && infinite) || evaporate) { FluidState fluidState = world.getFluidState(rootPos); boolean equivalentTo = fluidState.getType() .isSame(fluid); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java index 69f013bc4..a417ef747 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java @@ -90,7 +90,11 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour { protected int maxBlocks() { return AllConfigs.SERVER.fluids.hosePulleyBlockThreshold.get(); } - + + protected boolean fillInfinite() { + return AllConfigs.SERVER.fluids.fillInfinite.get(); + } + public void reset() { if (affectedArea != null) scheduleUpdatesInAffectedArea(); diff --git a/src/main/java/com/simibubi/create/foundation/config/CFluids.java b/src/main/java/com/simibubi/create/foundation/config/CFluids.java index ad8684da1..f0c3c251c 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CFluids.java +++ b/src/main/java/com/simibubi/create/foundation/config/CFluids.java @@ -9,6 +9,7 @@ public class CFluids extends ConfigBase { public ConfigInt hosePulleyBlockThreshold = i(10000, -1, "hosePulleyBlockThreshold", Comments.blocks, Comments.toDisable, Comments.hosePulleyBlockThreshold); + public ConfigBool fillInfinite = b(false, "fillInfinite",Comments.fillInfinite); public ConfigInt hosePulleyRange = i(128, 1, "hosePulleyRange", Comments.blocks, Comments.hosePulleyRange); @Override @@ -28,6 +29,7 @@ public class CFluids extends ConfigBase { static String toDisable = "[-1 to disable this behaviour]"; static String hosePulleyBlockThreshold = "The minimum amount of fluid blocks the hose pulley needs to find before deeming it an infinite source."; + static String fillInfinite="Does hose pulley poor fluids to the world even if it is an infinite source?"; } }