From 58cf96dca8ac1107c55f75627b2263f8984461e8 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Sat, 31 Aug 2019 11:20:02 +0100 Subject: [PATCH] Fix issues with double chests not begin detected as shops in some cases --- .../java/com/Acrobot/ChestShop/Signs/ChestShopSign.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Signs/ChestShopSign.java b/src/main/java/com/Acrobot/ChestShop/Signs/ChestShopSign.java index 1661346..3ad8ac8 100644 --- a/src/main/java/com/Acrobot/ChestShop/Signs/ChestShopSign.java +++ b/src/main/java/com/Acrobot/ChestShop/Signs/ChestShopSign.java @@ -102,7 +102,13 @@ public class ChestShopSign { } public static boolean isShopBlock(InventoryHolder holder) { - return holder instanceof BlockState && isShopBlock(((BlockState) holder).getBlock()); + if (holder instanceof DoubleChest) { + return isShopBlock(((DoubleChest) holder).getLeftSide()) + || isShopBlock(((DoubleChest) holder).getRightSide()); + } else if (holder instanceof BlockState) { + return isShopBlock(((BlockState) holder).getBlock()); + } + return false; } public static boolean canAccess(Player player, Sign sign) {