Added Option to fill infinite resources (#2071)

- Added fill infinite config option 
- Option to make hose pulley fill infinite sources
This commit is contained in:
khj xiaogu 2021-09-13 23:30:31 +08:00 committed by GitHub
parent 72a8e24cf7
commit 2d3b1e36f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -91,6 +91,10 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour {
return AllConfigs.SERVER.fluids.hosePulleyBlockThreshold.get();
}
protected boolean fillInfinite() {
return AllConfigs.SERVER.fluids.fillInfinite.get();
}
public void reset() {
if (affectedArea != null)
scheduleUpdatesInAffectedArea();

View File

@ -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?";
}
}