mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2024-11-22 01:58:54 +00:00
fix SuperItem Create Shop error...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
379f6593c9
commit
d5581a7a2e
@ -41,16 +41,12 @@ public class PlayerListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onClick(final PlayerInteractEvent e) {
|
public void onClick(final PlayerInteractEvent e) {
|
||||||
if (e.getAction() != Action.LEFT_CLICK_BLOCK || e.getMaterial() == plugin.getConfigManager().getSuperItem()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Block b = e.getClickedBlock();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
final Player p = e.getPlayer();
|
if (!Util.canBeShop(b) || plugin.getConfigManager().isSneak() != p.isSneaking()) {
|
||||||
if (plugin.getConfigManager().isSneak() != p.isSneaking()) {
|
|
||||||
// Sneak only
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Location loc = b.getLocation();
|
final Location loc = b.getLocation();
|
||||||
@ -175,7 +171,7 @@ public class PlayerListener implements Listener {
|
|||||||
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
if (p.hasPermission("quickshop.unlimited")) {
|
if (p.hasPermission("quickshop.unlimited")) {
|
||||||
shop.setUnlimited(!shop.isUnlimited());
|
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;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user