From d5581a7a2e0c05f7701ae2aa57db82e3ae9f8edf Mon Sep 17 00:00:00 2001 From: 502647092 Date: Fri, 9 Oct 2015 08:36:01 +0800 Subject: [PATCH] fix SuperItem Create Shop error... Signed-off-by: 502647092 --- .../maxgamer/QuickShop/Listeners/PlayerListener.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java b/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java index 65c4330..c33cee1 100644 --- a/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java +++ b/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java @@ -41,16 +41,12 @@ public class PlayerListener implements Listener { */ @EventHandler(priority = EventPriority.MONITOR) public void onClick(final PlayerInteractEvent e) { - if (e.getAction() != Action.LEFT_CLICK_BLOCK || e.getMaterial() == plugin.getConfigManager().getSuperItem()) { - return; - } final Block b = e.getClickedBlock(); - if (!Util.canBeShop(b) && b.getType() != Material.WALL_SIGN) { + final Player p = e.getPlayer(); + if (e.getAction() != Action.LEFT_CLICK_BLOCK || (e.getMaterial() == plugin.getConfigManager().getSuperItem() && b.getType() != Material.WALL_SIGN)) { return; } - final Player p = e.getPlayer(); - if (plugin.getConfigManager().isSneak() != p.isSneaking()) { - // Sneak only + if (!Util.canBeShop(b) || plugin.getConfigManager().isSneak() != p.isSneaking()) { return; } final Location loc = b.getLocation(); @@ -175,7 +171,7 @@ public class PlayerListener implements Listener { if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (p.hasPermission("quickshop.unlimited")) { shop.setUnlimited(!shop.isUnlimited()); - p.sendMessage(MsgUtil.p("command.toggle-unlimited", (shop.isUnlimited() ? "无限模式" : "有限模式"))); + p.sendMessage(MsgUtil.p("command.toggle-unlimited", (shop.isUnlimited() ? "§e无限模式" : "§c有限模式"))); return; } } else {