diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/LockListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/LockListener.java index e554a5610..eccf6cd99 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/LockListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/LockListener.java @@ -36,11 +36,15 @@ public class LockListener implements Listener { // Make sure they're not using the non-shop half of a double chest. if (shop == null) { b = Util.getSecondHalf(b); - if (b == null) + if (b == null) { + Util.debugLog(this.getClass(), "onClick","Another side block is null"); return; + } shop = plugin.getShopManager().getShop(b.getLocation()); - if (shop == null) + if (shop == null) { + Util.debugLog(this.getClass(), "onClick","Another side block is non shop"); return; + } } if (!shop.getModerator().isModerator(p.getUniqueId())) { if (p.hasPermission("quickshop.other.open")) { diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index 305032616..5d5cf946f 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -233,12 +233,12 @@ public class Util { Util.debugLog(Util.class, "getSecondHalf","Right should at "+ rightC.getLocation().toString()); if(equalsBlockStateLocation(oneSideOfChest.getLocation(), rightC.getLocation())) { Util.debugLog(Util.class, "getSecondHalf", "Right founded"); - return rightC.getBlock(); + return leftC.getBlock(); } if(equalsBlockStateLocation(oneSideOfChest.getLocation(), leftC.getLocation())) { Util.debugLog(Util.class, "getSecondHalf", "Left founded"); - return leftC.getBlock(); + return rightC.getBlock(); } return null;