Permission checks

This commit is contained in:
boy0001 2015-02-19 20:04:47 +11:00
parent e7342d5a5e
commit fcdbd341d8
30 changed files with 109 additions and 109 deletions

View File

@ -154,7 +154,7 @@ public class Auto extends SubCommand {
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
return true;
}
if (!PlotSquared.hasPermission(plr, "plots.claim." + schematic) && !plr.hasPermission("plots.admin.command.schematic")) {
if (!BukkitMain.hasPermission(plr, "plots.claim." + schematic) && !plr.hasPermission("plots.admin.command.schematic")) {
PlayerFunctions.sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
return true;
}

View File

@ -120,7 +120,7 @@ public class Claim extends SubCommand {
if (!world.SCHEMATICS.contains(schematic.toLowerCase())) {
return sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
}
if (!PlotSquared.hasPermission(plr, "plots.claim." + schematic) && !plr.hasPermission("plots.admin.command.schematic")) {
if (!BukkitMain.hasPermission(plr, "plots.claim." + schematic) && !plr.hasPermission("plots.admin.command.schematic")) {
return sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
}
}

View File

@ -73,7 +73,7 @@ public class Clear extends SubCommand {
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return sendMessage(plr, C.UNLINK_REQUIRED);
}
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.clear")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.clear")) {
return sendMessage(plr, C.NO_PLOT_PERMS);
}
assert plot != null;

View File

@ -64,7 +64,7 @@ public class Cluster extends SubCommand {
switch (sub) {
case "l":
case "list": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.list")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.list")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.list");
return false;
}
@ -94,7 +94,7 @@ public class Cluster extends SubCommand {
}
case "c":
case "create": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.create")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.create")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.create");
return false;
}
@ -153,7 +153,7 @@ public class Cluster extends SubCommand {
case "disband":
case "del":
case "delete": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.delete")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.delete")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.delete");
return false;
}
@ -177,7 +177,7 @@ public class Cluster extends SubCommand {
}
}
if (!cluster.owner.equals(UUIDHandler.getUUID(plr))) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.delete.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.delete.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.delete.other");
return false;
}
@ -216,7 +216,7 @@ public class Cluster extends SubCommand {
}
case "res":
case "resize": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.resize")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.resize")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.resize");
return false;
}
@ -238,7 +238,7 @@ public class Cluster extends SubCommand {
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.resize.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.resize.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.resize.other");
return false;
}
@ -258,7 +258,7 @@ public class Cluster extends SubCommand {
case "reg":
case "regenerate":
case "regen": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.delete")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.delete")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.regen");
return false;
}
@ -282,7 +282,7 @@ public class Cluster extends SubCommand {
}
}
if (!cluster.owner.equals(UUIDHandler.getUUID(plr))) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.regen.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.regen.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.regen.other");
return false;
}
@ -294,7 +294,7 @@ public class Cluster extends SubCommand {
case "add":
case "inv":
case "invite": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.invite")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.invite")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.invite");
return false;
}
@ -309,7 +309,7 @@ public class Cluster extends SubCommand {
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.invite.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.invite.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.invite.other");
return false;
}
@ -336,7 +336,7 @@ public class Cluster extends SubCommand {
case "k":
case "remove":
case "kick": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.kick")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.kick")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.kick");
return false;
}
@ -350,7 +350,7 @@ public class Cluster extends SubCommand {
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.kick.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.kick.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.kick.other");
return false;
}
@ -388,7 +388,7 @@ public class Cluster extends SubCommand {
}
case "quit":
case "leave": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.leave")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.leave")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.leave");
return false;
}
@ -439,7 +439,7 @@ public class Cluster extends SubCommand {
case "admin":
case "helper":
case "helpers": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.helpers")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.helpers")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.helpers");
return false;
}
@ -471,7 +471,7 @@ public class Cluster extends SubCommand {
case "spawn":
case "home":
case "tp": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.tp")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.tp")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.tp");
return false;
}
@ -486,7 +486,7 @@ public class Cluster extends SubCommand {
}
UUID uuid = UUIDHandler.getUUID(plr);
if (!cluster.hasRights(uuid)) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.tp.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.tp.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.tp.other");
return false;
}
@ -498,7 +498,7 @@ public class Cluster extends SubCommand {
case "info":
case "show":
case "information": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.info")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.info")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.info");
return false;
}
@ -543,7 +543,7 @@ public class Cluster extends SubCommand {
case "sh":
case "setspawn":
case "sethome": {
if (!PlotSquared.hasPermission(plr, "plots.cluster.sethome")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.sethome")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.sethome");
return false;
}
@ -557,7 +557,7 @@ public class Cluster extends SubCommand {
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!PlotSquared.hasPermission(plr, "plots.cluster.sethome.other")) {
if (!BukkitMain.hasPermission(plr, "plots.cluster.sethome.other")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.cluster.sethome.other");
return false;
}

View File

@ -50,6 +50,6 @@ public class CommandPermission {
* @return true of player has the required permission node
*/
public boolean hasPermission(final Player player) {
return PlotSquared.hasPermission(player, this.permission);
return BukkitMain.hasPermission(player, this.permission);
}
}

View File

@ -54,7 +54,7 @@ public class Comment extends SubCommand {
if ((args.length > 1) && recipients.contains(args[0].toLowerCase())) {
if (PlotSquared.hasPermission(plr, "plots.comment." + args[0].toLowerCase())) {
if (BukkitMain.hasPermission(plr, "plots.comment." + args[0].toLowerCase())) {
final String text = StringUtils.join(Arrays.copyOfRange(args, 1, args.length), " ");
final PlotComment comment = new PlotComment(text, plr.getName(), recipients.indexOf(args[0].toLowerCase()));
plot.settings.addComment(comment);

View File

@ -44,7 +44,7 @@ public class Copy extends SubCommand {
return false;
}
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.copy")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.copy")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}

View File

@ -91,7 +91,7 @@ public class DebugClear extends SubCommand {
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return sendMessage(plr, C.UNLINK_REQUIRED);
}
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.debugclear")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.debugclear")) {
return sendMessage(plr, C.NO_PLOT_PERMS);
}
assert plot != null;

View File

@ -48,7 +48,7 @@ public class Delete extends SubCommand {
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return !sendMessage(plr, C.UNLINK_REQUIRED);
}
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.uuidWrapper.getUUID(plr)))) && !PlotSquared.hasPermission(plr, "plots.admin.command.delete")) {
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.uuidWrapper.getUUID(plr)))) && !BukkitMain.hasPermission(plr, "plots.admin.command.delete")) {
return !sendMessage(plr, C.NO_PLOT_PERMS);
}
assert plot != null;

View File

@ -55,7 +55,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
PlayerFunctions.sendMessage(plr, C.PLOT_UNOWNED);
return false;
}
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !PlotSquared.hasPermission(plr, "plots.admin.command.denied")) {
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !BukkitMain.hasPermission(plr, "plots.admin.command.denied")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return true;
}

View File

@ -67,13 +67,13 @@ public class FlagCmd extends SubCommand {
sendMessage(player, C.PLOT_NOT_CLAIMED);
return false;
}
if (!plot.hasRights(player) && !PlotSquared.hasPermission(player, "plots.set.flag.other")) {
if (!plot.hasRights(player) && !BukkitMain.hasPermission(player, "plots.set.flag.other")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.set.flag.other");
return false;
}
switch (args[0].toLowerCase()) {
case "info": {
if (!PlotSquared.hasPermission(player, "plots.set.flag")) {
if (!BukkitMain.hasPermission(player, "plots.set.flag")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.flag.info");
return false;
}
@ -96,7 +96,7 @@ public class FlagCmd extends SubCommand {
PlayerFunctions.sendMessage(player, "&cNot implemented.");
}
case "set": {
if (!PlotSquared.hasPermission(player, "plots.set.flag")) {
if (!BukkitMain.hasPermission(player, "plots.set.flag")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.set.flag");
return false;
}
@ -109,7 +109,7 @@ public class FlagCmd extends SubCommand {
PlayerFunctions.sendMessage(player, C.NOT_VALID_FLAG);
return false;
}
if (!PlotSquared.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
if (!BukkitMain.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase());
return false;
}
@ -130,7 +130,7 @@ public class FlagCmd extends SubCommand {
return true;
}
case "remove": {
if (!PlotSquared.hasPermission(player, "plots.flag.remove")) {
if (!BukkitMain.hasPermission(player, "plots.flag.remove")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.flag.remove");
return false;
}
@ -143,7 +143,7 @@ public class FlagCmd extends SubCommand {
PlayerFunctions.sendMessage(player, C.NOT_VALID_FLAG);
return false;
}
if (!PlotSquared.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
if (!BukkitMain.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase());
return false;
}
@ -169,7 +169,7 @@ public class FlagCmd extends SubCommand {
return true;
}
case "add": {
if (!PlotSquared.hasPermission(player, "plots.flag.add")) {
if (!BukkitMain.hasPermission(player, "plots.flag.add")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.flag.add");
return false;
}
@ -182,7 +182,7 @@ public class FlagCmd extends SubCommand {
PlayerFunctions.sendMessage(player, C.NOT_VALID_FLAG);
return false;
}
if (!PlotSquared.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
if (!BukkitMain.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase());
return false;
}
@ -210,7 +210,7 @@ public class FlagCmd extends SubCommand {
return true;
}
case "list": {
if (!PlotSquared.hasPermission(player, "plots.flag.list")) {
if (!BukkitMain.hasPermission(player, "plots.flag.list")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.flag.list");
return false;
}

View File

@ -55,7 +55,7 @@ public class Helpers extends SubCommand {
PlayerFunctions.sendMessage(plr, C.PLOT_UNOWNED);
return false;
}
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !PlotSquared.hasPermission(plr, "plots.admin.command.helpers")) {
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !BukkitMain.hasPermission(plr, "plots.admin.command.helpers")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return true;
}

View File

@ -63,7 +63,7 @@ public class Inbox extends SubCommand {
Integer tier;
final UUID uuid = UUIDHandler.getUUID(plr);
if (PlotSquared.hasPermission(plr, "plots.comment.admin")) {
if (BukkitMain.hasPermission(plr, "plots.comment.admin")) {
tier = 0;
} else if (plot != null && plot.owner.equals(uuid)) {
tier = 1;

View File

@ -43,7 +43,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
return false;
}
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.kick")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.kick")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}

View File

@ -85,7 +85,7 @@ public class Merge extends SubCommand {
PlayerFunctions.sendMessage(plr, C.PLOT_UNOWNED);
return false;
}
boolean admin = PlotSquared.hasPermission(plr, "plots.admin.command.merge");
boolean admin = BukkitMain.hasPermission(plr, "plots.admin.command.merge");
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !admin) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;

View File

@ -44,7 +44,7 @@ public class Paste extends SubCommand {
return false;
}
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.paste")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.paste")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}

View File

@ -70,7 +70,7 @@ public class Schematic extends SubCommand {
PlotSquared.sendConsoleSenderMessage(C.IS_CONSOLE);
return false;
}
if (!PlotSquared.hasPermission(plr, "plots.schematic.paste")) {
if (!BukkitMain.hasPermission(plr, "plots.schematic.paste")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.schematic.paste");
return false;
}
@ -158,7 +158,7 @@ public class Schematic extends SubCommand {
PlotSquared.sendConsoleSenderMessage(C.IS_CONSOLE);
return false;
}
if (!PlotSquared.hasPermission(plr, "plots.schematic.test")) {
if (!BukkitMain.hasPermission(plr, "plots.schematic.test")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.schematic.test");
return false;
}
@ -252,7 +252,7 @@ public class Schematic extends SubCommand {
break;
case "export":
case "save":
if (!PlotSquared.hasPermission(plr, "plots.schematic.save")) {
if (!BukkitMain.hasPermission(plr, "plots.schematic.save")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.schematic.save");
return false;
}

View File

@ -78,7 +78,7 @@ public class Set extends SubCommand {
sendMessage(plr, C.PLOT_NOT_CLAIMED);
return false;
}
if (!plot.hasRights(plr) && !PlotSquared.hasPermission(plr, "plots.admin.command.set")) {
if (!plot.hasRights(plr) && !BukkitMain.hasPermission(plr, "plots.admin.command.set")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}
@ -94,7 +94,7 @@ public class Set extends SubCommand {
}
/* TODO: Implement option */
// final boolean advanced_permissions = true;
if (!PlotSquared.hasPermission(plr, "plots.set." + args[0].toLowerCase())) {
if (!BukkitMain.hasPermission(plr, "plots.set." + args[0].toLowerCase())) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.set." + args[0].toLowerCase());
return false;
}
@ -125,7 +125,7 @@ public class Set extends SubCommand {
PlayerFunctions.sendMessage(plr, C.NOT_VALID_FLAG);
return false;
}
if (!PlotSquared.hasPermission(plr, "plots.set.flag." + args[1].toLowerCase())) {
if (!BukkitMain.hasPermission(plr, "plots.set.flag." + args[1].toLowerCase())) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION);
return false;
}

View File

@ -64,7 +64,7 @@ public class SetOwner extends SubCommand {
return false;
}
if (!plot.owner.equals(UUIDHandler.getUUID(plr)) && !PlotSquared.hasPermission(plr, "plots.admin.command.setowner")) {
if (!plot.owner.equals(UUIDHandler.getUUID(plr)) && !BukkitMain.hasPermission(plr, "plots.admin.command.setowner")) {
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command.setowner");
return false;
}

View File

@ -57,7 +57,7 @@ public class Swap extends SubCommand {
return false;
}
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.swap")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.swap")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}
@ -71,7 +71,7 @@ public class Swap extends SubCommand {
try {
plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1]));
final Plot plot2 = PlotSquared.getPlots(world).get(plotid);
if (((plot2 == null) || !plot2.hasOwner() || (plot2.owner != UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.swap")) {
if (((plot2 == null) || !plot2.hasOwner() || (plot2.owner != UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.swap")) {
PlayerFunctions.sendMessage(plr, C.NO_PERM_MERGE, plotid.toString());
return false;
}

View File

@ -55,7 +55,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
PlayerFunctions.sendMessage(plr, C.PLOT_UNOWNED);
return false;
}
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !PlotSquared.hasPermission(plr, "plots.admin.command.trusted")) {
if (!plot.getOwner().equals(UUIDHandler.getUUID(plr)) && !BukkitMain.hasPermission(plr, "plots.admin.command.trusted")) {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return true;
}

View File

@ -49,7 +49,7 @@ public class Unclaim extends SubCommand {
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return !sendMessage(plr, C.UNLINK_REQUIRED);
}
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr)))) && !PlotSquared.hasPermission(plr, "plots.admin.command.unclaim")) {
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr)))) && !BukkitMain.hasPermission(plr, "plots.admin.command.unclaim")) {
return !sendMessage(plr, C.NO_PLOT_PERMS);
}
assert plot != null;

View File

@ -56,7 +56,7 @@ public class Unlink extends SubCommand {
return sendMessage(plr, C.NOT_IN_PLOT);
}
final Plot plot = PlayerFunctions.getCurrentPlot(plr);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !PlotSquared.hasPermission(plr, "plots.admin.command.unlink")) {
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !BukkitMain.hasPermission(plr, "plots.admin.command.unlink")) {
return sendMessage(plr, C.NO_PLOT_PERMS);
}
if (PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {

View File

@ -40,7 +40,7 @@ public class WE_Anywhere extends SubCommand {
return false;
}
if (PlotSquared.hasPermission(plr, "plots.worldedit.bypass") && PWE.hasMask(plr)) {
if (BukkitMain.hasPermission(plr, "plots.worldedit.bypass") && PWE.hasMask(plr)) {
PWE.removeMask(plr);
PlayerFunctions.sendMessage(plr, "&6Cleared your WorldEdit mask");
}

View File

@ -200,7 +200,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
Plot plot = getCurrentPlot(q);
if (plot != null) {
if (plot.deny_entry(player)) {
if (!PlotSquared.hasPermission(player, "plots.admin.entry.denied")) {
if (!BukkitMain.hasPermission(player, "plots.admin.entry.denied")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.entry.denied");
event.setCancelled(true);
return;
@ -264,7 +264,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
return;
}
if (!plot.hasOwner()) {
if (PlotSquared.hasPermission(player, "plots.admin.destroy.unowned")) {
if (BukkitMain.hasPermission(player, "plots.admin.destroy.unowned")) {
return;
}
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.unowned");
@ -277,7 +277,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (destroy != null && ((HashSet<PlotBlock>) destroy.getValue()).contains(new PlotBlock((short) block.getTypeId(), (byte) block.getData()))) {
return;
}
if (PlotSquared.hasPermission(event.getPlayer(), "plots.admin.destroy.other")) {
if (BukkitMain.hasPermission(event.getPlayer(), "plots.admin.destroy.other")) {
return;
}
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.other");
@ -286,7 +286,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
}
return;
}
if (PlotSquared.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) {
if (BukkitMain.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) {
return;
}
if (isPlotArea(loc)) {
@ -345,7 +345,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
final Player p = (Player) e;
Location loc = b.getLocation();
if (!isInPlot(loc)) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road");
event.setCancelled(true);
return;
@ -353,13 +353,13 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(loc);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned");
event.setCancelled(true);
return;
}
} else if (!plot.hasRights(p)) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.other")) {
if (isPlotArea(loc)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other");
event.setCancelled(true);
@ -504,7 +504,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isInPlot(loc)) {
final Plot plot = getCurrentPlot(loc);
if (!plot.hasOwner()) {
if (PlotSquared.hasPermission(player, "plots.admin.interact.unowned")) {
if (BukkitMain.hasPermission(player, "plots.admin.interact.unowned")) {
return;
}
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.interact.unowned");
@ -516,7 +516,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
return;
}
if (!plot.hasRights(player)) {
if (PlotSquared.hasPermission(player, "plots.admin.interact.other")) {
if (BukkitMain.hasPermission(player, "plots.admin.interact.other")) {
return;
}
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.interact.other");
@ -525,7 +525,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
}
return;
}
if (PlotSquared.hasPermission(player, "plots.admin.interact.road")) {
if (BukkitMain.hasPermission(player, "plots.admin.interact.road")) {
return;
}
if (isPlotArea(loc)) {
@ -589,7 +589,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (e.getPlayer() != null) {
final Player p = e.getPlayer();
if (!isInPlot(loc)) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road");
e.setCancelled(true);
return;
@ -597,13 +597,13 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(loc);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned");
e.setCancelled(true);
return;
}
} else if (!plot.hasRights(p)) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.other")) {
if (isPlotArea(loc)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other");
e.setCancelled(true);
@ -657,7 +657,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isPlotWorld(loc)) {
Player p = e.getPlayer();
if (!isInPlot(loc)) {
if (PlotSquared.hasPermission(p, "plots.admin.build.road")) {
if (BukkitMain.hasPermission(p, "plots.admin.build.road")) {
return;
}
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road");
@ -666,7 +666,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(loc);
if (plot == null || !plot.hasOwner()) {
if (PlotSquared.hasPermission(p, "plots.admin.build.unowned")) {
if (BukkitMain.hasPermission(p, "plots.admin.build.unowned")) {
return;
}
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned");
@ -677,7 +677,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (use != null && ((HashSet<PlotBlock>) use.getValue()).contains(new PlotBlock((short) e.getBucket().getId(), (byte) 0))) {
return;
}
if (PlotSquared.hasPermission(p, "plots.admin.build.other")) {
if (BukkitMain.hasPermission(p, "plots.admin.build.other")) {
return;
}
if (isPlotArea(loc)) {
@ -725,7 +725,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isPlotWorld(loc)) {
Player p = e.getPlayer();
if (!isInPlot(loc)) {
if (PlotSquared.hasPermission(p, "plots.admin.build.road")) {
if (BukkitMain.hasPermission(p, "plots.admin.build.road")) {
return;
}
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road");
@ -734,7 +734,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(loc);
if (plot == null || !plot.hasOwner()) {
if (PlotSquared.hasPermission(p, "plots.admin.build.unowned")) {
if (BukkitMain.hasPermission(p, "plots.admin.build.unowned")) {
return;
}
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned");
@ -746,7 +746,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (use != null && ((HashSet<PlotBlock>) use.getValue()).contains(new PlotBlock((short) block.getTypeId(), block.getData()))) {
return;
}
if (PlotSquared.hasPermission(p, "plots.admin.build.other")) {
if (BukkitMain.hasPermission(p, "plots.admin.build.other")) {
return;
}
if (isPlotArea(loc)) {
@ -766,7 +766,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isPlotWorld(loc)) {
final Player p = e.getPlayer();
if (!isInPlot(loc)) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road");
e.setCancelled(true);
return;
@ -774,7 +774,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(loc);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.build.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned");
e.setCancelled(true);
return;
@ -783,7 +783,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (FlagManager.isPlotFlagTrue(plot, "hanging-place")) {
return;
}
if (!PlotSquared.hasPermission(p, "plots.admin.build.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.build.other")) {
if (isPlotArea(loc)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other");
e.setCancelled(true);
@ -803,7 +803,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
final Location l = e.getEntity().getLocation();
if (isPlotWorld(l)) {
if (!isInPlot(l)) {
if (!PlotSquared.hasPermission(p, "plots.admin.destroy.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.destroy.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.road");
e.setCancelled(true);
return;
@ -811,7 +811,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(l);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.destroy.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.destroy.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.unowned");
e.setCancelled(true);
return;
@ -820,7 +820,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (FlagManager.isPlotFlagTrue(plot, "hanging-break")) {
return;
}
if (!PlotSquared.hasPermission(p, "plots.admin.destroy.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.destroy.other")) {
if (isPlotArea(l)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.other");
e.setCancelled(true);
@ -839,7 +839,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isPlotWorld(l)) {
final Player p = e.getPlayer();
if (!isInPlot(l)) {
if (!PlotSquared.hasPermission(p, "plots.admin.interact.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.interact.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.road");
e.setCancelled(true);
return;
@ -847,7 +847,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(l);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.interact.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.interact.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.unowned");
e.setCancelled(true);
return;
@ -866,7 +866,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (entity instanceof RideableMinecart && FlagManager.isPlotFlagTrue(plot, "vehicle-use")) {
return;
}
if (!PlotSquared.hasPermission(p, "plots.admin.interact.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.interact.other")) {
if (isPlotArea(l)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.other");
e.setCancelled(true);
@ -887,7 +887,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
final Player p = (Player) d;
final PlotWorld pW = getPlotWorld(l.getWorld());
if (!isInPlot(l)) {
if (!PlotSquared.hasPermission(p, "plots.admin.vehicle.break.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.vehicle.break.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.vehicle.break.road");
e.setCancelled(true);
return;
@ -895,7 +895,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(l);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.vehicle.break.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.vehicle.break.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.vehicle.break.unowned");
e.setCancelled(true);
return;
@ -906,7 +906,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (FlagManager.isPlotFlagTrue(plot, "vehicle-break")) {
return;
}
if (!PlotSquared.hasPermission(p, "plots.admin.vehicle.break.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.vehicle.break.other")) {
if (isPlotArea(l)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.vehicle.break.other");
e.setCancelled(true);
@ -944,7 +944,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
return;
}
if (!isInPlot(l)) {
if (!PlotSquared.hasPermission(p, "plots.admin.pve.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.pve.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.pve.road");
e.setCancelled(true);
return;
@ -952,7 +952,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(l);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.pve.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.pve.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.pve.unowned");
e.setCancelled(true);
return;
@ -974,7 +974,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (a instanceof Tameable && ((Tameable) a).isTamed() && FlagManager.isPlotFlagTrue(plot, "tamed-attack")) {
return;
}
if (!PlotSquared.hasPermission(p, "plots.admin.pve.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.pve.other")) {
if (isPlotArea(l)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.pve.other");
e.setCancelled(true);
@ -996,7 +996,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isPlotWorld(l)) {
final Player p = e.getPlayer();
if (!isInPlot(l)) {
if (!PlotSquared.hasPermission(p, "plots.admin.projectile.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.projectile.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.projectile.road");
e.setHatching(false);
return;
@ -1004,13 +1004,13 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} else {
final Plot plot = getCurrentPlot(l);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.projectile.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.projectile.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.projectile.unowned");
e.setHatching(false);
return;
}
} else if (!plot.hasRights(p)) {
if (!PlotSquared.hasPermission(p, "plots.admin.projectile.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.projectile.other")) {
if (isPlotArea(l)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.projectile.other");
e.setHatching(false);
@ -1028,7 +1028,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (!isPlotWorld(world)) {
return;
}
if (PlotSquared.hasPermission(event.getPlayer(), "plots.admin")) {
if (BukkitMain.hasPermission(event.getPlayer(), "plots.admin")) {
return;
}
Player player = event.getPlayer();
@ -1036,7 +1036,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (isInPlot(loc)) {
final Plot plot = getCurrentPlot(loc);
if (!plot.hasOwner()) {
if (PlotSquared.hasPermission(player, "plots.admin.build.unowned")) {
if (BukkitMain.hasPermission(player, "plots.admin.build.unowned")) {
return;
}
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.build.unowned");
@ -1049,7 +1049,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
if (place != null && ((HashSet<PlotBlock>) place.getValue()).contains(new PlotBlock((short) block.getTypeId(), (byte) block.getData()))) {
return;
}
if (!PlotSquared.hasPermission(player, "plots.admin.build.other")) {
if (!BukkitMain.hasPermission(player, "plots.admin.build.other")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.build.other");
event.setCancelled(true);
return;
@ -1057,7 +1057,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
}
return;
}
if (!PlotSquared.hasPermission(player, "plots.admin.build.road")) {
if (!BukkitMain.hasPermission(player, "plots.admin.build.road")) {
if (isPlotArea(loc)) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.build.road");
event.setCancelled(true);

View File

@ -20,19 +20,19 @@ public class PlayerEvents_1_8 extends PlotListener implements Listener {
if (isPlotWorld(l)) {
final Player p = e.getPlayer();
if (!isInPlot(l)) {
if (!PlotSquared.hasPermission(p, "plots.admin.interact.road")) {
if (!BukkitMain.hasPermission(p, "plots.admin.interact.road")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.road");
e.setCancelled(true);
}
} else {
final Plot plot = getCurrentPlot(l);
if (plot == null || !plot.hasOwner()) {
if (!PlotSquared.hasPermission(p, "plots.admin.interact.unowned")) {
if (!BukkitMain.hasPermission(p, "plots.admin.interact.unowned")) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.unowned");
e.setCancelled(true);
}
} else if (!plot.hasRights(p)) {
if (!PlotSquared.hasPermission(p, "plots.admin.interact.other")) {
if (!BukkitMain.hasPermission(p, "plots.admin.interact.other")) {
if (isPlotArea(l)) {
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.other");
e.setCancelled(true);

View File

@ -195,7 +195,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
if (UUIDHandler.getUUID(player).equals(UUIDHandler.getUUID(trespasser))) {
return;
}
if (PlotSquared.hasPermission(trespasser, "plots.flag.notify-enter.bypass")) {
if (BukkitMain.hasPermission(trespasser, "plots.flag.notify-enter.bypass")) {
return;
}
if (player.isOnline()) {
@ -238,7 +238,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
if (UUIDHandler.getUUID(player).equals(UUIDHandler.getUUID(trespasser))) {
return;
}
if (PlotSquared.hasPermission(trespasser, "plots.flag.notify-leave.bypass")) {
if (BukkitMain.hasPermission(trespasser, "plots.flag.notify-leave.bypass")) {
return;
}
if (player.isOnline()) {

View File

@ -86,7 +86,7 @@ public class WorldEditListener implements Listener {
if (!world.equals(player.getWorld().getName())) {
return;
}
if (PlotSquared.hasPermission(player, "plots.worldedit.bypass")) {
if (BukkitMain.hasPermission(player, "plots.worldedit.bypass")) {
return;
}
PWE.setNoMask(player);
@ -118,7 +118,7 @@ public class WorldEditListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPlayerCommand(final PlayerCommandPreprocessEvent e) {
final Player p = e.getPlayer();
if (!PlotSquared.isPlotWorld(p.getWorld()) || PlotSquared.hasPermission(p, "plots.worldedit.bypass")) {
if (!PlotSquared.isPlotWorld(p.getWorld()) || BukkitMain.hasPermission(p, "plots.worldedit.bypass")) {
return;
}
String cmd = e.getMessage().toLowerCase();
@ -171,7 +171,7 @@ public class WorldEditListener implements Listener {
public void onPlayerJoin(final PlayerJoinEvent e) {
final Player p = e.getPlayer();
final Location l = p.getLocation();
if (PlotSquared.hasPermission(p, "plots.worldedit.bypass")) {
if (BukkitMain.hasPermission(p, "plots.worldedit.bypass")) {
if (isPlotWorld(l)) {
PWE.removeMask(p);
}
@ -192,7 +192,7 @@ public class WorldEditListener implements Listener {
}
final Location f = e.getFrom();
final Player p = e.getPlayer();
if (PlotSquared.hasPermission(p, "plots.worldedit.bypass")) {
if (BukkitMain.hasPermission(p, "plots.worldedit.bypass")) {
if (!PWE.hasMask(p)) {
return;
}
@ -208,7 +208,7 @@ public class WorldEditListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPortal(final PlayerPortalEvent e) {
if (PlotSquared.hasPermission(e.getPlayer(), "plots.worldedit.bypass")) {
if (BukkitMain.hasPermission(e.getPlayer(), "plots.worldedit.bypass")) {
return;
}
final Player p = e.getPlayer();
@ -230,7 +230,7 @@ public class WorldEditListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onTeleport(final PlayerTeleportEvent e) {
final Player p = e.getPlayer();
if (PlotSquared.hasPermission(e.getPlayer(), "plots.worldedit.bypass")) {
if (BukkitMain.hasPermission(e.getPlayer(), "plots.worldedit.bypass")) {
if (!PWE.hasMask(p)) {
return;
}

View File

@ -216,7 +216,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
* @return true if the player is added as a helper or is the owner
*/
public boolean hasRights(final Player player) {
return PlotSquared.hasPermission(player, "plots.admin.build.other") || ((this.helpers != null) && this.helpers.contains(DBFunc.everyone)) || ((this.helpers != null) && this.helpers.contains(UUIDHandler.getUUID(player))) || ((this.owner != null) && this.owner.equals(UUIDHandler.getUUID(player))) || ((this.owner != null) && (this.trusted != null) && (UUIDHandler.uuidWrapper.getPlayer(this.owner) != null) && (this.trusted.contains(UUIDHandler.getUUID(player)) || this.trusted.contains(DBFunc.everyone)));
return BukkitMain.hasPermission(player, "plots.admin.build.other") || ((this.helpers != null) && this.helpers.contains(DBFunc.everyone)) || ((this.helpers != null) && this.helpers.contains(UUIDHandler.getUUID(player))) || ((this.owner != null) && this.owner.equals(UUIDHandler.getUUID(player))) || ((this.owner != null) && (this.trusted != null) && (UUIDHandler.uuidWrapper.getPlayer(this.owner) != null) && (this.trusted.contains(UUIDHandler.getUUID(player)) || this.trusted.contains(DBFunc.everyone)));
}
/**

View File

@ -82,7 +82,7 @@ import com.sk89q.worldedit.regions.CuboidRegion;
}
}
}
if (force ^ (noMask(s) && !PlotSquared.hasPermission(p, "plots.worldedit.bypass"))) {
if (force ^ (noMask(s) && !BukkitMain.hasPermission(p, "plots.worldedit.bypass"))) {
final BukkitPlayer plr = PlotSquared.worldEdit.wrapPlayer(p);
final Vector p1 = new Vector(69, 69, 69), p2 = new Vector(69, 69, 69);
s.setMask(new RegionMask(new CuboidRegion(plr.getWorld(), p1, p2)));