mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-17 13:00:04 +08:00
35 lines
1.8 KiB
Diff
35 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
Date: Sat, 12 Dec 2020 14:34:18 -0800
|
|
Subject: [PATCH] Option for chests to open even with a solid block on top
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
|
|
index 5e22d175b1048a58802cdf64ac70a8b56329e915..d81946b400f208c39941128ce823ff7709741c10 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
|
|
@@ -355,6 +355,7 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
|
|
}
|
|
|
|
private static boolean isBlockedChestByBlock(BlockGetter world, BlockPos pos) {
|
|
+ if (world instanceof Level && ((Level) world).purpurConfig.chestOpenWithBlockOnTop) return false; // Purpur
|
|
BlockPos blockposition1 = pos.above();
|
|
|
|
return world.getBlockState(blockposition1).isRedstoneConductor(world, blockposition1);
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index d755e920048324ae17a08fee7546a4b2fb594f7c..57cb484499525278fe2664ccba83503e9344a874 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -423,6 +423,11 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public boolean chestOpenWithBlockOnTop = false;
|
|
+ private void chestSettings() {
|
|
+ chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
|
+ }
|
|
+
|
|
public boolean dispenserApplyCursedArmor = true;
|
|
public boolean dispenserPlaceAnvils = false;
|
|
private void dispenserSettings() {
|