This commit is contained in:
boy0001 2015-04-22 09:32:01 +10:00
parent 5882a9c58f
commit 0da524bfde

View File

@ -738,7 +738,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public static void onInteract(final PlayerInteractEvent event) { public static void onInteract(final PlayerInteractEvent event) {
if (event.getAction() == Action.LEFT_CLICK_BLOCK) { Action action = event.getAction();
if (action == Action.LEFT_CLICK_BLOCK) {
return; return;
} }
final Block block = event.getClickedBlock(); final Block block = event.getClickedBlock();
@ -758,7 +759,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (Permissions.hasPermission(pp, "plots.admin.interact.unowned")) { if (Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
return; return;
} }
if (action != Action.PHYSICAL) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.unowned"); MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.unowned");
}
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -771,7 +774,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (Permissions.hasPermission(pp, "plots.admin.interact.other")) { if (Permissions.hasPermission(pp, "plots.admin.interact.other")) {
return; return;
} }
if (action != Action.PHYSICAL) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.other"); MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.other");
}
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -782,7 +787,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
return; return;
} }
if (isPlotArea(loc)) { if (isPlotArea(loc)) {
if (action != Action.PHYSICAL) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road"); MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road");
}
event.setCancelled(true); event.setCancelled(true);
return; return;
} }