mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Config to not let coral die
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
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/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
||||
index d7ca7a43d2d5f8cad416156fd40588cdd6634f52..920ad0a4ecc83da82c8382a48883cefb7a4b9d11 100644
|
||||
--- a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
||||
+++ b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
||||
@@ -39,6 +39,7 @@ public abstract class BaseCoralPlantTypeBlock extends Block implements SimpleWat
|
||||
}
|
||||
|
||||
protected static boolean scanForWater(BlockState state, BlockGetter world, BlockPos pos) {
|
||||
+ if (!((net.minecraft.world.level.LevelAccessor) world).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die
|
||||
if (state.getValue(WATERLOGGED)) {
|
||||
return true;
|
||||
} else {
|
||||
diff --git a/net/minecraft/world/level/block/CoralBlock.java b/net/minecraft/world/level/block/CoralBlock.java
|
||||
index a59b23f4062fa896836dec72cbd5097411774ad1..c87b90041825172afd079202241b7f9a206816c6 100644
|
||||
--- a/net/minecraft/world/level/block/CoralBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CoralBlock.java
|
||||
@@ -60,6 +60,7 @@ public class CoralBlock extends Block {
|
||||
}
|
||||
|
||||
protected boolean scanForWater(BlockGetter world, BlockPos pos) {
|
||||
+ if (!((net.minecraft.world.level.LevelAccessor) world).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die
|
||||
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 5c0e0613c8e25f77b8ca92af09ef9b535e85995d..d80584a0412b6699c24f5817e8ec26cf9f46d92d 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -881,6 +881,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() {
|
||||
Reference in New Issue
Block a user