Detect double chest shop #16

This commit is contained in:
KaiKikuchi committed 2015-11-18 12:01:51 +01:00
1 parent 943d870708
commit 37fb3ec3a7
1 file changed
+9 -2
@@ -69,8 +69,15 @@ public class PlayerListener implements Listener {
// Get the shop
Shop shop = plugin.getShopManager().getShop(loc);
// If that wasn't a shop, search nearby shops
if (shop == null && b.getType() == Material.WALL_SIGN) {
Block attached = Util.getAttached(b);
if (shop == null) {
Block attached = null;
if (b.getType() == Material.WALL_SIGN) {
attached = Util.getAttached(b);
} else if (b.getType() == Material.CHEST || b.getType() == Material.TRAPPED_CHEST) {
attached = Util.getSecondHalf(b);
}
if (attached != null) {
shop = plugin.getShopManager().getShop(attached.getLocation());
}