mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Merge pull request #2932 from IntellectualSites/feature/v6/generify-perms
Generify permissions thru Permission class
This commit is contained in:
commit
47cb85d3db
@ -303,7 +303,7 @@ public class BlockEventListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -320,7 +320,7 @@ public class BlockEventListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
plot.debug(player.getName() + " could not place " + event.getBlock().getType()
|
||||
@ -331,7 +331,7 @@ public class BlockEventListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -348,7 +348,7 @@ public class BlockEventListener implements Listener {
|
||||
} else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -369,7 +369,7 @@ public class BlockEventListener implements Listener {
|
||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.groundlevel")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -405,14 +405,14 @@ public class BlockEventListener implements Listener {
|
||||
}
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -432,7 +432,7 @@ public class BlockEventListener implements Listener {
|
||||
}
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1012,7 +1012,7 @@ public class BlockEventListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1020,7 +1020,7 @@ public class BlockEventListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1028,7 +1028,7 @@ public class BlockEventListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!result && !(plot.getFlag(UntrustedVisitFlag.class) && plot.getHomeSynchronous().equals(BukkitUtil.adaptComplete(to)))) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.entry.denied")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||
);
|
||||
event.setCancelled(true);}
|
||||
}
|
||||
@ -510,7 +510,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.exit.denied")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED))
|
||||
);
|
||||
this.tmpTeleport = false;
|
||||
if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) {
|
||||
@ -527,7 +527,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.entry.denied")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||
);
|
||||
this.tmpTeleport = false;
|
||||
to.setX(from.getBlockX());
|
||||
@ -587,7 +587,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.exit.denied")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED))
|
||||
);
|
||||
this.tmpTeleport = false;
|
||||
if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) {
|
||||
@ -604,7 +604,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.entry.denied")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||
);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(from);
|
||||
@ -850,28 +850,28 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
Plot plot = area.getPlotAbs(location);
|
||||
boolean cancelled = false;
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||
);
|
||||
cancelled = true;
|
||||
}
|
||||
} else if (!plot.hasOwner()) {
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||
);
|
||||
cancelled = true;
|
||||
}
|
||||
} else {
|
||||
UUID uuid = pp.getUUID();
|
||||
if (!plot.isAdded(uuid)) {
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.other")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||
);
|
||||
cancelled = true;
|
||||
}
|
||||
@ -906,10 +906,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
BukkitPlayer pp = BukkitUtil.adapt(e.getPlayer());
|
||||
if (plot == null) {
|
||||
if (!area.isRoadFlags() && !area.getRoadFlag(MiscInteractFlag.class) && !Permissions
|
||||
.hasPermission(pp, "plots.admin.interact.road")) {
|
||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||
);
|
||||
e.setCancelled(true);
|
||||
}
|
||||
@ -918,7 +918,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
@ -928,7 +928,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||
);
|
||||
e.setCancelled(true);
|
||||
}
|
||||
@ -940,10 +940,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (plot.getFlag(MiscInteractFlag.class)) {
|
||||
return;
|
||||
}
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.other")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||
);
|
||||
e.setCancelled(true);
|
||||
plot.debug(pp.getName() + " could not interact with " + entity.getType()
|
||||
@ -1143,7 +1143,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (!plot.hasOwner()) {
|
||||
@ -1152,7 +1152,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (!plot.isAdded(pp.getUUID())) {
|
||||
@ -1168,14 +1168,14 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1215,7 +1215,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (!plot.hasOwner()) {
|
||||
@ -1224,7 +1224,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||
@ -1241,14 +1241,14 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1274,7 +1274,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1283,7 +1283,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.unwoned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1294,7 +1294,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1324,7 +1324,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1332,7 +1332,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1343,7 +1343,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
plot.debug(p.getName()
|
||||
@ -1367,7 +1367,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1377,7 +1377,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
plot.debug(player.getName()
|
||||
@ -1406,7 +1406,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1414,7 +1414,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1472,7 +1472,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.interact.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1492,19 +1492,19 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
BukkitPlayer pp = BukkitUtil.adapt(p);
|
||||
Plot plot = area.getPlot(location);
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.vehicle.break.road")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.vehicle.break.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else {
|
||||
if (!plot.hasOwner()) {
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.vehicle.break.unowned")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.vehicle.break.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -1515,10 +1515,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (plot.getFlag(VehicleBreakFlag.class)) {
|
||||
return;
|
||||
}
|
||||
if (!Permissions.hasPermission(pp, "plots.admin.vehicle.break.other")) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.vehicle.break.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
plot.debug(pp.getName()
|
||||
@ -1540,26 +1540,26 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||
Plot plot = area.getPlot(location);
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.projectile.road")) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.projectile.road")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||
);
|
||||
event.setHatching(false);
|
||||
}
|
||||
} else if (!plot.hasOwner()) {
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.projectile.unowned")) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.projective.unowned")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||
);
|
||||
event.setHatching(false);
|
||||
}
|
||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.projectile.other")) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.projectile.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
event.setHatching(false);
|
||||
}
|
||||
@ -1638,7 +1638,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
|
||||
@EventHandler public void onLocaleChange(final PlayerLocaleChangeEvent event) {
|
||||
BukkitPlayer player = BukkitUtil.adapt(event.getPlayer());
|
||||
// we're stripping the country code as we con't want to differ between countries
|
||||
// we're stripping the country code as we don't want to differ between countries
|
||||
player.setLocale(Locale.forLanguageTag(event.getLocale().substring(0, 2)));
|
||||
}
|
||||
}
|
||||
|
@ -180,17 +180,17 @@ public class BukkitEntityUtil {
|
||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.build.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.destroy." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -199,10 +199,10 @@ public class BukkitEntityUtil {
|
||||
.isAdded(plotPlayer.getUUID()))) {
|
||||
return true;
|
||||
}
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.destroy." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.destroy." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||
);
|
||||
if (plot != null) {
|
||||
plot.debug(player.getName()
|
||||
@ -220,10 +220,10 @@ public class BukkitEntityUtil {
|
||||
.getFlag(PveFlag.class))) {
|
||||
return true;
|
||||
}
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.pve." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||
);
|
||||
if (plot != null) {
|
||||
plot.debug(player.getName() + " could not attack " + entityType
|
||||
@ -241,10 +241,10 @@ public class BukkitEntityUtil {
|
||||
.getFlag(PveFlag.class))) {
|
||||
return true;
|
||||
}
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.pve." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||
);
|
||||
if (plot != null) {
|
||||
plot.debug(player.getName() + " could not attack " + entityType
|
||||
@ -255,10 +255,10 @@ public class BukkitEntityUtil {
|
||||
} else if (EntityCategories.PLAYER.contains(entityType)) {
|
||||
if (isPlot) {
|
||||
if (!plot.getFlag(PvpFlag.class) && !Permissions
|
||||
.hasPermission(plotPlayer, "plots.admin.pvp." + stub)) {
|
||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.pvp." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||
);
|
||||
plot.debug(player.getName() + " could not attack " + entityType
|
||||
+ " because pve = false");
|
||||
@ -269,10 +269,10 @@ public class BukkitEntityUtil {
|
||||
} else if (roadFlags && area.getRoadFlag(PvpFlag.class)) {
|
||||
return true;
|
||||
}
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pvp." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.pvp." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -286,10 +286,10 @@ public class BukkitEntityUtil {
|
||||
}
|
||||
} else if (roadFlags && (area.getRoadFlag(AnimalAttackFlag.class) || area
|
||||
.getFlag(PveFlag.class))) {
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.pve." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -305,10 +305,10 @@ public class BukkitEntityUtil {
|
||||
} else if (roadFlags && area.getRoadFlag(PveFlag.class)) {
|
||||
return true;
|
||||
}
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", "plots.admin.pve." + stub)
|
||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||
);
|
||||
if (plot != null) {
|
||||
plot.debug(player.getName() + " could not attack " + entityType
|
||||
|
@ -95,7 +95,7 @@ public class Alias extends SubCommand {
|
||||
return true;
|
||||
} else {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.alias.set"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ALIAS_SET)));
|
||||
}
|
||||
|
||||
break;
|
||||
@ -110,7 +110,7 @@ public class Alias extends SubCommand {
|
||||
result = removeAlias(player, plot);
|
||||
} else {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.alias.remove"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ALIAS_REMOVE)));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -172,7 +172,7 @@ public class Alias extends SubCommand {
|
||||
private boolean removeAlias(PlotPlayer<?> player, Plot plot) {
|
||||
plot.setAlias(null);
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.alias.remove"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ALIAS_REMOVE)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.player.ConsolePlayer;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
@ -136,8 +137,8 @@ public class Area extends SubCommand {
|
||||
player.sendMessage(RequiredType.CONSOLE.getErrorMessage());
|
||||
return false;
|
||||
}
|
||||
if (!Permissions.hasPermission(player, "plots.area.create")) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.create"));
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)));
|
||||
return false;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
@ -258,8 +259,8 @@ public class Area extends SubCommand {
|
||||
case "c":
|
||||
case "setup":
|
||||
case "create":
|
||||
if (!Permissions.hasPermission(player, "plots.area.create")) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.create"));
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)));
|
||||
return false;
|
||||
}
|
||||
switch (args.length) {
|
||||
@ -491,8 +492,8 @@ public class Area extends SubCommand {
|
||||
return true;
|
||||
case "i":
|
||||
case "info": {
|
||||
if (!Permissions.hasPermission(player, "plots.area.info")) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.info"));
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", String.valueOf(Permission.PERMISSION_AREA_INFO)));
|
||||
return false;
|
||||
}
|
||||
PlotArea area;
|
||||
@ -550,8 +551,8 @@ public class Area extends SubCommand {
|
||||
}
|
||||
case "l":
|
||||
case "list":
|
||||
if (!Permissions.hasPermission(player, "plots.area.list")) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.list"));
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", String.valueOf(Permission.PERMISSION_AREA_LIST)));
|
||||
return false;
|
||||
}
|
||||
int page;
|
||||
@ -615,8 +616,8 @@ public class Area extends SubCommand {
|
||||
case "clear":
|
||||
case "reset":
|
||||
case "regenerate": {
|
||||
if (!Permissions.hasPermission(player, "plots.area.regen")) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.regen"));
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_REGEN)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", String.valueOf(Permission.PERMISSION_AREA_REGEN)));
|
||||
return false;
|
||||
}
|
||||
final PlotArea area = player.getApplicablePlotArea();
|
||||
@ -640,8 +641,8 @@ public class Area extends SubCommand {
|
||||
case "teleport":
|
||||
case "visit":
|
||||
case "tp":
|
||||
if (!Permissions.hasPermission(player, "plots.area.tp")) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.tp"));
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", String.valueOf(Permission.PERMISSION_AREA_TP)));
|
||||
return false;
|
||||
}
|
||||
if (args.length != 2) {
|
||||
|
@ -239,9 +239,9 @@ public class Auto extends SubCommand {
|
||||
size_x = event.getSize_x();
|
||||
size_z = event.getSize_z();
|
||||
schematic = event.getSchematic();
|
||||
if (!force && mega && !Permissions.hasPermission(player, "plots.auto.mega")) {
|
||||
if (!force && mega && !Permissions.hasPermission(player, Permission.PERMISSION_AUTO_MEGA)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.auto.mega"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_AUTO_MEGA)));
|
||||
}
|
||||
if (!force && size_x * size_z > Settings.Claim.MAX_AUTO_AREA) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.cant_claim_more_plots_num"),
|
||||
|
@ -31,6 +31,7 @@ import com.plotsquared.core.backup.BackupProfile;
|
||||
import com.plotsquared.core.backup.NullBackupProfile;
|
||||
import com.plotsquared.core.backup.PlayerBackupProfile;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
@ -142,10 +143,10 @@ public final class Backup extends Command {
|
||||
Template.of("plot", "generic.generic_merged")
|
||||
);
|
||||
} else if (!plot.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, "plots.admin.backup.other")) {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.admin.backup.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
||||
);
|
||||
} else {
|
||||
final BackupProfile backupProfile = Objects.requireNonNull(this.backupManager.getProfile(plot));
|
||||
@ -192,10 +193,10 @@ public final class Backup extends Command {
|
||||
Template.of("plot", "generic.generic_merged")
|
||||
);
|
||||
} else if (!plot.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, "plots.admin.backup.other")) {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.admin.backup.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
||||
);
|
||||
} else {
|
||||
final BackupProfile backupProfile = Objects.requireNonNull(this.backupManager.getProfile(plot));
|
||||
@ -262,10 +263,10 @@ public final class Backup extends Command {
|
||||
Template.of("plot", "generic.generic_merged")
|
||||
);
|
||||
} else if (!plot.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, "plots.admin.backup.other")) {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.admin.backup.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
||||
);
|
||||
} else if (args.length == 0) {
|
||||
player.sendMessage(
|
||||
|
@ -26,6 +26,7 @@
|
||||
package com.plotsquared.core.command;
|
||||
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
@ -57,10 +58,10 @@ public class Caps extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
if (!plot.isAdded(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, "plots.admin.caps.other")) {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_CAPS_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.admin.caps.other"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_CAPS_OTHER)));
|
||||
return false;
|
||||
}
|
||||
player.sendMessage(TranslatableCaption.of("info.plot_caps_header"));
|
||||
|
@ -68,10 +68,10 @@ public class Cluster extends SubCommand {
|
||||
switch (sub) {
|
||||
case "l":
|
||||
case "list": {
|
||||
if (!Permissions.hasPermission(player, "plots.cluster.list")) {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LIST)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.list")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_LIST))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -121,10 +121,10 @@ public class Cluster extends SubCommand {
|
||||
}
|
||||
case "c":
|
||||
case "create": {
|
||||
if (!Permissions.hasPermission(player, "plots.cluster.create")) {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.create")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_CREATE))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -187,13 +187,13 @@ public class Cluster extends SubCommand {
|
||||
Set<Plot> plots = area.getPlotSelectionOwned(pos1, pos2);
|
||||
if (!plots.isEmpty()) {
|
||||
if (!Permissions
|
||||
.hasPermission(player, "plots.cluster.create.other")) {
|
||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE_OTHER)) {
|
||||
UUID uuid = player.getUUID();
|
||||
for (Plot plot : plots) {
|
||||
if (!plot.isOwner(uuid)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.create.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_CREATE_OTHER))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -214,7 +214,7 @@ public class Cluster extends SubCommand {
|
||||
if (current + cluster.getArea() > allowed) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.size" + "." + (current + cluster.getArea()))
|
||||
Template.of("node", Permission.PERMISSION_CLUSTER_SIZE + "." + (current + cluster.getArea()))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -240,7 +240,7 @@ public class Cluster extends SubCommand {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.delete")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -278,7 +278,7 @@ public class Cluster extends SubCommand {
|
||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.delete.other"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE_OTHER)));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -291,7 +291,7 @@ public class Cluster extends SubCommand {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.resize"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE)));
|
||||
return false;
|
||||
}
|
||||
if (args.length != 3) {
|
||||
@ -331,7 +331,7 @@ public class Cluster extends SubCommand {
|
||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.resize.other"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_OTHER)));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -356,7 +356,7 @@ public class Cluster extends SubCommand {
|
||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.resize.shrink")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_SHRINK))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -367,7 +367,7 @@ public class Cluster extends SubCommand {
|
||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.resize.expand")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_EXPAND))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -385,7 +385,7 @@ public class Cluster extends SubCommand {
|
||||
if (current + cluster.getArea() > allowed) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster" + "." + (current + cluster.getArea()))
|
||||
Template.of("node", Permission.PERMISSION_CLUSTER + "." + (current + cluster.getArea()))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -397,10 +397,10 @@ public class Cluster extends SubCommand {
|
||||
case "add":
|
||||
case "inv":
|
||||
case "invite": {
|
||||
if (!Permissions.hasPermission(player, "plots.cluster.invite")) {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.cluster.invite")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_INVITE))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public final class FlagCommand extends Command {
|
||||
.hasPermission(player, Permission.PERMISSION_SET_FLAG_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.set.flag.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_SET_FLAG_OTHER))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public class Info extends SubCommand {
|
||||
.hasPermission(Permission.PERMISSION_AREA_INFO_FORCE.toString())) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.area.info.force")
|
||||
Template.of("node", Permission.PERMISSION_AREA_INFO_FORCE.toString())
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class Merge extends SubCommand {
|
||||
if (!force && size - 1 > maxSize) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.merge." + (size + 1))
|
||||
Template.of("node", Permission.PERMISSION_MERGE + "." + (size + 1))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -176,7 +176,7 @@ public class Merge extends SubCommand {
|
||||
.hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.merge.keeproad")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD))
|
||||
);
|
||||
return true;
|
||||
}
|
||||
@ -220,7 +220,7 @@ public class Merge extends SubCommand {
|
||||
.hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.merge.keeproad")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD))
|
||||
);
|
||||
return true;
|
||||
}
|
||||
@ -244,7 +244,7 @@ public class Merge extends SubCommand {
|
||||
if (!force && !Permissions.hasPermission(player, Permission.PERMISSION_MERGE_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.merge.other")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_OTHER))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import com.plotsquared.core.events.PlotFlagAddEvent;
|
||||
import com.plotsquared.core.events.PlotFlagRemoveEvent;
|
||||
import com.plotsquared.core.events.Result;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotInventory;
|
||||
@ -73,10 +74,10 @@ public class Music extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
if (!plot.isAdded(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, "plots.admin.music.other")) {
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_MUSIC_OTHER)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.admin.music.other"));
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_MUSIC_OTHER)));
|
||||
return true;
|
||||
}
|
||||
PlotInventory inv = new PlotInventory(this.inventoryUtil, player, 2, "Plot Jukebox") {
|
||||
|
@ -81,7 +81,7 @@ public class SchematicCmd extends SubCommand {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_PASTE)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.schematic.paste")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_PASTE))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -212,7 +212,7 @@ public class SchematicCmd extends SubCommand {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_SAVE)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.schematic.save")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_SAVE))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -251,7 +251,7 @@ public class SchematicCmd extends SubCommand {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_LIST)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission"),
|
||||
Template.of("node", "plots.schematic.list")
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_LIST))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
@ -50,15 +50,25 @@ public enum Permission {
|
||||
PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted"),
|
||||
PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield"),
|
||||
PERMISSION_ADMIN_COMMANDS_CHATSPY("plots.admin.command.chatspy"),
|
||||
PERMISSION_MERGE("plots.merge"),
|
||||
PERMISSION_MERGE_OTHER("plots.merge.other"),
|
||||
PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad"),
|
||||
PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other"),
|
||||
PERMISSION_ADMIN_MUSIC_OTHER("plots.admin.music.other"),
|
||||
PERMISSION_ADMIN_DESTROY("plots.admin.destroy"),
|
||||
PERMISSION_ADMIN_DESTROY_UNOWNED("plots.admin.destroy.unowned"),
|
||||
PERMISSION_ADMIN_DESTROY_GROUNDLEVEL("plots.admin.destroy.groundlevel"),
|
||||
PERMISSION_ADMIN_DESTROY_OTHER("plots.admin.destroy.other"),
|
||||
PERMISSION_ADMIN_DESTROY_ROAD("plots.admin.destroy.road"),
|
||||
PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD("plots.admin.vehicle.break.road"),
|
||||
PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED("plots.admin.vehicle.break.unowned"),
|
||||
PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER("plots.admin.vehicle.break.other"),
|
||||
PERMISSION_ADMIN_PVE("plots.admin.pve"),
|
||||
PERMISSION_ADMIN_PVP("plots.admin.pvp"),
|
||||
PERMISSION_ADMIN_BUILD_ROAD("plots.admin.build.road"),
|
||||
PERMISSION_ADMIN_PROJECTILE_ROAD("plots.admin.projectile.road"),
|
||||
PERMISSION_ADMIN_PROJECTILE_UNOWNED("plots.admin.projectile.unowned"),
|
||||
PERMISSION_ADMIN_PROJECTILE_OTHER("plots.admin.projectile.other"),
|
||||
PERMISSION_ADMIN_BUILD_UNOWNED("plots.admin.build.unowned"),
|
||||
PERMISSION_ADMIN_BUILD_OTHER("plots.admin.build.other"),
|
||||
PERMISSION_ADMIN_INTERACT_ROAD("plots.admin.interact.road"),
|
||||
|
Loading…
Reference in New Issue
Block a user