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/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
index c4ff93a6b908c1bd157c7fe45b504909b189d09c..71a32a317e38b9c8f802fd5dd9ae546fb46eb020 100644
--- a/src/main/java/net/minecraft/server/BlockChest.java
+++ b/src/main/java/net/minecraft/server/BlockChest.java
@@ -262,6 +262,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 b630887b4ba9288e9724e97658d903ab334c3f8b..98211b159564f1674c84a5ec7cce37a1f077af5e 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -381,6 +381,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() {
