This commit is contained in:
boy0001 2015-04-11 22:05:15 +10:00
parent 9a9e00670c
commit a205156ba3
3 changed files with 28 additions and 13 deletions

View File

@ -100,17 +100,22 @@ public class Denied extends SubCommand {
return true;
} else if (args[0].equalsIgnoreCase("remove")) {
if (args[1].equalsIgnoreCase("*")) {
final UUID uuid = DBFunc.everyone;
if (!plot.denied.contains(uuid)) {
if (plot.denied.size() == 0) {
MainUtil.sendMessage(plr, C.WAS_NOT_ADDED);
return true;
}
for (UUID uuid : plot.denied) {
plot.removeDenied(uuid);
DBFunc.removeDenied(loc.getWorld(), plot, uuid);
}
MainUtil.sendMessage(plr, C.DENIED_REMOVED);
return true;
}
final UUID uuid = UUIDHandler.getUUID(args[1]);
if (!plot.denied.contains(uuid)) {
MainUtil.sendMessage(plr, C.WAS_NOT_ADDED);
return true;
}
plot.removeDenied(uuid);
DBFunc.removeDenied(loc.getWorld(), plot, uuid);
EventUtil.manager.callDenied(plr, plot, uuid, false);

View File

@ -91,17 +91,22 @@ public class Helpers extends SubCommand {
return true;
} else if (args[0].equalsIgnoreCase("remove")) {
if (args[1].equalsIgnoreCase("*")) {
final UUID uuid = DBFunc.everyone;
if (!plot.helpers.contains(uuid)) {
if (plot.helpers.size() == 0) {
MainUtil.sendMessage(plr, C.WAS_NOT_ADDED);
return true;
}
for (UUID uuid : plot.helpers) {
plot.removeHelper(uuid);
DBFunc.removeHelper(loc.getWorld(), plot, uuid);
}
MainUtil.sendMessage(plr, C.HELPER_REMOVED);
return true;
}
final UUID uuid = UUIDHandler.getUUID(args[1]);
if (!plot.helpers.contains(uuid)) {
MainUtil.sendMessage(plr, C.WAS_NOT_ADDED);
return false;
}
plot.removeHelper(uuid);
DBFunc.removeHelper(loc.getWorld(), plot, uuid);
EventUtil.manager.callHelper(plr, plot, uuid, false);

View File

@ -92,17 +92,22 @@ public class Trusted extends SubCommand {
return true;
} else if (args[0].equalsIgnoreCase("remove")) {
if (args[1].equalsIgnoreCase("*")) {
final UUID uuid = DBFunc.everyone;
if (!plot.trusted.contains(uuid)) {
MainUtil.sendMessage(plr, C.T_WAS_NOT_ADDED);
if (plot.trusted.size() == 0) {
MainUtil.sendMessage(plr, C.WAS_NOT_ADDED);
return true;
}
for (UUID uuid : plot.trusted) {
plot.removeTrusted(uuid);
DBFunc.removeTrusted(loc.getWorld(), plot, uuid);
}
MainUtil.sendMessage(plr, C.TRUSTED_REMOVED);
return true;
}
final UUID uuid = UUIDHandler.getUUID(args[1]);
if (!plot.trusted.contains(uuid)) {
MainUtil.sendMessage(plr, C.T_WAS_NOT_ADDED);
return true;
}
plot.removeTrusted(uuid);
DBFunc.removeTrusted(loc.getWorld(), plot, uuid);
EventUtil.manager.callTrusted(plr, plot, uuid, false);