Add config options to prevent barrels and crucibles from collecting rainwater

This commit is contained in:
thedarkcolour 2024-05-31 15:10:29 -07:00
parent f59fa93def
commit 9ea5529ce6
No known key found for this signature in database
GPG Key ID: 6599A8E0516C8F38
3 changed files with 10 additions and 2 deletions

View File

@ -366,7 +366,7 @@ public abstract class AbstractCrucibleBlockEntity extends EBlockEntity {
crucible.markUpdated(); crucible.markUpdated();
} }
} }
if (tank.getFluidAmount() < MAX_FLUID_CAPACITY && crucible instanceof WaterCrucibleBlockEntity && level.isRainingAt(pos.above())) { if (EConfig.SERVER.cruciblesCollectRainWater.get() && tank.getFluidAmount() < MAX_FLUID_CAPACITY && crucible instanceof WaterCrucibleBlockEntity && level.isRainingAt(pos.above())) {
BarrelBlockEntity.fillRainWater(crucible, tank); BarrelBlockEntity.fillRainWater(crucible, tank);
} }
} }

View File

@ -540,7 +540,7 @@ public class BarrelBlockEntity extends EBlockEntity {
} }
barrel.markUpdated(); barrel.markUpdated();
} }
} else if (tank.getFluidAmount() < MAX_CAPACITY && level.isRainingAt(pos.above()) && barrel.item.getStackInSlot(0).isEmpty() && barrel.compost == 0) { } else if (EConfig.SERVER.barrelsCollectRainWater.get() && tank.getFluidAmount() < MAX_CAPACITY && level.isRainingAt(pos.above()) && barrel.item.getStackInSlot(0).isEmpty() && barrel.compost == 0) {
fillRainWater(barrel, tank); fillRainWater(barrel, tank);
// avoid checking fluid transform until full // avoid checking fluid transform until full

View File

@ -139,6 +139,8 @@ public class EConfig {
public final IntValue mechanicalHammerEnergyStorage; public final IntValue mechanicalHammerEnergyStorage;
public final IntValue mechanicalHammerEnergyConsumption; public final IntValue mechanicalHammerEnergyConsumption;
public final IntValue sieveIntervalTicks; public final IntValue sieveIntervalTicks;
public final BooleanValue barrelsCollectRainWater;
public final BooleanValue cruciblesCollectRainWater;
public Server(ForgeConfigSpec.Builder builder) { public Server(ForgeConfigSpec.Builder builder) {
builder.comment("Server configuration for Ex Deorum").push("server"); builder.comment("Server configuration for Ex Deorum").push("server");
@ -203,6 +205,12 @@ public class EConfig {
this.sieveIntervalTicks = builder this.sieveIntervalTicks = builder
.comment("The minimum number of ticks a player must wait between two sifting operations. Only affects sifting by hand. 0 means no limit.") .comment("The minimum number of ticks a player must wait between two sifting operations. Only affects sifting by hand. 0 means no limit.")
.defineInRange("sieve_interval", 1, 0, Integer.MAX_VALUE); .defineInRange("sieve_interval", 1, 0, Integer.MAX_VALUE);
this.barrelsCollectRainWater = builder
.comment("Whether barrels fill up with rain water while it is raining and the barrel is exposed to the sky.")
.define("barrels_collect_rain_water", true);
this.cruciblesCollectRainWater = builder
.comment("Whether wooden crucibles fill up with rain water while it is raining and the barrel is exposed to the sky.")
.define("crucibles_collect_rain_water", true);
builder.pop(); builder.pop();
} }
} }