Fix issues with double chests not begin detected as shops in some cases

This commit is contained in:
Phoenix616 2019-08-31 11:20:02 +01:00
parent b718fcc429
commit 58cf96dca8
1 changed files with 7 additions and 1 deletions

View File

@ -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) {