Config to not let coral die

This commit is contained in:
Encode42
2025-01-12 15:40:23 -08:00
committed by granny
parent cbd49cce26
commit dc60c29e5d
4 changed files with 25 additions and 46 deletions

View File

@@ -0,0 +1,10 @@
--- a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
+++ b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
@@ -39,6 +_,7 @@
}
protected static boolean scanForWater(BlockState state, BlockGetter level, BlockPos pos) {
+ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die
if (state.getValue(WATERLOGGED)) {
return true;
} else {

View File

@@ -0,0 +1,10 @@
--- a/net/minecraft/world/level/block/CoralBlock.java
+++ b/net/minecraft/world/level/block/CoralBlock.java
@@ -65,6 +_,7 @@
}
protected boolean scanForWater(BlockGetter level, BlockPos pos) {
+ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die
for (Direction direction : Direction.values()) {
FluidState fluidState = level.getFluidState(pos.relative(direction));
if (fluidState.is(FluidTags.WATER)) {

View File

@@ -880,6 +880,11 @@ public class PurpurWorldConfig {
composterBulkProcess = getBoolean("blocks.composter.sneak-to-bulk-process", composterBulkProcess);
}
public boolean coralDieOutsideWater = true;
private void coralSettings() {
coralDieOutsideWater = getBoolean("blocks.coral.die-outside-water", coralDieOutsideWater);
}
public boolean dispenserApplyCursedArmor = true;
public boolean dispenserPlaceAnvils = false;
private void dispenserSettings() {