fixed lock issues

Former-commit-id: dd609abbc99f82468aef18bc67e96078f3d73ff2 [formerly 81b130cc9f64a4898d118bad1a900fb5b979e188]
Former-commit-id: 54c2cbaf4fe9f2843ac7b367ffcdeefe80d898c1
This commit is contained in:
Ghost_chu committed 2019-05-25 22:21:38 +08:00
1 parent a7af085d06
commit 092bdbe4d7
2 files changed
+8 -4

No files matched your search

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