mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-17 13:00:04 +08:00
Config to not let coral die
This commit is contained in:
parent
24434478ef
commit
d1485fa5b6
46
patches/server/0283-Config-to-not-let-coral-die.patch
Normal file
46
patches/server/0283-Config-to-not-let-coral-die.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Mon, 4 Jul 2022 13:57:06 -0400
|
||||
Subject: [PATCH] Config to not let coral die
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java b/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
||||
index 3d2b34c5a7c9b00c1164b4f89c2cbff81fc460eb..74dc016c3a6f6dbb96aba913117807fbcf955346 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
||||
@@ -35,6 +35,7 @@ public class BaseCoralPlantTypeBlock extends Block implements SimpleWaterloggedB
|
||||
}
|
||||
|
||||
protected static boolean scanForWater(BlockState state, BlockGetter world, BlockPos pos) {
|
||||
+ if (!((net.minecraft.world.level.Level) world).purpurConfig.coralDieOutsideWater) return true; // Purpur
|
||||
if (state.getValue(WATERLOGGED)) {
|
||||
return true;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CoralBlock.java b/src/main/java/net/minecraft/world/level/block/CoralBlock.java
|
||||
index 88faea00be60a519f56f975a5311df5e1eb3e6b8..c0284626963711ee42a8d395bcf8a147d14de7a3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CoralBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CoralBlock.java
|
||||
@@ -45,6 +45,7 @@ public class CoralBlock extends Block {
|
||||
}
|
||||
|
||||
protected boolean scanForWater(BlockGetter world, BlockPos pos) {
|
||||
+ if (!((net.minecraft.world.level.Level) world).purpurConfig.coralDieOutsideWater) return true; // Purpur
|
||||
Direction[] aenumdirection = Direction.values();
|
||||
int i = aenumdirection.length;
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 1ffa1182482cd5581979de3ef20a0dc1178eabf4..fad04b8c56d6183bc72f78915847e56c77228106 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -800,6 +800,11 @@ public class PurpurWorldConfig {
|
||||
caveVinesMaxGrowthAge = getInt("blocks.cave_vines.max-growth-age", caveVinesMaxGrowthAge);
|
||||
}
|
||||
|
||||
+ 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() {
|
Loading…
Reference in New Issue
Block a user