mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
35 lines
1.8 KiB
Diff
35 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: jmp <jasonpenilla2@me.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/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java
|
|
index a45ee959f41e7f349ff2c309f21fa44ec671cb87..cddf8e3d34385eb264cd28ba6b4392d682df0360 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/BlockChest.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java
|
|
@@ -306,6 +306,7 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I
|
|
}
|
|
|
|
private static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition) {
|
|
+ if (iblockaccess instanceof World && ((World) iblockaccess).purpurConfig.chestOpenWithBlockOnTop) return false; // Purpur
|
|
BlockPosition blockposition1 = blockposition.up();
|
|
|
|
return iblockaccess.getType(blockposition1).isOccluding(iblockaccess, blockposition1);
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index c84a331c157ea1180813cba1107bf901a35b2833..3d1cfd550b12c8dd4bd536c518ac169ff6bbfe50 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -439,6 +439,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() {
|