Only show blocked-cmds message when event is cancelled

This commit is contained in:
Byteflux 2016-08-16 19:08:33 -07:00
parent 30da060f83
commit 98d0819383

View File

@ -412,7 +412,6 @@ public class PlayerEvents extends PlotListener implements Listener {
pattern = RegExUtil.compiledPatterns.get(s); pattern = RegExUtil.compiledPatterns.get(s);
} }
if (pattern.matcher(msg).matches()) { if (pattern.matcher(msg).matches()) {
MainUtil.sendMessage(pp, C.COMMAND_BLOCKED);
String perm; String perm;
if (plot.isAdded(pp.getUUID())) { if (plot.isAdded(pp.getUUID())) {
perm = "plots.admin.command.blocked-cmds.shared"; perm = "plots.admin.command.blocked-cmds.shared";
@ -420,6 +419,7 @@ public class PlayerEvents extends PlotListener implements Listener {
perm = "plots.admin.command.blocked-cmds.other"; perm = "plots.admin.command.blocked-cmds.other";
} }
if (!Permissions.hasPermission(pp, perm)) { if (!Permissions.hasPermission(pp, perm)) {
MainUtil.sendMessage(pp, C.COMMAND_BLOCKED);
event.setCancelled(true); event.setCancelled(true);
} }
return; return;