Refactor Captions to Permission, reimplement message list in debug command

This commit is contained in:
dordsor21 2020-08-07 11:53:32 +01:00
parent 50cfecb3fd
commit 21a97863ac
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
77 changed files with 476 additions and 1131 deletions

View File

@ -28,7 +28,7 @@ package com.plotsquared.bukkit.listener;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.plotsquared.bukkit.player.BukkitPlayer; import com.plotsquared.bukkit.player.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
@ -112,7 +112,7 @@ public class ForceFieldListener {
Set<PlotPlayer> players = getNearbyPlayers(player, plot); Set<PlotPlayer> players = getNearbyPlayers(player, plot);
for (PlotPlayer oPlayer : players) { for (PlotPlayer oPlayer : players) {
if (!Permissions if (!Permissions
.hasPermission(oPlayer, Captions.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { .hasPermission(oPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
((BukkitPlayer) oPlayer).player ((BukkitPlayer) oPlayer).player
.setVelocity(calculateVelocity(plotPlayer, oPlayer)); .setVelocity(calculateVelocity(plotPlayer, oPlayer));
} }
@ -123,7 +123,7 @@ public class ForceFieldListener {
return; return;
} }
if (!Permissions if (!Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
player.setVelocity(calculateVelocity(oPlayer, plotPlayer)); player.setVelocity(calculateVelocity(oPlayer, plotPlayer));
} }
} }

View File

@ -32,7 +32,7 @@ import com.plotsquared.bukkit.player.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.bukkit.util.UpdateUtility; import com.plotsquared.bukkit.util.UpdateUtility;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -539,14 +539,14 @@ import java.util.regex.Pattern;
if (shooter instanceof Player) { if (shooter instanceof Player) {
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_PROJECTILE_UNOWNED)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_PROJECTILE_UNOWNED)) {
entity.remove(); entity.remove();
return false; return false;
} }
return true; return true;
} }
if (plot.isAdded(pp.getUUID()) || Permissions if (plot.isAdded(pp.getUUID()) || Permissions
.hasPermission(pp, Captions.PERMISSION_PROJECTILE_OTHER)) { .hasPermission(pp, Permission.PERMISSION_PROJECTILE_OTHER)) {
return true; return true;
} }
entity.remove(); entity.remove();
@ -594,7 +594,7 @@ import java.util.regex.Pattern;
case "worldedit:up": case "worldedit:up":
case "worldedit:/up": case "worldedit:/up":
if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER, true))) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER, true))) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -607,7 +607,7 @@ import java.util.regex.Pattern;
plot.getFlag(BlockedCmdsFlag.class) : plot.getFlag(BlockedCmdsFlag.class) :
area.getFlag(BlockedCmdsFlag.class); area.getFlag(BlockedCmdsFlag.class);
if (!blockedCommands.isEmpty() && !Permissions if (!blockedCommands.isEmpty() && !Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
String part = parts[0]; String part = parts[0];
if (parts[0].contains(":")) { if (parts[0].contains(":")) {
part = parts[0].split(":")[1]; part = parts[0].split(":")[1];
@ -706,7 +706,7 @@ import java.util.regex.Pattern;
this.eventDispatcher.doJoinTask(pp); this.eventDispatcher.doJoinTask(pp);
}, TaskTime.seconds(1L)); }, TaskTime.seconds(1L));
if (pp.hasPermission(Captions.PERMISSION_ADMIN_UPDATE_NOTIFICATION.getTranslated()) if (pp.hasPermission(Permission.PERMISSION_ADMIN_UPDATE_NOTIFICATION.getTranslated())
&& Settings.Enabled_Components.UPDATE_NOTIFICATIONS && PremiumVerification.isPremium() && Settings.Enabled_Components.UPDATE_NOTIFICATIONS && PremiumVerification.isPremium()
&& UpdateUtility.hasUpdate) { && UpdateUtility.hasUpdate) {
new PlotMessage("-----------------------------------").send(pp); new PlotMessage("-----------------------------------").send(pp);
@ -1021,7 +1021,7 @@ import java.util.regex.Pattern;
return; return;
} }
if (plot.isDenied(plotPlayer.getUUID()) && !Permissions if (plot.isDenied(plotPlayer.getUUID()) && !Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_CHAT_BYPASS)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_CHAT_BYPASS)) {
return; return;
} }
event.setCancelled(true); event.setCancelled(true);
@ -1075,7 +1075,7 @@ import java.util.regex.Pattern;
BukkitPlayer plotPlayer = BukkitUtil.adapt(player); BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
if (event.getBlock().getY() == 0) { if (event.getBlock().getY() == 0) {
if (!Permissions if (!Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.destroy.groundlevel") Template.of("node", "plots.admin.destroy.groundlevel")
@ -1085,7 +1085,7 @@ import java.util.regex.Pattern;
} }
} else if ((location.getY() > area.getMaxBuildHeight() || location.getY() < area } else if ((location.getY() > area.getMaxBuildHeight() || location.getY() < area
.getMinBuildHeight()) && !Permissions .getMinBuildHeight()) && !Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
event.setCancelled(true); event.setCancelled(true);
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("height.height_limit"), TranslatableCaption.of("height.height_limit"),
@ -1094,7 +1094,7 @@ import java.util.regex.Pattern;
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
if (!Permissions if (!Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_UNOWNED, true)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED, true)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
@ -1109,7 +1109,7 @@ import java.util.regex.Pattern;
} }
} }
if (Permissions if (Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
return; return;
} }
plotPlayer.sendMessage( plotPlayer.sendMessage(
@ -1118,7 +1118,7 @@ import java.util.regex.Pattern;
); );
event.setCancelled(true); event.setCancelled(true);
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -1130,7 +1130,7 @@ import java.util.regex.Pattern;
return; return;
} }
BukkitPlayer pp = BukkitUtil.adapt(player); BukkitPlayer pp = BukkitUtil.adapt(player);
if (Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_DESTROY_ROAD)) { if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
return; return;
} }
if (this.worldEdit!= null && pp.getAttribute("worldedit")) { if (this.worldEdit!= null && pp.getAttribute("worldedit")) {
@ -1216,7 +1216,7 @@ import java.util.regex.Pattern;
plotExit(pp, plot); plotExit(pp, plot);
} }
if (this.worldEdit != null) { if (this.worldEdit != null) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_WORLDEDIT_BYPASS)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_WORLDEDIT_BYPASS)) {
if (pp.getAttribute("worldedit")) { if (pp.getAttribute("worldedit")) {
pp.removeAttribute("worldedit"); pp.removeAttribute("worldedit");
} }
@ -1399,7 +1399,7 @@ import java.util.regex.Pattern;
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
BukkitPlayer plotPlayer = BukkitUtil.adapt(player); BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
if (Permissions if (Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_UNOWNED)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
return; return;
} }
event.setCancelled(true); event.setCancelled(true);
@ -1412,7 +1412,7 @@ import java.util.regex.Pattern;
if (destroy if (destroy
.contains(BlockTypeWrapper.get(BukkitAdapter.asBlockType(block.getType()))) .contains(BlockTypeWrapper.get(BukkitAdapter.asBlockType(block.getType())))
|| Permissions || Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
return; return;
} }
plot.debug(player.getName() + " could not break " + block.getType() plot.debug(player.getName() + " could not break " + block.getType()
@ -1423,7 +1423,7 @@ import java.util.regex.Pattern;
return; return;
} }
BukkitPlayer plotPlayer = BukkitUtil.adapt(player); BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
if (Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_ROAD)) { if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
return; return;
} }
event.setCancelled(true); event.setCancelled(true);
@ -1820,7 +1820,7 @@ import java.util.regex.Pattern;
if (plot != null) { if (plot != null) {
if (plot.getFlag(PreventCreativeCopyFlag.class) && !plot if (plot.getFlag(PreventCreativeCopyFlag.class) && !plot
.isAdded(player.getUniqueId()) && !Permissions .isAdded(player.getUniqueId()) && !Permissions
.hasPermission(pp, Captions.PERMISSION_ADMIN_INTERACT_OTHER)) { .hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
final ItemStack newStack = final ItemStack newStack =
new ItemStack(newItem.getType(), newItem.getAmount()); new ItemStack(newItem.getType(), newItem.getAmount());
event.setCursor(newStack); event.setCursor(newStack);
@ -1968,7 +1968,7 @@ import java.util.regex.Pattern;
} }
} else { } else {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -2360,7 +2360,7 @@ import java.util.regex.Pattern;
if (player != null) { if (player != null) {
BukkitPlayer pp = BukkitUtil.adapt(player); BukkitPlayer pp = BukkitUtil.adapt(player);
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_ROAD)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.road") Template.of("node", "plots.admin.build.road")
@ -2368,7 +2368,7 @@ import java.util.regex.Pattern;
event.setCancelled(true); event.setCancelled(true);
} }
} else if (!plot.hasOwner()) { } else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_UNOWNED)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.unowned") Template.of("node", "plots.admin.build.unowned")
@ -2376,7 +2376,7 @@ import java.util.regex.Pattern;
event.setCancelled(true); event.setCancelled(true);
} }
} else if (!plot.isAdded(pp.getUUID())) { } else if (!plot.isAdded(pp.getUUID())) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -2444,7 +2444,7 @@ import java.util.regex.Pattern;
BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer()); BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer());
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot == null) { if (plot == null) {
if (Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_ROAD)) { if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
return; return;
} }
pp.sendMessage( pp.sendMessage(
@ -2453,7 +2453,7 @@ import java.util.regex.Pattern;
); );
event.setCancelled(true); event.setCancelled(true);
} else if (!plot.hasOwner()) { } else if (!plot.hasOwner()) {
if (Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_UNOWNED)) { if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
return; return;
} }
pp.sendMessage( pp.sendMessage(
@ -2469,7 +2469,7 @@ import java.util.regex.Pattern;
return; return;
} }
} }
if (Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
return; return;
} }
pp.sendMessage( pp.sendMessage(
@ -2478,7 +2478,7 @@ import java.util.regex.Pattern;
); );
event.setCancelled(true); event.setCancelled(true);
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -2517,7 +2517,7 @@ import java.util.regex.Pattern;
BukkitPlayer plotPlayer = BukkitUtil.adapt(player); BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot == null) { if (plot == null) {
if (Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_ROAD)) { if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
return; return;
} }
plotPlayer.sendMessage( plotPlayer.sendMessage(
@ -2526,7 +2526,7 @@ import java.util.regex.Pattern;
); );
event.setCancelled(true); event.setCancelled(true);
} else if (!plot.hasOwner()) { } else if (!plot.hasOwner()) {
if (Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_UNOWNED)) { if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
return; return;
} }
plotPlayer.sendMessage( plotPlayer.sendMessage(
@ -2543,7 +2543,7 @@ import java.util.regex.Pattern;
return; return;
} }
} }
if (Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
return; return;
} }
plotPlayer.sendMessage( plotPlayer.sendMessage(
@ -2552,7 +2552,7 @@ import java.util.regex.Pattern;
); );
event.setCancelled(true); event.setCancelled(true);
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -2597,7 +2597,7 @@ import java.util.regex.Pattern;
BukkitPlayer pp = BukkitUtil.adapt(p); BukkitPlayer pp = BukkitUtil.adapt(p);
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_ROAD)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.road") Template.of("node", "plots.admin.build.road")
@ -2606,7 +2606,7 @@ import java.util.regex.Pattern;
} }
} else { } else {
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_UNOWNED)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.unwoned") Template.of("node", "plots.admin.build.unwoned")
@ -2617,7 +2617,7 @@ import java.util.regex.Pattern;
} }
if (!plot.isAdded(pp.getUUID())) { if (!plot.isAdded(pp.getUUID())) {
if (!plot.getFlag(HangingPlaceFlag.class)) { if (!plot.getFlag(HangingPlaceFlag.class)) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -2647,7 +2647,7 @@ import java.util.regex.Pattern;
BukkitPlayer pp = BukkitUtil.adapt(p); BukkitPlayer pp = BukkitUtil.adapt(p);
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_DESTROY_ROAD)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.destroy.road") Template.of("node", "plots.admin.destroy.road")
@ -2655,7 +2655,7 @@ import java.util.regex.Pattern;
event.setCancelled(true); event.setCancelled(true);
} }
} else if (!plot.hasOwner()) { } else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_DESTROY_UNOWNED)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.destroy.unowned") Template.of("node", "plots.admin.destroy.unowned")
@ -2666,7 +2666,7 @@ import java.util.regex.Pattern;
if (plot.getFlag(HangingBreakFlag.class)) { if (plot.getFlag(HangingBreakFlag.class)) {
return; return;
} }
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.destroy.other") Template.of("node", "plots.admin.destroy.other")
@ -2690,7 +2690,7 @@ import java.util.regex.Pattern;
if (plot != null) { if (plot != null) {
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_DESTROY_UNOWNED)) { .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.destroy.unowned") Template.of("node", "plots.admin.destroy.unowned")
@ -2700,7 +2700,7 @@ import java.util.regex.Pattern;
} else if (!plot.isAdded(player.getUUID())) { } else if (!plot.isAdded(player.getUUID())) {
if (!plot.getFlag(HangingBreakFlag.class)) { if (!plot.getFlag(HangingBreakFlag.class)) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) { .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.destroy.other") Template.of("node", "plots.admin.destroy.other")
@ -2729,7 +2729,7 @@ import java.util.regex.Pattern;
BukkitPlayer pp = BukkitUtil.adapt(p); BukkitPlayer pp = BukkitUtil.adapt(p);
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot == null && !area.isRoadFlags()) { if (plot == null && !area.isRoadFlags()) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_INTERACT_ROAD)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.interact.road") Template.of("node", "plots.admin.interact.road")
@ -2737,7 +2737,7 @@ import java.util.regex.Pattern;
event.setCancelled(true); event.setCancelled(true);
} }
} else if (plot != null && !plot.hasOwner()) { } else if (plot != null && !plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.interact.unowned") Template.of("node", "plots.admin.interact.unowned")
@ -2795,7 +2795,7 @@ import java.util.regex.Pattern;
return; return;
} }
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_INTERACT_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.interact.other") Template.of("node", "plots.admin.interact.other")
@ -3026,7 +3026,7 @@ import java.util.regex.Pattern;
.isAdded(plotPlayer.getUUID()))) { .isAdded(plotPlayer.getUUID()))) {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions if (!Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -3235,7 +3235,7 @@ import java.util.regex.Pattern;
if (plot != null) { if (plot != null) {
if ((location.getY() > area.getMaxBuildHeight() || location.getY() < area if ((location.getY() > area.getMaxBuildHeight() || location.getY() < area
.getMinBuildHeight()) && !Permissions .getMinBuildHeight()) && !Permissions
.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { .hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
event.setCancelled(true); event.setCancelled(true);
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("height.height_limit"), TranslatableCaption.of("height.height_limit"),
@ -3243,7 +3243,7 @@ import java.util.regex.Pattern;
); );
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_UNOWNED)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -3260,7 +3260,7 @@ import java.util.regex.Pattern;
return; return;
} }
} }
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -3271,7 +3271,7 @@ import java.util.regex.Pattern;
return; return;
} }
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")
@ -3288,7 +3288,7 @@ import java.util.regex.Pattern;
+ " did not fall because of disable-physics = true"); + " did not fall because of disable-physics = true");
} }
} }
} else if (!Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_ROAD)) { } else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", "plots.admin.build.other") Template.of("node", "plots.admin.build.other")

View File

@ -28,7 +28,7 @@ package com.plotsquared.bukkit.player;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.events.TeleportCause; import com.plotsquared.core.events.TeleportCause;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
@ -162,15 +162,15 @@ public class BukkitPlayer extends PlotPlayer<Player> {
@Override @Nonnegative public int hasPermissionRange(@Nonnull final String stub, @Override @Nonnegative public int hasPermissionRange(@Nonnull final String stub,
@Nonnegative final int range) { @Nonnegative final int range) {
if (hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) { if (hasPermission(Permission.PERMISSION_ADMIN.getTranslated())) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
final String[] nodes = stub.split("\\."); final String[] nodes = stub.split("\\.");
final StringBuilder n = new StringBuilder(); final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) { for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i]).append("."); n.append(nodes[i]).append(".");
if (!stub.equals(n + Captions.PERMISSION_STAR.getTranslated())) { if (!stub.equals(n + Permission.PERMISSION_STAR.getTranslated())) {
if (hasPermission(n + Captions.PERMISSION_STAR.getTranslated())) { if (hasPermission(n + Permission.PERMISSION_STAR.getTranslated())) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -69,7 +69,7 @@ public class Add extends Command {
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot")); final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned")); checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
checkTrue(plot.isOwner(player.getUUID()) || Permissions checkTrue(plot.isOwner(player.getUUID()) || Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST), .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST),
TranslatableCaption.of("permission.no_plot_perms")); TranslatableCaption.of("permission.no_plot_perms"));
checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"), checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot add <player | *>")); Template.of("value", "/plot add <player | *>"));
@ -93,8 +93,8 @@ public class Add extends Command {
while (iterator.hasNext()) { while (iterator.hasNext()) {
UUID uuid = iterator.next(); UUID uuid = iterator.next();
if (uuid == DBFunc.EVERYONE && !( if (uuid == DBFunc.EVERYONE && !(
Permissions.hasPermission(player, Captions.PERMISSION_TRUST_EVERYONE) || Permissions Permissions.hasPermission(player, Permission.PERMISSION_TRUST_EVERYONE) || Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST))) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) {
player.sendMessage(TranslatableCaption.of("errors.invalid_player"), player.sendMessage(TranslatableCaption.of("errors.invalid_player"),
Template.of("value", PlayerManager.getName(uuid))); Template.of("value", PlayerManager.getName(uuid)));
iterator.remove(); iterator.remove();
@ -115,7 +115,7 @@ public class Add extends Command {
size += plot.getTrusted().contains(uuid) ? 0 : 1; size += plot.getTrusted().contains(uuid) ? 0 : 1;
} }
checkTrue(!uuids.isEmpty(), null); checkTrue(!uuids.isEmpty(), null);
checkTrue(size <= plot.getArea().getMaxPlotMembers() || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST), checkTrue(size <= plot.getArea().getMaxPlotMembers() || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST),
TranslatableCaption.of("members.plot_max_members")); TranslatableCaption.of("members.plot_max_members"));
// Success // Success
confirm.run(this, () -> { confirm.run(this, () -> {

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -84,9 +84,9 @@ public class Alias extends SubCommand {
return false; return false;
} }
permission = isPermitted(player, Captions.PERMISSION_ALIAS_SET) permission = isPermitted(player, Permission.PERMISSION_ALIAS_SET)
|| isPermitted(player, Captions.PERMISSION_ALIAS_SET_OBSOLETE); || isPermitted(player, Permission.PERMISSION_ALIAS_SET_OBSOLETE);
admin = isPermitted(player, Captions.PERMISSION_ADMIN_ALIAS_SET); admin = isPermitted(player, Permission.PERMISSION_ADMIN_ALIAS_SET);
if (!admin && !owner) { if (!admin && !owner) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
@ -101,8 +101,8 @@ public class Alias extends SubCommand {
break; break;
case "remove": case "remove":
permission = isPermitted(player, Captions.PERMISSION_ALIAS_REMOVE); permission = isPermitted(player, Permission.PERMISSION_ALIAS_REMOVE);
admin = isPermitted(player, Captions.PERMISSION_ADMIN_ALIAS_REMOVE); admin = isPermitted(player, Permission.PERMISSION_ADMIN_ALIAS_REMOVE);
if (!admin && !owner) { if (!admin && !owner) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
@ -172,7 +172,7 @@ public class Alias extends SubCommand {
return true; return true;
} }
private boolean isPermitted(PlotPlayer<?> player, Captions caption) { private boolean isPermitted(PlotPlayer<?> player, Permission permission) {
return Permissions.hasPermission(player, caption); return Permissions.hasPermission(player, permission);
} }
} }

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil; import com.plotsquared.core.configuration.ConfigurationUtil;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;

View File

@ -29,7 +29,7 @@ import com.google.common.collect.Lists;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -285,7 +285,7 @@ public class Auto extends SubCommand {
return true; return true;
} }
if (!force && !Permissions.hasPermission(player, CaptionUtility if (!force && !Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic)) .format(player, Permission.PERMISSION_CLAIM_SCHEMATIC.toString(), schematic))
&& !Permissions && !Permissions
.hasPermission(player, "plots.admin.command.schematic")) { .hasPermission(player, "plots.admin.command.schematic")) {
player.sendMessage( player.sendMessage(

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotFlagRemoveEvent; import com.plotsquared.core.events.PlotFlagRemoveEvent;
import com.plotsquared.core.events.Result; import com.plotsquared.core.events.Result;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -127,7 +127,7 @@ public class Claim extends SubCommand {
); );
} }
if (!Permissions.hasPermission(player, CaptionUtility if (!Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), .format(player, Permission.PERMISSION_CLAIM_SCHEMATIC.toString(),
schematic)) && !Permissions.hasPermission(player, "plots.admin.command.schematic") schematic)) && !Permissions.hasPermission(player, "plots.admin.command.schematic")
&& !force) { && !force) {
player.sendMessage( player.sendMessage(

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.backup.BackupManager; import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotFlagRemoveEvent; import com.plotsquared.core.events.PlotFlagRemoveEvent;

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
@ -210,7 +210,7 @@ public class Cluster extends SubCommand {
current = player.getPlayerClusterCount(player.getLocation().getWorldName()); current = player.getPlayerClusterCount(player.getLocation().getWorldName());
} }
int allowed = Permissions int allowed = Permissions
.hasPermissionRange(player, Captions.PERMISSION_CLUSTER_SIZE, .hasPermissionRange(player, Permission.PERMISSION_CLUSTER_SIZE,
Settings.Limit.MAX_PLOTS); Settings.Limit.MAX_PLOTS);
if (current + cluster.getArea() > allowed) { if (current + cluster.getArea() > allowed) {
player.sendMessage( player.sendMessage(
@ -238,7 +238,7 @@ public class Cluster extends SubCommand {
case "disband": case "disband":
case "del": case "del":
case "delete": { case "delete": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_DELETE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.cluster.delete") Template.of("node", "plots.cluster.delete")
@ -276,7 +276,7 @@ public class Cluster extends SubCommand {
} }
if (!cluster.owner.equals(player.getUUID())) { if (!cluster.owner.equals(player.getUUID())) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_DELETE_OTHER)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.cluster.delete.other")); Template.of("node", "plots.cluster.delete.other"));
@ -289,7 +289,7 @@ public class Cluster extends SubCommand {
} }
case "res": case "res":
case "resize": { case "resize": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_RESIZE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.cluster.resize")); Template.of("node", "plots.cluster.resize"));
@ -329,7 +329,7 @@ public class Cluster extends SubCommand {
} }
if (!cluster.hasHelperRights(player.getUUID())) { if (!cluster.hasHelperRights(player.getUUID())) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_RESIZE_OTHER)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.cluster.resize.other")); Template.of("node", "plots.cluster.resize.other"));
@ -354,7 +354,7 @@ public class Cluster extends SubCommand {
// Check expand / shrink // Check expand / shrink
if (!removed.isEmpty()) { if (!removed.isEmpty()) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_RESIZE_SHRINK)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.cluster.resize.shrink") Template.of("node", "plots.cluster.resize.shrink")
@ -365,7 +365,7 @@ public class Cluster extends SubCommand {
newPlots.removeAll(existing); newPlots.removeAll(existing);
if (!newPlots.isEmpty()) { if (!newPlots.isEmpty()) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_RESIZE_EXPAND)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.cluster.resize.expand") Template.of("node", "plots.cluster.resize.expand")
@ -381,7 +381,7 @@ public class Cluster extends SubCommand {
current = player.getPlayerClusterCount(player.getLocation().getWorldName()); current = player.getPlayerClusterCount(player.getLocation().getWorldName());
} }
current -= cluster.getArea() + (1 + pos2.getX() - pos1.getX()) * (1 + pos2.getY() - pos1.getY()); current -= cluster.getArea() + (1 + pos2.getX() - pos1.getX()) * (1 + pos2.getY() - pos1.getY());
int allowed = Permissions.hasPermissionRange(player, Captions.PERMISSION_CLUSTER, int allowed = Permissions.hasPermissionRange(player, Permission.PERMISSION_CLUSTER,
Settings.Limit.MAX_PLOTS); Settings.Limit.MAX_PLOTS);
if (current + cluster.getArea() > allowed) { if (current + cluster.getArea() > allowed) {
player.sendMessage( player.sendMessage(
@ -424,10 +424,10 @@ public class Cluster extends SubCommand {
} }
if (!cluster.hasHelperRights(player.getUUID())) { if (!cluster.hasHelperRights(player.getUUID())) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_INVITE_OTHER)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_INVITE_OTHER.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_INVITE_OTHER.toString())
); );
return false; return false;
} }
@ -464,10 +464,10 @@ public class Cluster extends SubCommand {
case "k": case "k":
case "remove": case "remove":
case "kick": { case "kick": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_KICK)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_KICK.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_KICK.toString())
); );
return false; return false;
} }
@ -489,10 +489,10 @@ public class Cluster extends SubCommand {
} }
if (!cluster.hasHelperRights(player.getUUID())) { if (!cluster.hasHelperRights(player.getUUID())) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_KICK_OTHER)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_KICK_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_KICK_OTHER.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_KICK_OTHER.toString())
); );
return false; return false;
} }
@ -546,10 +546,10 @@ public class Cluster extends SubCommand {
} }
case "quit": case "quit":
case "leave": { case "leave": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_LEAVE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LEAVE)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_LEAVE.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_LEAVE.toString())
); );
return false; return false;
} }
@ -613,10 +613,10 @@ public class Cluster extends SubCommand {
case "admin": case "admin":
case "helper": case "helper":
case "helpers": { case "helpers": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_HELPERS)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_HELPERS)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_HELPERS.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_HELPERS.toString())
); );
return false; return false;
} }
@ -668,10 +668,10 @@ public class Cluster extends SubCommand {
case "spawn": case "spawn":
case "home": case "home":
case "tp": { case "tp": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_TP)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_TP.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString())
); );
return false; return false;
} }
@ -697,10 +697,10 @@ public class Cluster extends SubCommand {
} }
UUID uuid = player.getUUID(); UUID uuid = player.getUUID();
if (!cluster.isAdded(uuid)) { if (!cluster.isAdded(uuid)) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_TP_OTHER)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_TP_OTHER.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_TP_OTHER.toString())
); );
return false; return false;
} }
@ -712,10 +712,10 @@ public class Cluster extends SubCommand {
case "info": case "info":
case "show": case "show":
case "information": { case "information": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_INFO)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INFO)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_TP.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString())
); );
return false; return false;
} }
@ -774,10 +774,10 @@ public class Cluster extends SubCommand {
case "sh": case "sh":
case "setspawn": case "setspawn":
case "sethome": case "sethome":
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_SETHOME)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_SETHOME.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME.toString())
); );
return false; return false;
} }
@ -799,10 +799,10 @@ public class Cluster extends SubCommand {
} }
if (!cluster.hasHelperRights(player.getUUID())) { if (!cluster.hasHelperRights(player.getUUID())) {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_CLUSTER_SETHOME_OTHER)) { .hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_CLUSTER_SETHOME_OTHER.toString()) Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME_OTHER.toString())
); );
return false; return false;
} }

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.LocaleHolder; import com.plotsquared.core.configuration.caption.LocaleHolder;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotFlagRemoveEvent; import com.plotsquared.core.events.PlotFlagRemoveEvent;
@ -61,7 +61,7 @@ public class Continue extends SubCommand {
return false; return false;
} }
if (!plot.isOwner(player.getUUID()) && !Permissions if (!plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_CONTINUE)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_CONTINUE)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", TranslatableCaption.of("permission.no_plot_perms").getComponent(player)) Template.of("node", TranslatableCaption.of("permission.no_plot_perms").getComponent(player))
@ -77,7 +77,7 @@ public class Continue extends SubCommand {
< player.getPlotCount() + size)) { < player.getPlotCount() + size)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_ADMIN_COMMAND_CONTINUE.toString()) Template.of("node", Permission.PERMISSION_ADMIN_COMMAND_CONTINUE.toString())
); );
return false; return false;
} }

View File

@ -25,7 +25,7 @@
*/ */
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -50,7 +50,7 @@ public class Copy extends SubCommand {
return false; return false;
} }
if (!plot1.isOwner(player.getUUID()) && !Permissions if (!plot1.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN.toString())) { .hasPermission(player, Permission.PERMISSION_ADMIN.toString())) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} }

View File

@ -27,9 +27,10 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.RegionManager; import com.plotsquared.core.util.RegionManager;
@ -50,6 +51,7 @@ import javax.annotation.Nonnull;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.Map; import java.util.Map;
import java.util.Set;
@CommandDeclaration(command = "debug", @CommandDeclaration(command = "debug",
category = CommandCategory.DEBUG, category = CommandCategory.DEBUG,
@ -133,10 +135,11 @@ public class Debug extends SubCommand {
}); });
return true; return true;
} }
Set<TranslatableCaption> captions = PlotSquared.get().getCaptionMap(TranslatableCaption.DEFAULT_NAMESPACE).getCaptions().keySet();
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) { if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();
for (Captions caption : Captions.values()) { for (Caption caption : captions) {
msg.append(caption.getTranslated()).append("\n"); msg.append(caption.getComponent(ConsolePlayer.getConsole())).append("\n");
} }
player.sendMessage(StaticCaption.of(msg.toString())); player.sendMessage(StaticCaption.of(msg.toString()));
return true; return true;
@ -152,8 +155,7 @@ public class Debug extends SubCommand {
information.append( information.append(
MINI_MESSAGE.parse(line, Template.of("var", "Owned Plots"), Template.of("val", String.valueOf(PlotQuery.newQuery().allPlots().count())))); MINI_MESSAGE.parse(line, Template.of("var", "Owned Plots"), Template.of("val", String.valueOf(PlotQuery.newQuery().allPlots().count()))));
information.append(MINI_MESSAGE.parse(section, Template.of("val", "Messages"))); information.append(MINI_MESSAGE.parse(section, Template.of("val", "Messages")));
information information.append(MINI_MESSAGE.parse(line, Template.of("var", "Total Messages"), Template.of("val", String.valueOf(captions.size()))));
.append(MINI_MESSAGE.parse(line, Template.of("var", "Total Messages"), Template.of("val", String.valueOf(Captions.values().length))));
information.append(MINI_MESSAGE.parse(line, Template.of("var", "View all captions"), Template.of("val", "/plot debug msg"))); information.append(MINI_MESSAGE.parse(line, Template.of("var", "View all captions"), Template.of("val", "/plot debug msg")));
player.sendMessage(StaticCaption.of(information.toString())); player.sendMessage(StaticCaption.of(information.toString()));
return true; return true;

View File

@ -28,7 +28,7 @@ package com.plotsquared.core.command;
import com.google.common.io.Files; import com.google.common.io.Files;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.CaptionHolder; import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
@ -198,7 +198,7 @@ public class DebugExec extends SubCommand {
this.scope.put("MainCommand", MainCommand.getInstance()); this.scope.put("MainCommand", MainCommand.getInstance());
// enums // enums
for (Enum<?> value : Captions.values()) { for (Enum<?> value : Permission.values()) {
this.scope.put("C_" + value.name(), value); this.scope.put("C_" + value.name(), value);
} }
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.Result; import com.plotsquared.core.events.Result;
@ -84,7 +84,7 @@ public class Delete extends SubCommand {
} }
boolean force = eventResult == Result.FORCE; boolean force = eventResult == Result.FORCE;
if (!force && !plot.isOwner(player.getUUID()) && !Permissions if (!force && !plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DELETE)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DELETE)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} }

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
@ -82,7 +82,7 @@ public class Deny extends SubCommand {
return false; return false;
} }
if (!plot.isOwner(player.getUUID()) && !Permissions if (!plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DENY)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DENY)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return true; return true;
} }
@ -98,8 +98,8 @@ public class Deny extends SubCommand {
} else { } else {
for (UUID uuid : uuids) { for (UUID uuid : uuids) {
if (uuid == DBFunc.EVERYONE && !( if (uuid == DBFunc.EVERYONE && !(
Permissions.hasPermission(player, Captions.PERMISSION_DENY_EVERYONE) || Permissions Permissions.hasPermission(player, Permission.PERMISSION_DENY_EVERYONE) || Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DENY))) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DENY))) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("errors.invalid_player"), TranslatableCaption.of("errors.invalid_player"),
Template.of("value", args[0]) Template.of("value", args[0])

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotDoneEvent; import com.plotsquared.core.events.PlotDoneEvent;
@ -80,7 +80,7 @@ public class Done extends SubCommand {
} }
boolean force = event.getEventResult() == Result.FORCE; boolean force = event.getEventResult() == Result.FORCE;
if (!force && !plot.isOwner(player.getUUID()) && !Permissions if (!force && !plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DONE)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DONE)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
@ -82,12 +82,12 @@ public class Download extends SubCommand {
return false; return false;
} }
if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && (!DoneFlag.isDone(plot))) && !Permissions if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && (!DoneFlag.isDone(plot))) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) {
player.sendMessage(TranslatableCaption.of("done.done_not_done")); player.sendMessage(TranslatableCaption.of("done.done_not_done"));
return false; return false;
} }
if ((!plot.isOwner(player.getUUID())) && !Permissions if ((!plot.isOwner(player.getUUID())) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN.toString())) { .hasPermission(player, Permission.PERMISSION_ADMIN.toString())) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} }
@ -119,10 +119,10 @@ public class Download extends SubCommand {
}); });
} else if (args.length == 1 && StringMan } else if (args.length == 1 && StringMan
.isEqualIgnoreCaseToAny(args[0], "mcr", "world", "mca")) { .isEqualIgnoreCaseToAny(args[0], "mcr", "world", "mca")) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_DOWNLOAD_WORLD)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD_WORLD)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_DOWNLOAD_WORLD.toString()) Template.of("node", Permission.PERMISSION_DOWNLOAD_WORLD.toString())
); );
return false; return false;
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
@ -96,7 +96,7 @@ public final class FlagCommand extends Command {
key = key.toLowerCase(); key = key.toLowerCase();
value = value.toLowerCase(); value = value.toLowerCase();
String perm = CaptionUtility String perm = CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY_VALUE.toString(),
key.toLowerCase(), value.toLowerCase()); key.toLowerCase(), value.toLowerCase());
if (flag instanceof IntegerFlag && MathMan.isInteger(value)) { if (flag instanceof IntegerFlag && MathMan.isInteger(value)) {
try { try {
@ -108,8 +108,8 @@ public final class FlagCommand extends Command {
Settings.Limit.MAX_PLOTS; Settings.Limit.MAX_PLOTS;
final boolean result = player.hasPermissionRange(perm, checkRange) >= numeric; final boolean result = player.hasPermissionRange(perm, checkRange) >= numeric;
if (!result) { if (!result) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY_VALUE.toString(),
key.toLowerCase(), value.toLowerCase())); key.toLowerCase(), value.toLowerCase()));
} }
return result; return result;
@ -122,12 +122,12 @@ public final class FlagCommand extends Command {
PlotFlag<? extends List<?>, ?> parsedFlag = listFlag.parse(value); PlotFlag<? extends List<?>, ?> parsedFlag = listFlag.parse(value);
for (final Object entry : parsedFlag.getValue()) { for (final Object entry : parsedFlag.getValue()) {
final String permission = CaptionUtility final String permission = CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY_VALUE.toString(),
key.toLowerCase(), entry.toString().toLowerCase()); key.toLowerCase(), entry.toString().toLowerCase());
final boolean result = Permissions.hasPermission(player, permission); final boolean result = Permissions.hasPermission(player, permission);
if (!result) { if (!result) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY_VALUE.toString(),
key.toLowerCase(), value.toLowerCase())); key.toLowerCase(), value.toLowerCase()));
return false; return false;
} }
@ -147,8 +147,8 @@ public final class FlagCommand extends Command {
} }
final boolean result = Permissions.hasPermission(player, perm); final boolean result = Permissions.hasPermission(player, perm);
if (!result) { if (!result) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY_VALUE.toString(),
key.toLowerCase(), value.toLowerCase())); key.toLowerCase(), value.toLowerCase()));
} }
return result; return result;
@ -171,7 +171,7 @@ public final class FlagCommand extends Command {
return false; return false;
} }
if (!plot.isOwner(player.getUUID()) && !Permissions if (!plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_SET_FLAG_OTHER)) { .hasPermission(player, Permission.PERMISSION_SET_FLAG_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.set.flag.other") Template.of("node", "plots.set.flag.other")
@ -441,11 +441,11 @@ public final class FlagCommand extends Command {
boolean force = event.getEventResult() == Result.FORCE; boolean force = event.getEventResult() == Result.FORCE;
flag = event.getFlag(); flag = event.getFlag();
if (!force && !Permissions.hasPermission(player, CaptionUtility if (!force && !Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY.toString(),
args[0].toLowerCase()))) { args[0].toLowerCase()))) {
if (args.length != 2) { if (args.length != 2) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), .format(player, Permission.PERMISSION_SET_FLAG_KEY.toString(),
args[0].toLowerCase())); args[0].toLowerCase()));
return; return;
} }
@ -481,7 +481,7 @@ public final class FlagCommand extends Command {
return; return;
} }
} else { } else {
// MainUtil.sendMessage(player, Captions.FLAG_REMOVED); // MainUtil.sendMessage(player, Permission.FLAG_REMOVED);
PlotFlag plotFlag = parsedFlag.createFlagInstance(list); PlotFlag plotFlag = parsedFlag.createFlagInstance(list);
PlotFlagAddEvent addEvent = new PlotFlagAddEvent(plotFlag, plot); PlotFlagAddEvent addEvent = new PlotFlagAddEvent(plotFlag, plot);
if (addEvent.getEventResult() == Result.DENY) { if (addEvent.getEventResult() == Result.DENY) {

View File

@ -28,7 +28,7 @@ package com.plotsquared.core.command;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.player.MetaDataAccess; import com.plotsquared.core.player.MetaDataAccess;
@ -67,9 +67,9 @@ public class Grant extends Command {
case "add": case "add":
case "check": case "check":
if (!Permissions.hasPermission(player, CaptionUtility if (!Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_GRANT.getTranslated(), arg0))) { .format(player, Permission.PERMISSION_GRANT.toString(), arg0))) {
Captions.NO_PERMISSION.send(player, CaptionUtility Permission.NO_PERMISSION.send(player, CaptionUtility
.format(player, Captions.PERMISSION_GRANT.getTranslated(), arg0)); .format(player, Permission.PERMISSION_GRANT.toString(), arg0));
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }
if (args.length > 2) { if (args.length > 2) {

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.TeleportCause; import com.plotsquared.core.events.TeleportCause;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -104,11 +104,11 @@ public class HomeCommand extends Command {
// /plot home <[area;]x;y> // /plot home <[area;]x;y>
// /plot home <area> <x;y> // /plot home <area> <x;y>
// /plot home <area> <page> // /plot home <area> <page>
if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OWNED) && !Permissions if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OWNED) && !Permissions
.hasPermission(player, Captions.PERMISSION_HOME)) { .hasPermission(player, Permission.PERMISSION_HOME)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", Captions.PERMISSION_VISIT_OWNED.toString()) Template.of("node", Permission.PERMISSION_VISIT_OWNED.toString())
); );
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }

View File

@ -25,7 +25,7 @@
*/ */
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
@ -99,7 +99,7 @@ public class Info extends SubCommand {
for (final String argument : args) { for (final String argument : args) {
if (argument.equalsIgnoreCase("-f")) { if (argument.equalsIgnoreCase("-f")) {
if (!player if (!player
.hasPermission(Captions.PERMISSION_AREA_INFO_FORCE.toString())) { .hasPermission(Permission.PERMISSION_AREA_INFO_FORCE.toString())) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.area.info.force") Template.of("node", "plots.area.info.force")

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
@ -75,7 +75,7 @@ public class Kick extends SubCommand {
return false; return false;
} }
if ((!plot.hasOwner() || !plot.isOwner(player.getUUID())) && !Permissions if ((!plot.hasOwner() || !plot.isOwner(player.getUUID())) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_KICK)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_KICK)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission")); player.sendMessage(TranslatableCaption.of("permission.no_permission"));
return false; return false;
} }
@ -94,7 +94,7 @@ public class Kick extends SubCommand {
if (uuid == DBFunc.EVERYONE) { if (uuid == DBFunc.EVERYONE) {
for (PlotPlayer<?> pp : plot.getPlayersInPlot()) { for (PlotPlayer<?> pp : plot.getPlayersInPlot()) {
if (pp == player || Permissions if (pp == player || Permissions
.hasPermission(pp, Captions.PERMISSION_ADMIN_ENTRY_DENIED)) { .hasPermission(pp, Permission.PERMISSION_ADMIN_ENTRY_DENIED)) {
continue; continue;
} }
players.add(pp); players.add(pp);
@ -122,7 +122,7 @@ public class Kick extends SubCommand {
); );
return; return;
} }
if (Permissions.hasPermission(player2, Captions.PERMISSION_ADMIN_ENTRY_DENIED)) { if (Permissions.hasPermission(player2, Permission.PERMISSION_ADMIN_ENTRY_DENIED)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("cluster.cannot_kick_player"), TranslatableCaption.of("cluster.cannot_kick_player"),
Template.of("name", player2.getName()) Template.of("name", player2.getName())

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -96,7 +96,7 @@ public class Like extends SubCommand {
return false; return false;
} }
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_RATE, true)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_RATE, true)) {
return false; return false;
} }
plot.clearRatings(); plot.clearRatings();

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.CaptionHolder; import com.plotsquared.core.configuration.caption.CaptionHolder;
@ -90,40 +90,40 @@ public class ListCmd extends SubCommand {
private String[] getArgumentList(PlotPlayer player) { private String[] getArgumentList(PlotPlayer player) {
List<String> args = new ArrayList<>(); List<String> args = new ArrayList<>();
if (this.econHandler != null && Permissions if (this.econHandler != null && Permissions
.hasPermission(player, Captions.PERMISSION_LIST_FOR_SALE)) { .hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
args.add("forsale"); args.add("forsale");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_MINE)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
args.add("mine"); args.add("mine");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_SHARED)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
args.add("shared"); args.add("shared");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_WORLD)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
args.add("world"); args.add("world");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_TOP)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
args.add("top"); args.add("top");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_ALL)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
args.add("all"); args.add("all");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_UNOWNED)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
args.add("unowned"); args.add("unowned");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_PLAYER)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) {
args.add("<player>"); args.add("<player>");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_WORLD)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
args.add("<world>"); args.add("<world>");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_DONE)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
args.add("done"); args.add("done");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_EXPIRED)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
args.add("expired"); args.add("expired");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_FUZZY)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) {
args.add("fuzzy <search...>"); args.add("fuzzy <search...>");
} }
return args.toArray(new String[args.size()]); return args.toArray(new String[args.size()]);
@ -190,7 +190,7 @@ public class ListCmd extends SubCommand {
switch (arg) { switch (arg) {
case "mine": case "mine":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_MINE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.mine")); Templates.of("node", "plots.list.mine"));
return false; return false;
@ -199,7 +199,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().ownedBy(player).whereBasePlot().withSortingStrategy(SortingStrategy.SORT_BY_TEMP)); plotConsumer.accept(PlotQuery.newQuery().ownedBy(player).whereBasePlot().withSortingStrategy(SortingStrategy.SORT_BY_TEMP));
break; break;
case "shared": case "shared":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_SHARED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.shared")); Templates.of("node", "plots.list.shared"));
return false; return false;
@ -207,7 +207,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().withMember(player.getUUID()).thatPasses(plot -> !plot.isOwnerAbs(player.getUUID()))); plotConsumer.accept(PlotQuery.newQuery().withMember(player.getUUID()).thatPasses(plot -> !plot.isOwnerAbs(player.getUUID())));
break; break;
case "world": case "world":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_WORLD)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.world")); Templates.of("node", "plots.list.world"));
return false; return false;
@ -220,7 +220,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().inWorld(world)); plotConsumer.accept(PlotQuery.newQuery().inWorld(world));
break; break;
case "expired": case "expired":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_EXPIRED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.expired")); Templates.of("node", "plots.list.expired"));
return false; return false;
@ -232,7 +232,7 @@ public class ListCmd extends SubCommand {
} }
break; break;
case "area": case "area":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_AREA)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_AREA)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.area")); Templates.of("node", "plots.list.area"));
return false; return false;
@ -249,7 +249,7 @@ public class ListCmd extends SubCommand {
} }
break; break;
case "all": case "all":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_ALL)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.all")); Templates.of("node", "plots.list.all"));
return false; return false;
@ -257,7 +257,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().allPlots()); plotConsumer.accept(PlotQuery.newQuery().allPlots());
break; break;
case "done": case "done":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_DONE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.done")); Templates.of("node", "plots.list.done"));
return false; return false;
@ -266,7 +266,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(DoneFlag::isDone).withSortingStrategy(SortingStrategy.SORT_BY_DONE)); plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(DoneFlag::isDone).withSortingStrategy(SortingStrategy.SORT_BY_DONE));
break; break;
case "top": case "top":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_TOP)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.top")); Templates.of("node", "plots.list.top"));
return false; return false;
@ -275,7 +275,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().allPlots().withSortingStrategy(SortingStrategy.SORT_BY_RATING)); plotConsumer.accept(PlotQuery.newQuery().allPlots().withSortingStrategy(SortingStrategy.SORT_BY_RATING));
break; break;
case "forsale": case "forsale":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_FOR_SALE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.forsale")); Templates.of("node", "plots.list.forsale"));
return false; return false;
@ -286,7 +286,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getFlag(PriceFlag.class) > 0)); plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getFlag(PriceFlag.class) > 0));
break; break;
case "unowned": case "unowned":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_UNOWNED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.unowned")); Templates.of("node", "plots.list.unowned"));
return false; return false;
@ -294,7 +294,7 @@ public class ListCmd extends SubCommand {
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null)); plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null));
break; break;
case "fuzzy": case "fuzzy":
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_FUZZY)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.fuzzy")); Templates.of("node", "plots.list.fuzzy"));
return false; return false;
@ -315,7 +315,7 @@ public class ListCmd extends SubCommand {
break; break;
default: default:
if (this.plotAreaManager.hasPlotArea(args[0])) { if (this.plotAreaManager.hasPlotArea(args[0])) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_LIST_WORLD)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.world")); Templates.of("node", "plots.list.world"));
return false; return false;
@ -346,7 +346,7 @@ public class ListCmd extends SubCommand {
Templates.of("value", args[0])); Templates.of("value", args[0]));
} else { } else {
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_LIST_PLAYER)) { .hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.player")); Templates.of("node", "plots.list.player"));
} else { } else {
@ -431,31 +431,31 @@ public class ListCmd extends SubCommand {
@Override public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) { @Override public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<String> completions = new LinkedList<>(); final List<String> completions = new LinkedList<>();
if (this.econHandler != null && Permissions if (this.econHandler != null && Permissions
.hasPermission(player, Captions.PERMISSION_LIST_FOR_SALE)) { .hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
completions.add("forsale"); completions.add("forsale");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_MINE)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
completions.add("mine"); completions.add("mine");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_SHARED)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
completions.add("shared"); completions.add("shared");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_WORLD)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
completions.addAll(PlotSquared.platform().getWorldManager().getWorlds()); completions.addAll(PlotSquared.platform().getWorldManager().getWorlds());
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_TOP)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
completions.add("top"); completions.add("top");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_ALL)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
completions.add("all"); completions.add("all");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_UNOWNED)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
completions.add("unowned"); completions.add("unowned");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_DONE)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
completions.add("done"); completions.add("done");
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_EXPIRED)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
completions.add("expired"); completions.add("expired");
} }
@ -463,7 +463,7 @@ public class ListCmd extends SubCommand {
.map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) { .map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_PLAYER) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList()));
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
@ -84,7 +84,7 @@ public class Load extends SubCommand {
return false; return false;
} }
if (!plot.isOwner(player.getUUID()) && !Permissions if (!plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_LOAD)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_LOAD)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} }

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Injector; import com.google.inject.Injector;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
@ -241,8 +241,8 @@ public class MainCommand extends Command {
PlotArea area = player.getApplicablePlotArea(); PlotArea area = player.getApplicablePlotArea();
Plot newPlot = Plot.fromString(area, args[0]); Plot newPlot = Plot.fromString(area, args[0]);
if (newPlot != null && (player instanceof ConsolePlayer || newPlot.getArea() if (newPlot != null && (player instanceof ConsolePlayer || newPlot.getArea()
.equals(area) || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN) .equals(area) || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN)
|| Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_SUDO_AREA)) || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_SUDO_AREA))
&& !newPlot.isDenied(player.getUUID())) { && !newPlot.isDenied(player.getUUID())) {
Location newLoc = newPlot.getCenterSynchronous(); Location newLoc = newPlot.getCenterSynchronous();
if (player.canTeleport(newLoc)) { if (player.canTeleport(newLoc)) {

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotMergeEvent; import com.plotsquared.core.events.PlotMergeEvent;
@ -175,7 +175,7 @@ public class Merge extends SubCommand {
terrain = "true".equalsIgnoreCase(args[1]); terrain = "true".equalsIgnoreCase(args[1]);
} }
if (!force && !terrain && !Permissions if (!force && !terrain && !Permissions
.hasPermission(player, Captions.PERMISSION_MERGE_KEEP_ROAD)) { .hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.merge.keeproad") Template.of("node", "plots.merge.keeproad")
@ -197,7 +197,7 @@ public class Merge extends SubCommand {
return false; return false;
} }
if (!force && !plot.isOwner(uuid)) { if (!force && !plot.isOwner(uuid)) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_MERGE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} else { } else {
@ -219,7 +219,7 @@ public class Merge extends SubCommand {
terrain = true; terrain = true;
} }
if (!force && !terrain && !Permissions if (!force && !terrain && !Permissions
.hasPermission(player, Captions.PERMISSION_MERGE_KEEP_ROAD)) { .hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.merge.keeproad") Template.of("node", "plots.merge.keeproad")
@ -243,7 +243,7 @@ public class Merge extends SubCommand {
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge")); player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
return false; return false;
} }
if (!force && !Permissions.hasPermission(player, Captions.PERMISSION_MERGE_OTHER)) { if (!force && !Permissions.hasPermission(player, Permission.PERMISSION_MERGE_OTHER)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.merge.other") Template.of("node", "plots.merge.other")

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -66,7 +66,7 @@ public class Move extends SubCommand {
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }
if (!plot1.isOwner(player.getUUID()) && !Permissions if (!plot1.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN)) { .hasPermission(player, Permission.PERMISSION_ADMIN)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }
@ -98,7 +98,7 @@ public class Move extends SubCommand {
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }
if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !Permissions if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN))) { .hasPermission(player, Permission.PERMISSION_ADMIN))) {
player.sendMessage(TranslatableCaption.of("errors.plotworld_incompatible")); player.sendMessage(TranslatableCaption.of("errors.plotworld_incompatible"));
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotChangeOwnerEvent; import com.plotsquared.core.events.PlotChangeOwnerEvent;
@ -95,7 +95,7 @@ public class Owner extends SetCommand {
boolean force = event.getEventResult() == Result.FORCE; boolean force = event.getEventResult() == Result.FORCE;
if (uuid == null) { if (uuid == null) {
if (!force && !Permissions if (!force && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_SET_OWNER, .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER,
true)) { true)) {
return; return;
} }
@ -124,7 +124,7 @@ public class Owner extends SetCommand {
return; return;
} }
if (!force && !Permissions if (!force && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_SET_OWNER)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER)) {
if (other == null) { if (other == null) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("invalid_player_offline"), TranslatableCaption.of("invalid_player_offline"),

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -114,7 +114,7 @@ public class Rate extends SubCommand {
return false; return false;
} }
if (!Permissions if (!Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_RATE, true)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_RATE, true)) {
return false; return false;
} }
plot.clearRatings(); plot.clearRatings();
@ -168,7 +168,7 @@ public class Rate extends SubCommand {
Template.of("plot", plot.getId().toString()) Template.of("plot", plot.getId().toString())
); );
if (Permissions if (Permissions
.hasPermission(this.player, Captions.PERMISSION_COMMENT)) { .hasPermission(this.player, Permission.PERMISSION_COMMENT)) {
Command command = Command command =
MainCommand.getInstance().getCommand(Comment.class); MainCommand.getInstance().getCommand(Comment.class);
if (command != null) { if (command != null) {

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.MemorySection; import com.plotsquared.core.configuration.MemorySection;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
@ -72,7 +72,7 @@ public class Remove extends SubCommand {
return false; return false;
} }
if (!plot.isOwner(player.getUUID()) && !Permissions if (!plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_REMOVE)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_REMOVE)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return true; return true;
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.MetaDataAccess; import com.plotsquared.core.player.MetaDataAccess;
@ -78,7 +78,7 @@ public class Save extends SubCommand {
return false; return false;
} }
if (!plot.isOwner(player.getUUID()) && !Permissions if (!plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_SAVE)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SAVE)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;
} }

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
@ -81,7 +81,7 @@ public class SchematicCmd extends SubCommand {
String arg = args[0].toLowerCase(); String arg = args[0].toLowerCase();
switch (arg) { switch (arg) {
case "paste": { case "paste": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_SCHEMATIC_PASTE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_PASTE)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.schematic.paste") Template.of("node", "plots.schematic.paste")
@ -212,7 +212,7 @@ public class SchematicCmd extends SubCommand {
} }
case "export": case "export":
case "save": case "save":
if (!Permissions.hasPermission(player, Captions.PERMISSION_SCHEMATIC_SAVE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_SAVE)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.schematic.save") Template.of("node", "plots.schematic.save")
@ -251,7 +251,7 @@ public class SchematicCmd extends SubCommand {
} }
break; break;
case "list": { case "list": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_SCHEMATIC_LIST)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_LIST)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.schematic.list") Template.of("node", "plots.schematic.list")

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.backup.BackupManager; import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
@ -104,7 +104,7 @@ public class Set extends SubCommand {
BlockType::getName).collect(Collectors.toList())); BlockType::getName).collect(Collectors.toList()));
} }
if (!Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_ALLOW_UNSAFE) && if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_ALLOW_UNSAFE) &&
!forbiddenTypes.isEmpty()) { !forbiddenTypes.isEmpty()) {
for (String forbiddenType : forbiddenTypes) { for (String forbiddenType : forbiddenTypes) {
forbiddenType = forbiddenType.toLowerCase(Locale.ENGLISH); forbiddenType = forbiddenType.toLowerCase(Locale.ENGLISH);
@ -141,10 +141,10 @@ public class Set extends SubCommand {
for (String component : components) { for (String component : components) {
if (component.equalsIgnoreCase(args[0])) { if (component.equalsIgnoreCase(args[0])) {
if (!Permissions.hasPermission(player, CaptionUtility if (!Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_SET_COMPONENT.getTranslated(), .format(player, Permission.PERMISSION_SET_COMPONENT.toString(),
component))) { component))) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_SET_COMPONENT.getTranslated(), .format(player, Permission.PERMISSION_SET_COMPONENT.toString(),
component)); component));
return false; return false;
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -45,9 +45,9 @@ public abstract class SetCommand extends SubCommand {
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
if (!Permissions.hasPermission(player, CaptionUtility if (!Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()))) { .format(player, Permission.PERMISSION_ADMIN_COMMAND.toString(), getFullId()))) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), .format(player, Permission.PERMISSION_ADMIN_COMMAND.toString(),
getFullId())); getFullId()));
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed")); player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
return false; return false;
@ -55,9 +55,9 @@ public abstract class SetCommand extends SubCommand {
} }
if (!plot.isOwner(player.getUUID())) { if (!plot.isOwner(player.getUUID())) {
if (!Permissions.hasPermission(player, CaptionUtility if (!Permissions.hasPermission(player, CaptionUtility
.format(player, Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()))) { .format(player, Permission.PERMISSION_ADMIN_COMMAND.toString(), getFullId()))) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility MainUtil.sendMessage(player, Permission.NO_PERMISSION, CaptionUtility
.format(player, Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), .format(player, Permission.PERMISSION_ADMIN_COMMAND.toString(),
getFullId())); getFullId()));
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return false; return false;

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.generator.GeneratorWrapper; import com.plotsquared.core.generator.GeneratorWrapper;

View File

@ -25,7 +25,7 @@
*/ */
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -56,7 +56,7 @@ public class Swap extends SubCommand {
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }
if (!plot1.isOwner(player.getUUID()) && !Permissions if (!plot1.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN)) { .hasPermission(player, Permission.PERMISSION_ADMIN)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return CompletableFuture.completedFuture(false); return CompletableFuture.completedFuture(false);
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -73,7 +73,7 @@ public class Trust extends Command {
} }
checkTrue(currentPlot.hasOwner(), TranslatableCaption.of("info.plot_unowned")); checkTrue(currentPlot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
checkTrue(currentPlot.isOwner(player.getUUID()) || Permissions checkTrue(currentPlot.isOwner(player.getUUID()) || Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST), .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST),
TranslatableCaption.of("permission.no_plot_perms")); TranslatableCaption.of("permission.no_plot_perms"));
checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"), checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"),
@ -101,8 +101,8 @@ public class Trust extends Command {
while (iterator.hasNext()) { while (iterator.hasNext()) {
UUID uuid = iterator.next(); UUID uuid = iterator.next();
if (uuid == DBFunc.EVERYONE && !( if (uuid == DBFunc.EVERYONE && !(
Permissions.hasPermission(player, Captions.PERMISSION_TRUST_EVERYONE) || Permissions Permissions.hasPermission(player, Permission.PERMISSION_TRUST_EVERYONE) || Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST))) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("errors.invalid_player"), TranslatableCaption.of("errors.invalid_player"),
Template.of("value", PlayerManager.getName(uuid)) Template.of("value", PlayerManager.getName(uuid))
@ -130,7 +130,7 @@ public class Trust extends Command {
} }
checkTrue(!uuids.isEmpty(), null); checkTrue(!uuids.isEmpty(), null);
checkTrue(size <= currentPlot.getArea().getMaxPlotMembers() || Permissions checkTrue(size <= currentPlot.getArea().getMaxPlotMembers() || Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST), .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST),
TranslatableCaption.of("member.plot_max_members")); TranslatableCaption.of("member.plot_max_members"));
// Success // Success
confirm.run(this, () -> { confirm.run(this, () -> {

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotUnlinkEvent; import com.plotsquared.core.events.PlotUnlinkEvent;
import com.plotsquared.core.events.Result; import com.plotsquared.core.events.Result;
@ -92,7 +92,7 @@ public class Unlink extends SubCommand {
} }
boolean force = event.getEventResult() == Result.FORCE; boolean force = event.getEventResult() == Result.FORCE;
if (!force && !plot.isOwner(player.getUUID()) && !Permissions if (!force && !plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_UNLINK)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
} }
Runnable runnable = () -> { Runnable runnable = () -> {

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.TeleportCause; import com.plotsquared.core.events.TeleportCause;
@ -106,32 +106,32 @@ public class Visit extends Command {
final Plot plot = plots.get(page - 1); final Plot plot = plots.get(page - 1);
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_UNOWNED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_UNOWNED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.visit.unowned")); Templates.of("node", "plots.visit.unowned"));
return; return;
} }
} else if (plot.isOwner(player.getUUID())) { } else if (plot.isOwner(player.getUUID())) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OWNED) && !Permissions if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OWNED) && !Permissions
.hasPermission(player, Captions.PERMISSION_HOME)) { .hasPermission(player, Permission.PERMISSION_HOME)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.visit.owned")); Templates.of("node", "plots.visit.owned"));
return; return;
} }
} else if (plot.isAdded(player.getUUID())) { } else if (plot.isAdded(player.getUUID())) {
if (!Permissions.hasPermission(player, Captions.PERMISSION_SHARED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_SHARED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.visit.shared")); Templates.of("node", "plots.visit.shared"));
return; return;
} }
} else { } else {
if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OTHER)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.visit.other")); Templates.of("node", "plots.visit.other"));
return; return;
} }
if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_VISIT_UNTRUSTED)) { .hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.admin.visit.untrusted")); Templates.of("node", "plots.admin.visit.untrusted"));
return; return;

View File

@ -1,827 +0,0 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2020 IntellectualSites
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.plotsquared.core.configuration;
import javax.annotation.Nonnull;
/**
* Captions class.
*/
public enum Captions {
//@formatter:off
//<editor-fold desc="Static Permission">
PERMISSION_STAR("*"),
PERMISSION_ADMIN("plots.admin"),
PERMISSION_ADMIN_SUDO_AREA("plots.admin.area.sudo"),
PERMISSION_PROJECTILE_UNOWNED("plots.projectile.unowned"),
PERMISSION_PROJECTILE_OTHER("plots.projectile.other"),
PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS("plots.admin.interact.blockedcommands"),
PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass"),
PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles"),
PERMISSION_PLOT_TOGGLE_CHAT("plots.toggle.chat"),
PERMISSION_PLOT_TOGGLE_TIME("plots.toggle.time"),
PERMISSION_ADMIN_UPDATE_NOTIFICATION("plots.admin.update.notify"),
PERMISSION_ADMIN_EXIT_DENIED("plots.admin.exit.denied"),
PERMISSION_ADMIN_ENTRY_DENIED("plots.admin.entry.denied"),
PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted"),
PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield"),
PERMISSION_COMMANDS_CHAT("plots.admin.command.chat"),
PERMISSION_MERGE_OTHER("plots.merge.other"),
PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad"),
PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other"),
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_BUILD_ROAD("plots.admin.build.road"),
PERMISSION_ADMIN_BUILD_UNOWNED("plots.admin.build.unowned"),
PERMISSION_ADMIN_BUILD_OTHER("plots.admin.build.other"),
PERMISSION_ADMIN_INTERACT_ROAD("plots.admin.interact.road"),
PERMISSION_ADMIN_INTERACT_UNOWNED("plots.admin.interact.unowned"),
PERMISSION_ADMIN_INTERACT_OTHER("plots.admin.interact.other"),
PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT("plots.admin.build.heightlimit"),
PERMISSION_ADMIN_UPDATE("plots.admin.command.update"),
PERMISSION_ADMIN_COMMAND_RATE("plots.admin.command.rate"),
PERMISSION_ADMIN_COMMAND_TRUST("plots.admin.command.trust"),
PERMISSION_TRUST_EVERYONE("plots.trust.everyone"),
PERMISSION_AREA_CREATE("plots.area.create"),
PERMISSION_AREA_INFO("plots.area.info","static.permissions"),
PERMISSION_AREA_INFO_FORCE("plots.admin.info.force"),
PERMISSION_AREA_LIST("plots.area.list"),
PERMISSION_AREA_REGEN("plots.area.regen"),
PERMISSION_AREA_TP("plots.area.tp"),
PERMISSION_AUTO_MEGA("plots.auto.mega"),
PERMISSION_CLAIM_SCHEMATIC("plots.claim.%s0"),
PERMISSION_ADMIN_COMMAND_SCHEMATIC("plots.admin.command.schematic"),
PERMISSION_ADMIN_COMMAND_CLEAR("plots.admin.command.clear"),
PERMISSION_CONTINUE("plots.continue"),
PERMISSION_CLUSTER_LIST("plots.cluster.list"),
PERMISSION_CLUSTER_CREATE("plots.cluster.create"),
PERMISSION_CLUSTER_CREATE_OTHER("plots.cluster.create.other"),
PERMISSION_CLUSTER_SIZE("plots.cluster.size"),
PERMISSION_CLUSTER_DELETE("plots.cluster.delete"),
PERMISSION_CLUSTER_DELETE_OTHER("plots.cluster.delete.other"),
PERMISSION_CLUSTER_RESIZE("plots.cluster.resize"),
PERMISSION_CLUSTER_RESIZE_OTHER("plots.cluster.resize.other"),
PERMISSION_CLUSTER_RESIZE_SHRINK("plots.cluster.resize.shrink"),
PERMISSION_CLUSTER_RESIZE_EXPAND("plots.cluster.resize.expand"),
PERMISSION_CLUSTER("plots.cluster"),
PERMISSION_CLUSTER_INVITE("plots.cluster.invite"),
PERMISSION_CLUSTER_INVITE_OTHER("plots.cluster.invite.other"),
PERMISSION_CLUSTER_KICK("plots.cluster.kick"),
PERMISSION_CLUSTER_KICK_OTHER("plots.cluster.kick.other"),
PERMISSION_CLUSTER_LEAVE("plots.cluster.leave"),
PERMISSION_CLUSTER_HELPERS("plots.cluster.helpers"),
PERMISSION_CLUSTER_TP("plots.cluster.tp"),
PERMISSION_CLUSTER_TP_OTHER("plots.cluster.tp.other"),
PERMISSION_CLUSTER_INFO("plots.cluster.info"),
PERMISSION_CLUSTER_SETHOME("plots.cluster.sethome"),
PERMISSION_CLUSTER_SETHOME_OTHER("plots.cluster.sethome.other"),
PERMISSION_ADMIN_COMMAND_CONTINUE("plots.admin.command.continue"),
PERMISSION_ADMIN_COMMAND_DELETE("plots.admin.command.delete"),
PERMISSION_ADMIN_COMMAND_DENY("plots.admin.command.deny"),
PERMISSION_DENY_EVERYONE("plots.deny.everyone"),
PERMISSION_ADMIN_COMMAND_DONE("plots.admin.command.done"),
PERMISSION_ADMIN_COMMAND_DOWNLOAD("plots.admin.command.download"),
PERMISSION_DOWNLOAD_WORLD("plots.download.world"),
PERMISSION_SET_FLAG_OTHER("plots.set.flag.other"),
PERMISSION_SET_FLAG("plots.set.flag"),
PERMISSION_SET_FLAG_KEY("plots.set.flag.%s0"),
PERMISSION_SET_FLAG_KEY_VALUE("plots.set.flag.%s0.%s1"),
PERMISSION_FLAG_REMOVE("plots.flag.remove"),
PERMISSION_FLAG_ADD("plots.flag.add"),
PERMISSION_FLAG_LIST("plots.flag.list"),
PERMISSION_ADMIN_COMMAND_KICK("plots.admin.command.kick"),
PERMISSION_GRANT("plots.grant.%s0"),
PERMISSION_LIST_FOR_SALE("plots.list.forsale"),
PERMISSION_LIST_MINE("plots.list.mine"),
PERMISSION_LIST_SHARED("plots.list.shared"),
PERMISSION_LIST_WORLD("plots.list.world"),
PERMISSION_LIST_WORLD_NAME("plots.list.world.%s0"),
PERMISSION_LIST_TOP("plots.list.top"),
PERMISSION_LIST_ALL("plots.list.all"),
PERMISSION_LIST_UNOWNED("plots.list.unowned"),
PERMISSION_LIST_UNKNOWN("plots.list.unknown"),
PERMISSION_LIST_PLAYER("plots.list.player"),
PERMISSION_LIST_DONE("plots.list.done"),
PERMISSION_LIST_EXPIRED("plots.list.expired"),
PERMISSION_LIST_FUZZY("plots.list.fuzzy"),
PERMISSION_LIST_AREA("plots.list.area"),
PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load"),
PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge"),
PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner"),
PERMISSION_COMMENT("plots.comment"),
PERMISSION_ADMIN_COMMAND_REMOVE("plots.admin.command.remove"),
PERMISSION_ADMIN_COMMAND_SAVE("plots.admin.command.save"),
PERMISSION_ADMIN_COMMAND_SCHEMATIC_PASTE("plots.admin.command.schematic.paste"),
PERMISSION_SCHEMATIC_PASTE("plots.schematic.paste"),
PERMISSION_SCHEMATIC_LIST("plots.schematic.list"),
PERMISSION_SCHEMATIC_SAVE("plots.schematic.save"),
PERMISSION_ADMIN_COMMAND_SCHEMATIC_SAVE("plots.admin.command.schematic.save"),
PERMISSION_SET_COMPONENT("plots.set.%s0"),
PERMISSION_ADMIN_COMMAND("plots.admin.command.%s0"),
PERMISSION_ADMIN_COMMAND_UNLINK("plots.ad2min.command.unlink"),
PERMISSION_VISIT_UNOWNED("plots.visit.unowned"),
PERMISSION_VISIT_OWNED("plots.visit.owned"),
PERMISSION_SHARED("plots.visit.shared"),
PERMISSION_VISIT_OTHER("plots.visit.other"),
PERMISSION_HOME("plots.home"),
PERMISSION_ALIAS_SET_OBSOLETE("plots.set.alias"), // Note this is for backwards compatibility
PERMISSION_ALIAS_SET("plots.alias.set"),
PERMISSION_ADMIN_ALIAS_SET("plots.admin.alias.set"),
PERMISSION_ALIAS_REMOVE("plots.alias.remove"),
PERMISSION_ADMIN_ALIAS_REMOVE("plots.admin.alias.remove"),
PERMISSION_ADMIN_CHAT_BYPASS("plots.admin.chat.bypass"),
PERMISSION_BACKUP("plots.backup"),
PERMISSION_BACKUP_SAVE("plots.backup.save"),
PERMISSION_BACKUP_LIST("plots.backup.list"),
PERMISSION_BACKUP_LOAD("plots.backup.load"),
PERMISSION_ADMIN_BACKUP_OTHER("plots.admin.backup.other"),
PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe"),
PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other"),
//</editor-fold>
//<editor-fold desc="Confirm">
EXPIRED_CONFIRM("$2Confirmation has expired, please run the command again!", "Confirm"),
FAILED_CONFIRM("$2You have no pending actions to confirm!", "Confirm"),
REQUIRES_CONFIRM("$2Are you sure you wish to execute: $1%s$2?&-$2This cannot be undone! If you are sure: $1/plot confirm", "Confirm", "command"),
//</editor-fold>
//<editor-fold desc="Move">
MOVE_SUCCESS("$4Successfully moved plot.", "Move"),
MOVE_MERGED("$2Merged plots may not be moved. Please unmerge the plot before performing the move.", "Move"),
COPY_SUCCESS("$4Successfully copied plot.", "Move"),
REQUIRES_UNOWNED("$2The location specified is already occupied.", "Move"),
//</editor-fold>
//<editor-fold desc="Area Create">
REQUIRES_UNMERGED("$2The plot cannot be merged", "debug"),
SET_ATTRIBUTE("$4Successfully set %s0 set to %s1", "Set", "attribute", "value"),
//</editor-fold>
//<editor-fold desc="Web">
GENERATING_LINK("$1Processing plot...", "Web"),
GENERATING_LINK_FAILED("$2Failed to generate download link!", "Web"),
SAVE_FAILED("$2Failed to save", "Web"),
LOAD_NULL("$2Please use $4/plot load $2to get a list of schematics", "Web"),
LOAD_FAILED("$2Failed to load schematic", "Web"),
LOAD_LIST("$2To load a schematic, use $1/plot load #", "Web"),
SAVE_SUCCESS("$1Successfully saved!", "Web"),
//</editor-fold>
//<editor-fold desc="Compass">
COMPASS_TARGET("$4Successfully targeted plot with compass", "Compass"),
//</editor-fold>
//<editor-fold desc="Cluster">
CLUSTER_AVAILABLE_ARGS(
"$1The following sub commands are available: $4list$2, $4create$2, $4delete$2, $4resize$2, $4invite$2, $4kick$2, $4leave$2, "
+ "$4members$2, $4info$2, $4tp$2, $4sethome", "Cluster"),
CLUSTER_LIST_HEADING("$2There are $1%s$2 clusters in this world", "Cluster", "amount"),
CLUSTER_LIST_ELEMENT("$2 - $1%s&-", "Cluster", "cluster"),
CLUSTER_INTERSECTION("$2The proposed area overlaps with: %s0", "Cluster", "cluster"),
CLUSTER_OUTSIDE("$2The proposed area is outside the plot area: %s0", "Cluster", "area"),
CLUSTER_ADDED("$4Successfully created the cluster.", "Cluster"),
CLUSTER_DELETED("$4Successfully deleted the cluster.", "Cluster"),
CLUSTER_RESIZED("$4Successfully resized the cluster.", "Cluster"),
CLUSTER_ADDED_USER("$4Successfully added user to the cluster.", "Cluster"),
CANNOT_KICK_PLAYER("$2You cannot kick that player", "Cluster"),
CLUSTER_INVITED("$1You have been invited to the following cluster: $2%s", "Cluster", "cluster"),
CLUSTER_REMOVED("$1You have been removed from cluster: $2%s", "Cluster", "cluster"),
CLUSTER_KICKED_USER("$4Successfully kicked the user", "Cluster"),
INVALID_CLUSTER("$1Invalid cluster name: $2%s", "Cluster", "cluster"),
CLUSTER_NOT_ADDED("$2That player was not added to the plot cluster", "Cluster"),
CLUSTER_CANNOT_LEAVE("$1You must delete or transfer ownership before leaving", "Cluster"),
CLUSTER_ADDED_HELPER("$4Successfully added a helper to the cluster", "Cluster"),
CLUSTER_REMOVED_HELPER("$4Successfully removed a helper from the cluster", "Cluster"),
CLUSTER_REGENERATED("$4Successfully started cluster regeneration", "Cluster"),
CLUSTER_TELEPORTING("$4Teleporting...", "Cluster"),
CLUSTER_INFO("$1Current cluster: $2%id%&-$1Name: $2%name%&-$1Owner: $2%owner%&-$1Size: $2%size%&-$1Rights: $2%rights%", "Cluster"),
//</editor-fold>
//<editor-fold desc="Border">
BORDER("$2You are outside the current map border", "Border"),
WORLDEDIT_BYPASS("$2&oTo bypass your restrictions use $4/plot wea", "WorldEdit Masks"),
WORLDEDIT_BYPASSED("$2Currently bypassing WorldEdit restriction.", "WorldEdit Masks"),
GAMEMODE_WAS_BYPASSED("$1You bypassed the GameMode ($2{gamemode}$1) $1set for $2{plot}", "GameMode"),
HEIGHT_LIMIT("$1This plot area has a height limit of $2{limit}", "Height Limit"),
//</editor-fold>
//<editor-fold desc="Records">
NOTIFY_ENTER("$2%player $2entered your plot ($1%plot$2)", "Records"),
NOTIFY_LEAVE("$2%player $2left your plot ($1%plot$2)", "Records"),
//</editor-fold>
//<editor-fold desc="Swap">
SWAP_OVERLAP("$2The proposed areas are not allowed to overlap", "Swap"),
SWAP_SUCCESS("$4Successfully swapped plots", "Swap"),
SWAP_MERGED("$2Merged plots may not be swapped. Please unmerge the plot before performing the swap.", "Swap"),
//</editor-fold>
//<editor-fold desc="Comments">
INBOX_NOTIFICATION("%s unread messages. Use /plot inbox", "Comment"),
NOT_VALID_INBOX_INDEX("$2No comment at index %s", "Comment", "number"),
INBOX_ITEM("$2 - $4%s", "Comment", "value"),
COMMENT_SYNTAX("$2Use /plot comment [X;Z] <%s> <comment>", "Comment", "list"),
INVALID_INBOX("$2That is not a valid inbox.&-$1Accepted values: %s", "Comment", "list"),
NO_PERM_INBOX("$2You do not have permission for that inbox", "Comment"),
NO_PERM_INBOX_MODIFY("$2You do not have permission to modify that inbox", "Comment"),
NO_PLOT_INBOX("$2You must stand in or supply a plot argument", "Comment"),
COMMENT_REMOVED_SUCCESS("$4Successfully deleted comment/s:n$2 - '$3%s$2'", "Comment", "value"),
COMMENT_REMOVED_FAILURE("$4Failed to delete comment!", "Comment"),
COMMENT_ADDED("$4A comment has been left", "Comment"),
INBOX_EMPTY("$2No comments", "Comment"),
//</editor-fold>
//<editor-fold desc="Console">
NOT_CONSOLE("$2For safety reasons, this command can only be executed by console.", "Console"),
IS_CONSOLE("$2This command can only be executed by a player.", "Console"),
//</editor-fold>
//<editor-fold desc="Clipboard">
PASTE_FAILED("$2Failed to paste the selection. Reason: $2%s", "Clipboard", "reason"),
//</editor-fold>
//<editor-fold desc="Toggle">
TOGGLE_ENABLED("$2Enabled setting: %s", "Toggle", "setting"),
TOGGLE_DISABLED("$2Disabled setting: %s", "Toggle", "setting"),
COMMAND_BLOCKED("$2That command is not allowed in this plot", "Blocked Command"),
//</editor-fold>
//<editor-fold desc="Done">
DONE_ALREADY_DONE("$2This plot is already marked as done", "Done"),
DONE_NOT_DONE("$2This plot is not marked as done.", "Done"),
DONE_INSUFFICIENT_COMPLEXITY("$2This plot is too simple. Please add more detail before using this command.", "Done"),
DONE_SUCCESS("$1Successfully marked this plot as done.", "Done"),
DONE_REMOVED("$1You may now continue building in this plot.", "Done"),
//</editor-fold>
//<editor-fold desc="Ratings">
RATINGS_PURGED("$2Purged ratings for this plot", "Ratings"),
RATING_NOT_VALID("$2You need to specify a number between 1 and 10", "Ratings"),
RATING_ALREADY_EXISTS("$2You have already rated plot $2%s", "Ratings", "plot"),
RATING_APPLIED("$4You successfully rated plot $2%s", "Ratings", "plot"),
RATING_DISLIKED("$4You successfully disliked plot $2%s", "Ratings", "plot"),
RATING_LIKED("$4You successfully liked plot $2%s", "Ratings", "plot"),
RATING_NOT_YOUR_OWN("$2You cannot rate your own plot", "Ratings"),
RATING_NOT_DONE("$2You can only rate finished plots.", "Ratings"),
RATING_NOT_OWNED("$2You cannot rate a plot that is not claimed by anyone", "Ratings"),
//</editor-fold>
//<editor-fold desc="Tutorial">
RATE_THIS("$2Rate this plot!", "Tutorial"),
COMMENT_THIS("$2Leave some feedback on this plot: %s", "Tutorial", "plot"),
//</editor-fold>
//<editor-fold desc="Economy">
ECON_DISABLED("$2Economy is not enabled", "Economy"),
CANNOT_AFFORD_PLOT("$2You cannot afford to buy this plot. It costs $1%s", "Economy", "money"),
NOT_FOR_SALE("$2This plot is not for sale", "Economy"),
CANNOT_BUY_OWN("$2You cannot buy your own plot", "Economy"),
PLOT_SOLD("$4Your plot; $1%s0$4, has been sold to $1%s1$4 for $1$%s2", "Economy", "plot", "player", "money"),
CANNOT_AFFORD_MERGE("$2You cannot afford to merge the plots. It costs $1%s","Economy", "money"),
ADDED_BALANCE("$1%s $2has been added to your balance", "Economy", "money"),
REMOVED_BALANCE("$1%s $2has been taken from your balance", "Economy", "money"),
REMOVED_GRANTED_PLOT("$2You used %s0 plot grant(s), you've got $1%s1 $2left", "Economy", "usedGrants", "remainingGrants"),
//</editor-fold>
//<editor-fold desc="Setup">
SETUP_NOT_STARTED("$1No setup started. Use $2/plot setup $1to start a setup process.", "Setup"),
SETUP_INIT("$1Usage: $2/plot setup <value>", "Setup"),
SETUP_STEP("$3[$1Step %s0$3] $1%s1 $2- $1Expecting: $2%s2 $1Default: $2%s3", "Setup", "step", "description", "type", "value"),
SETUP_INVALID_ARG("$2%s0 is not a valid argument for step %s1. To cancel setup use: $1/plot setup cancel", "Setup", "value", "step"),
SETUP_VALID_ARG("$2Value $1%s0 $2set to %s1", "Setup", "description", "value"),
SETUP_FINISHED(
"$4You should have been teleported to the created world. Otherwise you will need to set the generator manually using the bukkit.yml or "
+ "your chosen world management plugin.", "Setup"),
SETUP_WORLD_TAKEN("$2%s is already a world", "Setup", "value"),
SETUP_CANCELLED("$7Cancelled setup.", "Setup"),
SETUP_WORLD_NAME("$1What do you want your world to be called?", "Setup"),
SETUP_WORLD_NAME_ERROR("$7You need to choose a world name!", "Setup"),
SETUP_WORLD_NAME_TAKEN("$7That world name is already taken!", "Setup"),
SETUP_WORLD_GENERATOR_ERROR("$7You must choose a generator!", "Setup"),
SETUP_WORLD_TYPE("$1What world type do you want?&-"
+ "$3 - $6normal$3 - $2Standard plot generation&-"
+ "$3 - $6augmented$3 - $2Plot generation with terrain&-"
+ "$3 - $6partial$3 - $2Vanilla with clusters of plots", "Setup"),
SETUP_WORLD_TYPE_ERROR("$7You must choose a world type!", "Setup"),
SETUP_WRONG_GENERATOR("$7The specified generator does not identify as BukkitPlotGenerator"
+ "$3 - $6You may need to manually configure the other plugin", "Setup"),
SETUP_WORLD_NAME_FORMAT("$7Non [a-z0-9_.-] character in the world name:$1 ", "Setup"),
SETUP_WORLD_APPLY_PLOTSQUARED("$7The world you specified already exists. After restarting, new terrain will use "
+ "$1PlotSquared$7, however you may need to reset the world for it to generate correctly!", "Setup"),
SETUP_PARTIAL_AREA("$1What terrain would you like in plots?&-"
+ "$3 - $6NONE$3 - $2No terrain at all&-"
+ "$3 - $6ORE$3 - $2Just some ore veins and trees&-"
+ "$3 - $6ROAD$3 - $2Terrain separated by roads&-"
+ "$3 - $6ALL$3 - $2Entirely vanilla generation", "Setup"),
SETUP_PARTIAL_AREA_ERROR("$7You must choose the terrain!", "Setup"),
SETUP_AREA_NAME("$1What would you like this area called?", "Setup"),
SETUP_AREA_NON_ALPHANUMERICAL("$7The area id must be alphanumerical!", "Setup"),
SETUP_AREA_INVALID_ID("$7You must choose an area id that is not in use!", "Setup"),
SETUP_AREA_MIN_PLOT_ID("$1What should be the minimum Plot Id?", "Setup"),
SETUP_AREA_MIN_PLOT_ID_ERROR("$7You must choose a valid minimum Plot Id!", "Setup"),
SETUP_AREA_MAX_PLOT_ID("$1What should be the maximum Plot Id?", "Setup"),
SETUP_AREA_MAX_PLOT_ID_ERROR("$7You must choose a valid maximum Plot Id!", "Setup"),
SETUP_AREA_PLOT_ID_GREATER_THAN_MINIMUM("$7The max PlotId must be greater than the minimum!", "Setup"),
//</editor-fold>
//<editor-fold desc=PlotAreaType>
PLOT_AREA_TYPE_NORMAL("Standard plot generation", "PlotAreaType"),
PLOT_AREA_TYPE_AUGMENTED("Plot generation with vanilla terrain", "PlotAreaType"),
PLOT_AREA_TYPE_PARTIAL("Vanilla with clusters of plots", "PlotAreaType"),
//</editor-fold>
//<editor-fold desc="Schematic">
SCHEMATIC_TOO_LARGE("$2The plot is too large for this action!", "Schematics"),
SCHEMATIC_MISSING_ARG("$2You need to specify an argument. Possible values: $1save$2, $1paste $2, $1exportall$2, $1list", "Schematics"),
SCHEMATIC_INVALID("$2That is not a valid schematic. Reason: $2%s", "Schematics", "reason"),
SCHEMATIC_PASTE_MERGED("$2Schematics cannot be pasted onto merged plots. Please unmerge the plot before performing the paste.", "Schematics"),
SCHEMATIC_PASTE_FAILED("$2Failed to paste the schematic", "Schematics"),
SCHEMATIC_PASTE_SUCCESS("$4The schematic pasted successfully", "Schematics"),
SCHEMATIC_LIST("$4Saved Schematics: $1%s", "Schematics", "list"),
SCHEMATIC_ROAD_CREATED("$1Saved new road schematic. To test the schematic, fly to a few other plots and run /plot debugroadregen", "Schematics"),
MCA_FILE_SIZE("$1Note: The `.mca` files are 512x512", "Schematics"),
SCHEMATIC_EXPORTALL_STARTED("$1Starting export...", "Schematics"),
SCHEMATIC_EXPORTALL_WORLD_ARGS("$1Need world argument. Use $3/plot sch exportall <area>", "Schematics"),
SCHEMATIC_EXPORTALL_WORLD("$1Invalid world. Use &3/plot sch exportall <area>", "Schematic"),
SCHEMATIC_EXPORTALL_FINISHED("$1Finished mass export", "Schematics"),
SCHEMATIC_EXPORTALL_SINGLE_FINISHED("$1Finished export", "Schematics"),
TASK_IN_PROCESS("$1Task is already running.", "Error"),
//</editor-fold>
//<editor-fold desc="Titles">
TITLE_ENTERED_PLOT("$1Plot: %world%;%x%;%z%", "Titles"),
TITLE_ENTERED_PLOT_SUB("$4Owned by %s", "Titles", "owner"),
PREFIX_GREETING("$1%id%$2> ", "Titles"),
PREFIX_FAREWELL("$1%id%$2> ", "Titles"),
//</editor-fold>
//<editor-fold desc="Core">
PREFIX("$3[$1P2$3] $2", "Core"),
ENABLED("$1%s0 is now enabled", "Core", "value"),
//</editor-fold>
//<editor-fold desc="Reload">
RELOADED_CONFIGS("$1Translations and world settings have been reloaded", "Reload"),
RELOAD_FAILED("$2Failed to reload file configurations", "Reload"),
//</editor-fold>
//<editor-fold desc="Description">
DESC_SET("$2Plot description set", "Desc"),
DESC_UNSET("$2Plot description unset", "Desc"),
//</editor-fold>
//<editor-fold desc="Alias">
ALIAS_SET_TO("$2Plot alias set to $1%alias%", "Alias"),
ALIAS_REMOVED("$2Plot alias removed", "Alias"),
ALIAS_TOO_LONG("$2The alias must be < 50 characters in length", "Alias"),
ALIAS_IS_TAKEN("$2That alias is already taken", "Alias"),
//</editor-fold>
//<editor-fold desc="Position">
POSITION_SET("$1Home position set to your current location", "Position"),
POSITION_UNSET("$1Home position reset to the default location", "Position"),
HOME_ARGUMENT("$2Use /plot set home [none]", "Position"),
//</editor-fold>
//<editor-fold desc="Permission">
NO_SCHEMATIC_PERMISSION("$2You don't have the permission required to use schematic $1%s", "Permission", "value"),
NO_PERMISSION("$2You are lacking the permission node: $1%s", "Permission", "node"),
NO_PERMISSION_EVENT("$2You are lacking the permission node: $1%s", "Permission"),
NO_PLOT_PERMS("$2You must be the plot owner to perform this action", "Permission"),
CANT_CLAIM_MORE_PLOTS("$2You can't claim more plots.", "Permission"),
CANT_CLAIM_MORE_CLUSTERS("$2You can't claim more clusters.", "Permission"),
CANT_TRANSFER_MORE_PLOTS("$2You can't send more plots to that user", "Permission"),
CANT_CLAIM_MORE_PLOTS_NUM("$2You can't claim more than $1%s $2plots at once", "Permission", "amount"),
//</editor-fold>
//<editor-fold desc="Merge">
MERGE_NOT_VALID("$2This merge request is no longer valid.", "Merge"),
MERGE_ACCEPTED("$2The merge request has been accepted", "Merge"),
SUCCESS_MERGE("$2Plots have been merged!", "Merge"),
MERGE_REQUESTED("$2Successfully sent a merge request", "Merge"),
MERGE_REQUEST_CONFIRM("Merge request from %s", "Permission", "player"),
NO_AVAILABLE_AUTOMERGE("$2You do not own any adjacent plots in the specified direction or are not allowed to merge to the required size.", "Merge"),
UNLINK_IMPOSSIBLE("$2You can only unlink a mega-plot", "Merge"),
UNMERGE_CANCELLED("$1Unlink has been cancelled", "Merge"),
UNLINK_SUCCESS("$2Successfully unlinked plots.", "Merge"),
//</editor-fold>
//<editor-fold desc="CommandConfig">
NOT_VALID_SUBCOMMAND("$2That is not a valid subcommand", "CommandConfig"),
DID_YOU_MEAN("$2Did you mean: $1%s", "CommandConfig", "value"),
SUBCOMMAND_SET_OPTIONS_HEADER("$2Possible Values: ", "CommandConfig"),
COMMAND_SYNTAX("$1Usage: $2%s", "CommandConfig", "value"),
//</editor-fold>
//<editor-fold desc="Errors">
COMPONENT_ILLEGAL_BLOCK("$2You are not allowed to generate a component containg the block '%s'", "Invalid", "value"),
INVALID_PLAYER("$2Player not found: $1%s$2.", "Errors", "player"),
INVALID_PLAYER_OFFLINE("$2The player must be online: $1%s.", "Errors", "player"),
INVALID_COMMAND_FLAG("$2Invalid command flag: %s0", "Errors", "value"),
ERROR("$2An error occurred: %s", "Errors", "value"),
COMMAND_WENT_WRONG("$2Something went wrong when executing that command...", "Errors"),
NO_FREE_PLOTS("$2There are no free plots available", "Errors"),
NOT_IN_PLOT("$2You're not in a plot", "Errors"),
NOT_IN_CLUSTER("$2You must be within a plot cluster to perform that action", "Errors"),
NOT_IN_PLOT_WORLD("$2You're not in a plot area", "Errors"),
PLOTWORLD_INCOMPATIBLE("$2The two worlds must be compatible", "Errors"),
NOT_VALID_WORLD("$2That is not a valid world (case sensitive)", "Errors"),
NOT_VALID_PLOT_WORLD("$2That is not a valid plot area (case sensitive)", "Errors"),
NO_PLOTS("$2You don't have any plots", "Errors"),
PLAYER_NO_PLOTS("$2That player does not own any plots", "Errors"),
WAIT_FOR_TIMER("$2A set block timer is bound to either the current plot or you. Please wait for it to finish", "Errors"),
TILE_ENTITY_CAP_REACHED("$2The total number of tile entities in this chunk may not exceed $1%s", "Errors", "amount"),
//</editor-fold>
DEBUG_REPORT_CREATED("$1Uploaded a full debug to: $1%url%", "Paste"),
PURGE_SUCCESS("$4Successfully purged %s plots", "Purge", "amount"),
FETCHING_PLAYER("$1PlotSquared is attempting to find the specified player from your argument(s). This may take a while.", "Players"),
FETCHING_PLAYERS_TIMEOUT("$2The specified users did not exist in the cache and will be fetched in the background. Please wait a couple of minutes.", "Players"),
//<editor-fold desc="Trim">
TRIM_IN_PROGRESS("A world trim task is already in progress!", "Trim"),
//</editor-fold>
//<editor-fold desc="Block List">
BLOCK_LIST_SEPARATOR("$1,$2 ", "Block List"),
//</editor-fold>
//<editor-fold desc="Biome">
NEED_BIOME("$2You need to specify a valid biome.", "Biome"),
BIOME_SET_TO("$2Plot biome set to $2", "Biome"),
//</editor-fold>
//<editor-fold desc="Teleport">
TELEPORTED_TO_PLOT("$1You have been teleported", "Teleport"),
TELEPORTED_TO_ROAD("$2You got teleported to the road", "Teleport"),
TELEPORT_IN_SECONDS("$1Teleporting in %s seconds. Do not move...", "Teleport", "amount"),
TELEPORT_FAILED("$2Teleportation cancelled due to movement or damage", "Teleport"),
//</editor-fold>
//<editor-fold desc="Set Block">
SET_BLOCK_ACTION_FINISHED("$1The last setblock action is now finished.", "Set Block"),
//</editor-fold>
//<editor-fold desc="AllowUnsafe">
DEBUGALLOWUNSAFE_ON("$2Unsafe actions allowed", "unsafe"),
DEBUGALLOWUNSAFE_OFF("$2Unsafe actions disabled", "unsafe"),
//</editor-fold>
//<editor-fold desc="Debug">
DEBUG_HEADER("$1Debug Information&-", "Debug"),
DEBUG_SECTION("$2>> $1&l%val%", "Debug"),
DEBUG_LINE("$2>> $1%var%$2:$1 %val%&-", "Debug"),
//</editor-fold>
//<editor-fold desc="Invalid">
NOT_VALID_BLOCK("$2That's not a valid block: %s", "Invalid", "value"),
NOT_ALLOWED_BLOCK("$2That block is not allowed: %s", "Invalid", "value"),
NOT_VALID_NUMBER("$2That's not a valid number within the range: %s", "Invalid", "min", "max"),
NOT_VALID_PLOT_ID("$2That's not a valid plot id.", "Invalid"),
FOUND_NO_PLOTS("$2Found no plots with your search query", "Invalid"),
NUMBER_NOT_IN_RANGE("That's not a valid number within the range: (%s, %s)", "Invalid"),
NUMBER_NOT_POSITIVE("That's not a positive number: %s", "Invalid", "value"),
NOT_A_NUMBER("%s is not a valid number.", "Invalid", "value"),
//</editor-fold>
//<editor-fold desc="Need">
NEED_BLOCK("$2You've got to specify a block", "Need"),
//</editor-fold>
//<editor-fold desc="Near">
PLOT_NEAR("$1Players: %s0", "Near", "list"),
//</editor-fold>
//<editor-fold desc="Info">
NONE(" None", "Info"),
NOW("Now", "Info"),
NEVER("Never", "Info"),
UNKNOWN("Unknown", "Info"),
SERVER("Server", "Info"),
EVERYONE("Everyone", "Info"),
PLOT_UNOWNED("$2The current plot must have an owner to perform this action", "Info"),
PLOT_INFO_UNCLAIMED("$2Plot $1%s$2 is not yet claimed", "Info", "plot"),
PLOT_INFO_HEADER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
PLOT_INFO_HIDDEN("$2You cannot view the information about this plot", "Info"),
PLOT_INFO_FORMAT("$1ID: $2%id%$1&-" + "$1Area: $2%area%$1&-"
+"$1Alias:$2%alias%$1&-" + "$1Owner:$2%owner%$1&-"
+ "$1Biome: $2%biome%$1&-" + "$1Can Build: $2%build%$1&-" + "$1Rating: $2%rating%&-"
+ "$1Seen: $2%seen%&-" + "$1Trusted:$2%trusted%$1&-" + "$1Members:$2%members%$1&-"
+ "$1Denied:$2%denied%$1&-" + "$1Flags:$2%flags%&-$1Description: $2%desc%$1", "Info"),
PLOT_INFO_FOOTER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
PLOT_INFO_TRUSTED("$1Trusted:$2%trusted%", "Info"),
PLOT_INFO_MEMBERS("$1Members:$2%members%", "Info"),
PLOT_INFO_DENIED("$1Denied:$2%denied%", "Info"),
PLOT_INFO_FLAGS("$1Flags:$2 %flags%", "Info"),
PLOT_INFO_BIOME("$1Biome:$2 %biome%", "Info"),
PLOT_INFO_RATING("$1Rating:$2 %rating%", "Info"),
PLOT_INFO_LIKES("$1Like Ratio:$2 %likes%%", "Info"),
PLOT_INFO_OWNER("$1Owner:$2%owner%", "Info"),
PLOT_INFO_ID("$1ID:$2 %id%", "Info"),
PLOT_INFO_ALIAS("$1Alias:$2 %alias%", "Info"),
PLOT_INFO_SIZE("$1Size:$2 %size%", "Info"),
PLOT_INFO_SEEN("$1Seen:$2 %seen%", "Info"),
PLOT_USER_LIST(" $1%user%$2,", "Info"),
PLOT_FLAG_LIST("$2%s0:%s1$3", "Info", "flag", "value"),
PLOT_NO_DESCRIPTION("No description set.", "Info"),
INFO_SYNTAX_CONSOLE("$2/plot info X;Z", "Info"),
//</editor-fold>
//<editor-fold desc="Working">
GENERATING_COMPONENT("$1Started generating component from your settings", "Working"),
CLEARING_DONE("$4Clear completed! Took %sms.", "Working", "amount"),
DELETING_DONE("$4Delete completed! Took %sms.", "Working", "amount"),
PLOT_NOT_CLAIMED("$2Plot not claimed", "Working"),
PLOT_IS_CLAIMED("$2This plot is already claimed", "Working"),
CLAIMED("$4You successfully claimed the plot", "Working"),
//</editor-fold>
//<editor-fold desc="List">
COMMENT_LIST_HEADER_PAGED("$2(Page $1%cur$2/$1%max$2) $1List of %amount% comments", "List"),
CLICKABLE(" (interactive)", "List"),
AREA_LIST_HEADER_PAGED("$2(Page $1%cur$2/$1%max$2) $1List of %amount% areas", "List"),
PLOT_LIST_HEADER_PAGED("$2(Page $1%cur$2/$1%max$2) $1List of %amount% plots", "List"),
PLOT_LIST_HEADER("$1List of %word% plots", "List"),
//</editor-fold>
//<editor-fold desc="Chat">
PLOT_CHAT_SPY_FORMAT("$2[$1Plot Spy$2][$1%plot_id%$2] $1%sender%$2: $1%msg%", "Chat"),
PLOT_CHAT_FORMAT("$2[$1Plot Chat$2][$1%plot_id%$2] $1%sender%$2: $1%msg%", "Chat"),
PLOT_CHAT_FORCED("$2This world forces everyone to use plot chat.", "Chat"),
//</editor-fold>
//<editor-fold desc="Deny">
DENIED_ADDED("$4You successfully denied the player from this plot", "Deny"),
YOU_GOT_DENIED("$4You are denied from the plot you were previously on, and got teleported to spawn", "Deny"),
CANT_REMOVE_OWNER("$2You can't remove the plot owner", "Deny"),
//</editor-fold>
YOU_GOT_KICKED("$4You got kicked!", "Kick"),
//<editor-fold desc="Flag">
FLAG_KEY("$2Key: %s", "Flag", "key"),
FLAG_DESC("$2Desc: %s", "Flag", "value"),
NOT_VALID_FLAG("$2That is not a valid flag", "Flag"),
NOT_VALID_FLAG_SUGGESTED("$2That is not a valid flag. Did you mean: $1%s", "Flag", "value"),
NOT_VALID_VALUE("$2Flag values must be alphanumerical", "Flag"),
FLAG_NOT_REMOVED("$2The flag could not be removed", "Flag"),
FLAG_NOT_ADDED("$2The flag could not be added", "Flag"),
FLAG_REMOVED("$4Successfully removed flag", "Flag"),
FLAG_PARTIALLY_REMOVED("$4Successfully removed flag value(s)", "Flag"),
FLAG_ADDED("$4Successfully added flag", "Flag"),
FLAG_TUTORIAL_USAGE("$1Have an admin set the flag: $2%s", "CommandConfig", "flag"),
FLAG_LIST_SEE_INFO("Click to view information about the flag", "Flag"),
FLAG_PARSE_ERROR("$2Failed to parse flag '%flag_name%', value '%flag_value%': %error%", "Flag"),
//</editor-fold>
//<editor-fold desc="Flag">
FLAG_INFO_HEADER("$3&m---------&r $1Plot² Flags $3&m---------", false, "Flag"),
FLAG_INFO_FOOTER("$3&m---------&r $1Plot² Flags $3&m---------", false, "Flag"),
FLAG_INFO_COLOR_KEY("$1", "Flag"),
FLAG_INFO_COLOR_VALUE("$2", "Flag"),
FLAG_INFO_NAME("Name: ", "Flag"),
FLAG_INFO_CATEGORY("Category: ", "Flag"),
FLAG_INFO_DESCRIPTION("Description: ", "Flag"),
FLAG_INFO_EXAMPLE("Example: ", "Flag"),
FLAG_INFO_DEFAULT_VALUE("Default Value: ", "Flag"),
//</editor-fold>
//<editor-fold desc="Flag category captions">
FLAG_CATEGORY_STRING("String Flags", "Flags"),
FLAG_CATEGORY_INTEGERS("Integer Flags", "Flags"),
FLAG_CATEGORY_DOUBLES("Decimal Flags", "Flags"),
FLAG_CATEGORY_TELEPORT_DENY("Teleport Deny Flag", "Flags"),
FLAG_CATEGORY_STRING_LIST("String List Flags", "Flags"),
FLAG_CATEGORY_WEATHER("Weather Flags", "Flags"),
FLAG_CATEGORY_MUSIC("Music Flags", "Flags"),
FLAG_CATEGORY_BLOCK_LIST("Material Flags", "Flags"),
FLAG_CATEGORY_INTERVALS("Interval Flags", "Flags"),
FLAG_CATEGORY_INTEGER_LIST("Integer List Flags", "Flags"),
FLAG_CATEGORY_GAMEMODE("Game Mode Flags", "Flags"),
FLAG_CATEGORY_ENUM("Generic Enum Flags", "Flags"),
FLAG_CATEGORY_DECIMAL("Decimal Flags", "Flags"),
FLAG_CATEGORY_BOOLEAN("Boolean Flags", "Flags"),
FLAG_CATEGORY_FLY("Flight Flags", "Flags"),
FLAG_CATEGORY_MIXED("Mixed Value Flags", "Flags"),
//</editor-fold>
//<editor-fold desc="Flag descriptions">
FLAG_DESCRIPTION_ENTITY_CAP("Set to an integer value to limit the amount of entities on the plot.", "Flags"),
FLAG_DESCRIPTION_EXPLOSION("Set to `true` to enable explosions in the plot, and `false` to disable them.", "Flags"),
FLAG_DESCRIPTION_MUSIC("Set to a music disk ID (item name) to play the music disc inside of the plot.", "Flags"),
FLAG_DESCRIPTION_FLIGHT("Set to `true` to enable flight within the plot when in survival or adventure mode,"
+ " set to `default` to use the gamemode default, and `false` to disable flight entirely.", "Flags"),
FLAG_DESCRIPTION_UNTRUSTED("Set to `false` to disallow untrusted players from visiting the plot.", "Flags"),
FLAG_DESCRIPTION_DENY_EXIT("Set to `true` to disallow players from exiting the plot.", "Flags"),
FLAG_DESCRIPTION_CHAT("Set to `false` to prevent plot chat on the plot.", "Flags"),
FLAG_DESCRIPTION_DESCRIPTION("Plot description. Supports '&' color codes.", "Flags"),
FLAG_DESCRIPTION_GREETING("Message sent to players on plot entry. Supports '&' color codes.", "Flags"),
FLAG_DESCRIPTION_FAREWELL("Message sent to players when leaving the plot. Supports '&' color codes.", "Flags"),
FLAG_DESCRIPTION_WEATHER("Specifies the weather conditions inside of the plot.", "Flags"),
FLAG_DESCRIPTION_ANIMAL_ATTACK("Set to `true` to allow animals to be attacked in the plot.", "Flags"),
FLAG_DESCRIPTION_ANIMAL_CAP("Set to an integer value to limit the amount of animals on the plot.", "Flags"),
FLAG_DESCRIPTION_ANIMAL_INTERACT("Set to `true` to allow animals to be interacted with in the plot.", "Flags"),
FLAG_DESCRIPTION_BLOCK_BURN("Set to `true` to allow blocks to burn within the plot.", "Flags"),
FLAG_DESCRIPTION_BLOCK_IGNITION("Set to `false` to prevent blocks from igniting within the plot.", "Flags"),
FLAG_DESCRIPTION_BREAK("Define a list of materials players should be able to break even when they aren't added to the plot.", "Flags"),
FLAG_DESCRIPTION_DEVICE_INTERACT("Set to `true` to allow devices to be interacted with in the plot.", "Flags"),
FLAG_DESCRIPTION_DISABLE_PHYSICS("Set to `true` to disable block physics in the plot.", "Flags"),
FLAG_DESCRIPTION_DROP_PROTECTION("Set to `true` to prevent dropped items from being picked up by non-members of the plot.", "Flags"),
FLAG_DESCRIPTION_FEED("Specify an interval in seconds and an optional amount by which the players will be fed (amount is 1 by default).", "Flags"),
FLAG_DESCRIPTION_FORCEFIELD("Set to `true` to enable member forcefield in the plot.", "Flags"),
FLAG_DESCRIPTION_GRASS_GROW("Set to `false` to prevent grass from growing within the plot.", "Flags"),
FLAG_DESCRIPTION_HANGING_BREAK("Set to `true` to allow guests to break hanging objects in the plot.", "Flags"),
FLAG_DESCRIPTION_HANGING_PLACE("Set to `true` to allow guests to hang objects in the plot.", "Flags"),
FLAG_DESCRIPTION_HEAL("Specify an interval in seconds and an optional amount by which the players will be healed (amount is 1 by default).", "Flags"),
FLAG_DESCRIPTION_HIDE_INFO("Set to `true` to hide plot information.", "Flags"),
FLAG_DESCRIPTION_HOSTILE_ATTACK("Set to `true` to enable players to attack hostile mobs in the plot.", "Flags"),
FLAG_DESCRIPTION_HOSTILE_CAP("Set to an integer value to limit the amount of hostile entities on the plot.", "Flags"),
FLAG_DESCRIPTION_HOSTILE_INTERACT("Set to `true` to allow players to interact with hostile mobs in the plot.", "Flags"),
FLAG_DESCRIPTION_ICE_FORM("Set to `true` to allow ice to form in the plot.", "Flags"),
FLAG_DESCRIPTION_ICE_MELT("Set to `false` to disable ice melting in the plot.", "Flags"),
FLAG_DESCRIPTION_INSTABREAK("Set to `true` to allow blocks to be instantaneously broken in survival mode.", "Flags"),
FLAG_DESCRIPTION_INVINCIBLE("Set to `true` to prevent players from taking damage inside of the plot.", "Flags"),
FLAG_DESCRIPTION_ITEM_DROP("Set to `false` to prevent items from being dropped inside of the plot.", "Flags"),
FLAG_DESCRIPTION_KELP_GROW("Set to `false` to prevent kelp from growing in the plot.", "Flags"),
FLAG_DESCRIPTION_LIQUID_FLOW("Set to `false` to disable liquids from flowing within the plot.", "Flags"),
FLAG_DESCRIPTION_MISC_BREAK("Set to `true` to allow guests to break miscellaneous items.", "Flags"),
FLAG_DESCRIPTION_MISC_CAP("Set to an integer value to limit the amount of miscellaneous entities on the plot.", "Flags"),
FLAG_DESCRIPTION_MISC_INTERACT("Set to `true` to allow guests to interact with miscellaneous items.", "Flags"),
FLAG_DESCRIPTION_MISC_PLACE("Set to `true` to allow guests to place miscellaneous items.", "Flags"),
FLAG_DESCRIPTION_MOB_BREAK("Set to `true` to allow mobs to break blocks within the plot.", "Flags"),
FLAG_DESCRIPTION_MOB_CAP("Set to an integer value to limit the amount of mobs on the plot.", "Flags"),
FLAG_DESCRIPTION_MOB_PLACE("Set to `true` to allow mobs to place blocks within the plot.", "Flags"),
FLAG_DESCRIPTION_MYCEL_GROW("Set to `false` to prevent mycelium from growing in the plot.", "Flags"),
FLAG_DESCRIPTION_NOTIFY_ENTER("Set to `true` to notify the plot owners when someone enters the plot.", "Flags"),
FLAG_DESCRIPTION_NOTIFY_LEAVE("Set to `true` to notify the plot owners when someone leaves the plot.", "Flags"),
FLAG_DESCRIPTION_NO_WORLDEDIT("Set to `true` to disable WorldEdit usage within the plot.", "Flags"),
FLAG_DESCRIPTION_PLACE("Define a list of materials players should be able to place in the plot.", "Flags"),
FLAG_DESCRIPTION_PLAYER_INTERACT("Set to `true` to allow guests to interact with players in the plot.", "Flags"),
FLAG_DESCRIPTION_PRICE("Set a price for a plot. Must be a positive decimal number.", "Flags"),
FLAG_DESCRIPTION_PVE("Set to `true` to enable PVE inside the plot.", "Flags"),
FLAG_DESCRIPTION_PVP("Set to `true` to enable PVP inside the plot.", "Flags"),
FLAG_DESCRIPTION_REDSTONE("Set to `false` to disable redstone in the plot.", "Flags"),
FLAG_DESCRIPTION_SERVER_PLOT("Set to `true` to turn the plot into a server plot. This is equivalent to setting the server as the plot owner.", "Flags"),
FLAG_DESCRIPTION_SNOW_FORM("Set to `true` to allow snow to form within the plot.", "Flags"),
FLAG_DESCRIPTION_SNOW_MELT("Set to `true` to allow snow to melt within the plot.", "Flags"),
FLAG_DESCRIPTION_SOIL_DRY("Set to `true` to allow soil to dry within the plot.", "Flags"),
FLAG_DESCRIPTION_CORAL_DRY("Set to `true` to allow coral blocks to dry within the plot.", "Flags"),
FLAG_DESCRIPTION_TAMED_ATTACK("Set to `true` to allow guests to attack tamed animals in the plot.", "Flags"),
FLAG_DESCRIPTION_TAMED_INTERACT("Set to `true` to allow guests to interact with tamed animals in the plot.", "Flags"),
FLAG_DESCRIPTION_TIME("Set the time in the plot to a fixed value.", "Flags"),
FLAG_DESCRIPTION_TITLES("Set to `false` to disable plot titles. Can be set to: `none` (to inherit world settings), `true`, or `false`", "Flags"),
FLAG_DESCRIPTION_USE("Define a list of materials players should be able to interact with in the plot.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_BREAK("Set to `true` to allow guests to break vehicles in the plot.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_CAP("Set to an integer value to limit the amount of vehicles on the plot.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_PLACE("Set to `true` to allow guests to place vehicles in the plot.", "Flags"),
FLAG_DESCRIPTION_VEHICLE_USE("Set to `true` to allow guests to use vehicles in the plot.", "Flags"),
FLAG_DESCRIPTION_VILLAGER_INTERACT("Set to `true` to allow guests to interact with villagers in the plot.", "Flags"),
FLAG_DESCRIPTION_VINE_GROW("Set to `false` to prevent vines from growing within the plot.", "Flags"),
FLAG_DESCRIPTION_DENY_TELEPORT("Deny a certain group from teleporting to the plot. Available groups: members, nonmembers, trusted, nontrusted, nonowners", "Flags"),
FLAG_DESCRIPTION_GAMEMODE("Determines the gamemode in the plot.", "Flags"),
FLAG_DESCRIPTION_GUEST_GAMEMODE("Determines the guest gamemode in the plot.", "Flags"),
FLAG_DESCRIPTION_BLOCKED_CMDS("A list of commands that are blocked in the plot.", "Flags"),
FLAG_DESCRIPTION_KEEP("Prevents the plot from expiring. Can be set to: true, false, the number of milliseconds to keep the plot for or a timestamp (3w 2d 5h).", "Flags"),
FLAG_DESCRIPTION_KEEP_INVENTORY("Prevents players from dropping their items when they die inside of the plot.", "Flags"),
FLAG_DESCRIPTION_PREVENT_CREATIVE_COPY("Prevents people from copying item NBT data in the plot unless they're added as members.", "Flags"),
//</editor-fold>
//<editor-fold desc="Flag category errors">
FLAG_ERROR_BOOLEAN("Flag value must be a boolean (true|false)", false, "Flags"),
FLAG_ERROR_ENUM("Must be one of: %s", false, "Flags", "list"),
FLAG_ERROR_GAMEMODE("Flag value must be a gamemode: 'survival', 'creative', 'adventure' or 'spectator.", false, "Flags"),
FLAG_ERROR_INTEGER("Flag value must be a whole number", false, "Flags"),
FLAG_ERROR_INTEGER_LIST("Flag value must be an integer list", false, "Flags"),
FLAG_ERROR_INTERVAL("Value(s) must be numeric. /plot set flag <flag> <interval> [amount]", false, "Flags"),
FLAG_ERROR_KEEP("Flag value must be a timestamp or a boolean", false, "Flags"),
FLAG_ERROR_LONG("Flag value must be a whole number (large numbers allowed)", false, "Flags"),
FLAG_ERROR_PLOTBLOCKLIST("Flag value must be a block list", false, "Flags"),
FLAG_ERROR_INVALID_BLOCK("The provided value is not a valid block or block category", false, "Flags"),
FLAG_ERROR_DOUBLE("Flag value must be a decimal number.", false, "Flags"),
FLAG_ERROR_STRING("Flag value must be alphanumeric. Some special characters are allowed.", false, "Flags"),
FLAG_ERROR_STRINGLIST("Flag value must be a string list", false, "Flags"),
FLAG_ERROR_WEATHER("Flag must be a weather: 'rain' or 'sun'", false, "Flags"),
FLAG_ERROR_MUSIC("Flag value must be a valid music disc ID.", false, "Flags"),
//</editor-fold>
//<editor-fold desc="Trusted">
TRUSTED_ADDED("$4You successfully trusted a user to the plot", "Trusted"),
PLOT_REMOVED_USER("$1Plot %s of which you were added to has been deleted due to owner inactivity", "Trusted", "plot"),
//</editor-fold>
//<editor-fold desc="Member">
REMOVED_PLAYERS("$2Removed %s player(s) from this plot.", "Member", "amount"),
PLOT_LEFT("$2%s left the plot.", "Member", "player"),
ALREADY_OWNER("$2That user is already the plot owner: %s0", "Member", "player"),
ALREADY_ADDED("$2That user is already added to that category: %s0", "Member"),
MEMBER_ADDED("$4That user can now build while the plot owner is online", "Member"),
PLOT_MAX_MEMBERS("$2You are not allowed to add any more players to this plot", "Member"),
NOT_ADDED_TRUSTED("$2You must be added or trusted to the plot to run that command", "Member"),
//</editor-fold>
//<editor-fold desc="Set Owner">
SET_OWNER("$4You successfully set the plot owner", "Owner"),
SET_OWNER_CANCELLED("$2The set owner action was cancelled", "Owner"),
SET_OWNER_MISSING_PLAYER("$1You need to specify a new owner. Correct usage is: $2/plot setowner <owner>", "Owner"),
NOW_OWNER("$4You are now owner of plot %s", "Owner", "plot"),
//</editor-fold>
//<editor-fold desc="Signs">
OWNER_SIGN_LINE_1("$1ID: $1%id%", "Signs"),
OWNER_SIGN_LINE_2("$1Owner:", "Signs"),
OWNER_SIGN_LINE_3("$2%plr%", "Signs"),
OWNER_SIGN_LINE_4("$3Claimed", "Signs"),
//</editor-fold>
//<editor-fold desc="Help">
HELP_HEADER("$3&m---------&r $1Plot² Help $3&m---------", "Help"),
HELP_PAGE_HEADER("$1Category: $2%category%$2,$1 Page: $2%current%$3/$2%max%$2", "Help"),
HELP_FOOTER("$3&m---------&r $1Plot² Help $3&m---------", "Help"),
HELP_INFO_ITEM("$1/plot help %category% $3- $2%category_desc%", "Help"),
HELP_ITEM("$1%usage% [%alias%]&- $3- $2%desc%&-", "Help"),
HELP_DISPLAY_ALL_COMMANDS("Display all commands", "Help"),
DIRECTION("$1Current direction: %dir%", "Help"),
//</editor-fold>
//<editor-fold desc="Command Categories">
COMMAND_CATEGORY_CLAIMING("Claiming", "Category"),
COMMAND_CATEGORY_TELEPORT("Teleport", "Category"),
COMMAND_CATEGORY_SETTINGS("Protection", "Category"),
COMMAND_CATEGORY_CHAT("Chat", "Category"),
COMMAND_CATEGORY_SCHEMATIC("Web", "Category"),
COMMAND_CATEGORY_APPEARANCE("Cosmetic", "Category"),
COMMAND_CATEGORY_INFO("Info", "Category"),
COMMAND_CATEGORY_DEBUG("Debug", "Category"),
COMMAND_CATEGORY_ADMINISTRATION("Admin", "Category"),
//</editor-fold>
//<editor-fold desc="Grants">
GRANTED_PLOTS("$1Result: $2%s $1grants left", "Grants", "amount"),
GRANTED_PLOT("$1You granted %s0 plot to $2%s1", "Grants"),
//</editor-fold>
//<editor-fold desc="Events">
EVENT_DENIED("$1%s $2Cancelled by external plugin.", "Events", "value"),
//</editor-fold>
//<editor-fold desc="Caps">
PLOT_CAPS_HEADER("$3&m---------&r $1CAPS $3&m---------", false, "Info"),
PLOT_CAPS_FORMAT("$2- Cap Type: $1%cap% $2| Status: $1%current%$2/$1%limit% $2($1%percentage%%$2)",
false, "Info"),
//</editor-fold>
//<editor-fold desc="Backups">
BACKUP_USAGE("$1Usage: $2/plot backup save/list/load", "Backups"),
BACKUP_IMPOSSIBLE("$2Backups are not enabled for this plot: %s", "Backups", "plot"),
BACKUP_SAVE_SUCCESS("$1The backup was created successfully", "Backups"),
BACKUP_SAVE_FAILED("$2The backup could not be created: %s", "Backups", "reason"),
BACKUP_LOAD_SUCCESS("$1The backup was restored successfully", "Backups"),
BACKUP_LOAD_FAILURE("$2The backup could not be restored: %s", "Backups"),
BACKUP_LOAD_USAGE("$1Usage: $2/plot backup load [#]", "Backups"),
BACKUP_LIST_HEADER("$1Available backups for plot $2%s", "Backups", "plot"),
BACKUP_LIST_ENTRY("$3- $1#%s0 $2%s1", "Backups", "number", "value"),
BACKUP_LIST_FAILED("$2Backup listing failed: %s", "Backups", "reason"),
BACKUP_AUTOMATIC_STARTED("$1Backing up the plot...", "Backups"),
BACKUP_AUTOMATIC_FINISHED("$1The automatic backup process finished successfully!", "Backups"),
BACKUP_AUTOMATIC_FAILURE("$2The automatic backup process failed. Your pending action has been canceled. Reason: %s", "Backups", "reason"),
//</editor-fold>
//<editor-fold desc="Preset">
PRESET_CANNOT_AFFORD("$2You cannot afford that preset", "Preset"),
PRESET_INVALID("$2Could not generate a pattern from that preset", "Preset"),
PRESET_LORE_COST("$2Cost: $1%cost%", "Preset"),
PRESET_LORE_COMPONENT("$2Component: $1%component%", "Preset"),
//</editor-fold>
//<editor-fold desc="Generic">
GENERIC_OTHER("other", "Generic"),
GENERIC_MERGED("merged", "Generic"),
GENERIC_UNOWNED("unowned", "Generic"),
GENERIC_INVALID_CHOICE("invalid choice", "Generic"),
//</editor-fold>
//<editor-fold des="Single area">
SINGLE_AREA_MISSING_SELECTION("$2Error! You need to select a square region", "Single"),
SINGLE_AREA_NOT_SQUARE("$2Error! Your selection needs to be a square", "Single"),
SINGLE_AREA_OVERLAPPING("$2Error! Your selection overlaps with an existing plot area", "Single"),
SINGLE_AREA_NEEDS_NAME("$2Error! Please specify a plot name: /plot area single <name>", "Single"),
SINGLE_AREA_NAME_TAKEN("$2Error! The plot name is already taken", "Single"),
SINGLE_AREA_FAILED_TO_SAVE("$2Error! Failed to save the area schematic", "Single"),
SINGLE_AREA_COULD_NOT_MAKE_DIRECTORIES("$2Error! Failed to create the schematic directory", "Single"),
SINGLE_AREA_CREATED("$1The area was created successfully!", "Single"),
//</editor-fold>
//<editor-fold desc="Debug">
PLOT_DEBUG("$2Plot Debug ($1%plot%$2): %message%", "Plot-Debug"),
//</editor-fold>
/**
* Legacy Configuration Conversion
*/
LEGACY_CONFIG_FOUND("A legacy configuration file was detected. Conversion will be attempted.",
"LegacyConfig"), LEGACY_CONFIG_BACKUP(
"A copy of worlds.yml $1have been saved in the file worlds.yml.old$1.",
"LegacyConfig"), LEGACY_CONFIG_REPLACED("> %s has been replaced with %s",
"LegacyConfig"), LEGACY_CONFIG_DONE(
"The conversion has finished. PlotSquared will now be disabled and the new configuration file will"
+ " be used at next startup. Please review the new worlds.yml file. "
+ "Please note that schematics will not be converted, as we are now using WorldEdit to handle schematics. "
+ "You need to re-generate the schematics.",
"LegacyConfig"), LEGACY_CONFIG_CONVERSION_FAILED(
"Failed to convert the legacy configuration file. See stack trace for information.",
"LegacyConfig"),
CUSTOM_STRING("-", "-");
//@formatter:on
private final String text;
Captions(@Nonnull final String text) {
this.text = text;
}
Captions(@Nonnull final String text, @Nonnull final String... s) {
// TODO: REMOVE!!!
this.text = text;
}
Captions(@Nonnull final String text, final boolean b, @Nonnull final String s) {
// TODO: REMOVE!!!
this.text = text;
}
Captions(@Nonnull final String text, final boolean b, @Nonnull final String s, @Nonnull final String s1) {
// TODO: REMOVE!!!
this.text = text;
}
@Override public String toString() {
return this.text;
}
}

View File

@ -8,7 +8,7 @@
* | | * | |
* |_| * |_|
* PlotSquared plot management system for Minecraft * PlotSquared plot management system for Minecraft
* Copyright (C) 2020 IntellectualSites * Copyright (C) ${year} IntellectualSites
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -27,6 +27,7 @@ package com.plotsquared.core.configuration.caption;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
/** /**
* Map containing mappings between {@link TranslatableCaption captions} and * Map containing mappings between {@link TranslatableCaption captions} and
@ -68,6 +69,13 @@ public interface CaptionMap {
*/ */
@Nonnull Locale getLocale(); @Nonnull Locale getLocale();
/**
* Gets a copy of the map of captions stored in the CaptionMap
*
* @return ImmutableMap of TranslatableCaption, String captionMap
*/
@Nonnull Map<TranslatableCaption, String> getCaptions();
class NoSuchCaptionException extends IllegalArgumentException { class NoSuchCaptionException extends IllegalArgumentException {
public NoSuchCaptionException(@Nonnull final NamespacedCaption caption) { public NoSuchCaptionException(@Nonnull final NamespacedCaption caption) {

View File

@ -26,7 +26,9 @@
package com.plotsquared.core.configuration.caption; package com.plotsquared.core.configuration.caption;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
/** /**
* {@link CaptionMap} implementation that throws exception on all getters * {@link CaptionMap} implementation that throws exception on all getters
@ -51,4 +53,8 @@ public class DummyCaptionMap implements CaptionMap {
throw new UnsupportedOperationException("Cannot get locale of DummyCaptionMap"); throw new UnsupportedOperationException("Cannot get locale of DummyCaptionMap");
} }
@Nonnull @Override public Map<TranslatableCaption, String> getCaptions() {
return new HashMap<>();
}
} }

View File

@ -25,6 +25,8 @@
*/ */
package com.plotsquared.core.configuration.caption; package com.plotsquared.core.configuration.caption;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@ -56,4 +58,8 @@ public class LocalizedCaptionMap implements CaptionMap {
return this.locale; return this.locale;
} }
@Nonnull @Override public Map<TranslatableCaption, String> getCaptions() {
return ImmutableMap.copyOf(captions);
}
} }

View File

@ -26,7 +26,7 @@
package com.plotsquared.core.listener; package com.plotsquared.core.listener;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
@ -323,7 +323,7 @@ public class PlotListener {
try (final MetaDataAccess<Boolean> kickAccess = try (final MetaDataAccess<Boolean> kickAccess =
player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) { player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
if (plot.getFlag(DenyExitFlag.class) && !Permissions if (plot.getFlag(DenyExitFlag.class) && !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_EXIT_DENIED) && .hasPermission(player, Permission.PERMISSION_ADMIN_EXIT_DENIED) &&
!kickAccess.get().orElse(false)) { !kickAccess.get().orElse(false)) {
if (previous != null) { if (previous != null) {
lastPlot.set(previous); lastPlot.set(previous);

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.listener;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;

View File

@ -0,0 +1,179 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) ${year} IntellectualSites
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.plotsquared.core.permissions;
import javax.annotation.Nonnull;
/**
* Captions class.
*/
public enum Permission {
//@formatter:off
//<editor-fold desc="Static Permission">
PERMISSION_STAR("*"),
PERMISSION_ADMIN("plots.admin"),
PERMISSION_ADMIN_SUDO_AREA("plots.admin.area.sudo"),
PERMISSION_PROJECTILE_UNOWNED("plots.projectile.unowned"),
PERMISSION_PROJECTILE_OTHER("plots.projectile.other"),
PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS("plots.admin.interact.blockedcommands"),
PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass"),
PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles"),
PERMISSION_PLOT_TOGGLE_CHAT("plots.toggle.chat"),
PERMISSION_PLOT_TOGGLE_TIME("plots.toggle.time"),
PERMISSION_ADMIN_UPDATE_NOTIFICATION("plots.admin.update.notify"),
PERMISSION_ADMIN_EXIT_DENIED("plots.admin.exit.denied"),
PERMISSION_ADMIN_ENTRY_DENIED("plots.admin.entry.denied"),
PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted"),
PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield"),
PERMISSION_COMMANDS_CHAT("plots.admin.command.chat"),
PERMISSION_MERGE_OTHER("plots.merge.other"),
PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad"),
PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other"),
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_BUILD_ROAD("plots.admin.build.road"),
PERMISSION_ADMIN_BUILD_UNOWNED("plots.admin.build.unowned"),
PERMISSION_ADMIN_BUILD_OTHER("plots.admin.build.other"),
PERMISSION_ADMIN_INTERACT_ROAD("plots.admin.interact.road"),
PERMISSION_ADMIN_INTERACT_UNOWNED("plots.admin.interact.unowned"),
PERMISSION_ADMIN_INTERACT_OTHER("plots.admin.interact.other"),
PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT("plots.admin.build.heightlimit"),
PERMISSION_ADMIN_UPDATE("plots.admin.command.update"),
PERMISSION_ADMIN_COMMAND_RATE("plots.admin.command.rate"),
PERMISSION_ADMIN_COMMAND_TRUST("plots.admin.command.trust"),
PERMISSION_TRUST_EVERYONE("plots.trust.everyone"),
PERMISSION_AREA_CREATE("plots.area.create"),
PERMISSION_AREA_INFO("plots.area.info"),
PERMISSION_AREA_INFO_FORCE("plots.admin.info.force"),
PERMISSION_AREA_LIST("plots.area.list"),
PERMISSION_AREA_REGEN("plots.area.regen"),
PERMISSION_AREA_TP("plots.area.tp"),
PERMISSION_AUTO_MEGA("plots.auto.mega"),
PERMISSION_CLAIM_SCHEMATIC("plots.claim.%s0"),
PERMISSION_ADMIN_COMMAND_SCHEMATIC("plots.admin.command.schematic"),
PERMISSION_ADMIN_COMMAND_CLEAR("plots.admin.command.clear"),
PERMISSION_CONTINUE("plots.continue"),
PERMISSION_CLUSTER_LIST("plots.cluster.list"),
PERMISSION_CLUSTER_CREATE("plots.cluster.create"),
PERMISSION_CLUSTER_CREATE_OTHER("plots.cluster.create.other"),
PERMISSION_CLUSTER_SIZE("plots.cluster.size"),
PERMISSION_CLUSTER_DELETE("plots.cluster.delete"),
PERMISSION_CLUSTER_DELETE_OTHER("plots.cluster.delete.other"),
PERMISSION_CLUSTER_RESIZE("plots.cluster.resize"),
PERMISSION_CLUSTER_RESIZE_OTHER("plots.cluster.resize.other"),
PERMISSION_CLUSTER_RESIZE_SHRINK("plots.cluster.resize.shrink"),
PERMISSION_CLUSTER_RESIZE_EXPAND("plots.cluster.resize.expand"),
PERMISSION_CLUSTER("plots.cluster"),
PERMISSION_CLUSTER_INVITE("plots.cluster.invite"),
PERMISSION_CLUSTER_INVITE_OTHER("plots.cluster.invite.other"),
PERMISSION_CLUSTER_KICK("plots.cluster.kick"),
PERMISSION_CLUSTER_KICK_OTHER("plots.cluster.kick.other"),
PERMISSION_CLUSTER_LEAVE("plots.cluster.leave"),
PERMISSION_CLUSTER_HELPERS("plots.cluster.helpers"),
PERMISSION_CLUSTER_TP("plots.cluster.tp"),
PERMISSION_CLUSTER_TP_OTHER("plots.cluster.tp.other"),
PERMISSION_CLUSTER_INFO("plots.cluster.info"),
PERMISSION_CLUSTER_SETHOME("plots.cluster.sethome"),
PERMISSION_CLUSTER_SETHOME_OTHER("plots.cluster.sethome.other"),
PERMISSION_ADMIN_COMMAND_CONTINUE("plots.admin.command.continue"),
PERMISSION_ADMIN_COMMAND_DELETE("plots.admin.command.delete"),
PERMISSION_ADMIN_COMMAND_DENY("plots.admin.command.deny"),
PERMISSION_DENY_EVERYONE("plots.deny.everyone"),
PERMISSION_ADMIN_COMMAND_DONE("plots.admin.command.done"),
PERMISSION_ADMIN_COMMAND_DOWNLOAD("plots.admin.command.download"),
PERMISSION_DOWNLOAD_WORLD("plots.download.world"),
PERMISSION_SET_FLAG_OTHER("plots.set.flag.other"),
PERMISSION_SET_FLAG("plots.set.flag"),
PERMISSION_SET_FLAG_KEY("plots.set.flag.%s0"),
PERMISSION_SET_FLAG_KEY_VALUE("plots.set.flag.%s0.%s1"),
PERMISSION_FLAG_REMOVE("plots.flag.remove"),
PERMISSION_FLAG_ADD("plots.flag.add"),
PERMISSION_FLAG_LIST("plots.flag.list"),
PERMISSION_ADMIN_COMMAND_KICK("plots.admin.command.kick"),
PERMISSION_GRANT("plots.grant.%s0"),
PERMISSION_LIST_FOR_SALE("plots.list.forsale"),
PERMISSION_LIST_MINE("plots.list.mine"),
PERMISSION_LIST_SHARED("plots.list.shared"),
PERMISSION_LIST_WORLD("plots.list.world"),
PERMISSION_LIST_WORLD_NAME("plots.list.world.%s0"),
PERMISSION_LIST_TOP("plots.list.top"),
PERMISSION_LIST_ALL("plots.list.all"),
PERMISSION_LIST_UNOWNED("plots.list.unowned"),
PERMISSION_LIST_UNKNOWN("plots.list.unknown"),
PERMISSION_LIST_PLAYER("plots.list.player"),
PERMISSION_LIST_DONE("plots.list.done"),
PERMISSION_LIST_EXPIRED("plots.list.expired"),
PERMISSION_LIST_FUZZY("plots.list.fuzzy"),
PERMISSION_LIST_AREA("plots.list.area"),
PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load"),
PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge"),
PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner"),
PERMISSION_COMMENT("plots.comment"),
PERMISSION_ADMIN_COMMAND_REMOVE("plots.admin.command.remove"),
PERMISSION_ADMIN_COMMAND_SAVE("plots.admin.command.save"),
PERMISSION_ADMIN_COMMAND_SCHEMATIC_PASTE("plots.admin.command.schematic.paste"),
PERMISSION_SCHEMATIC_PASTE("plots.schematic.paste"),
PERMISSION_SCHEMATIC_LIST("plots.schematic.list"),
PERMISSION_SCHEMATIC_SAVE("plots.schematic.save"),
PERMISSION_ADMIN_COMMAND_SCHEMATIC_SAVE("plots.admin.command.schematic.save"),
PERMISSION_SET_COMPONENT("plots.set.%s0"),
PERMISSION_ADMIN_COMMAND("plots.admin.command.%s0"),
PERMISSION_ADMIN_COMMAND_UNLINK("plots.ad2min.command.unlink"),
PERMISSION_VISIT_UNOWNED("plots.visit.unowned"),
PERMISSION_VISIT_OWNED("plots.visit.owned"),
PERMISSION_SHARED("plots.visit.shared"),
PERMISSION_VISIT_OTHER("plots.visit.other"),
PERMISSION_HOME("plots.home"),
PERMISSION_ALIAS_SET_OBSOLETE("plots.set.alias"), // Note this is for backwards compatibility
PERMISSION_ALIAS_SET("plots.alias.set"),
PERMISSION_ADMIN_ALIAS_SET("plots.admin.alias.set"),
PERMISSION_ALIAS_REMOVE("plots.alias.remove"),
PERMISSION_ADMIN_ALIAS_REMOVE("plots.admin.alias.remove"),
PERMISSION_ADMIN_CHAT_BYPASS("plots.admin.chat.bypass"),
PERMISSION_BACKUP("plots.backup"),
PERMISSION_BACKUP_SAVE("plots.backup.save"),
PERMISSION_BACKUP_LIST("plots.backup.list"),
PERMISSION_BACKUP_LOAD("plots.backup.load"),
PERMISSION_ADMIN_BACKUP_OTHER("plots.admin.backup.other"),
PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe"),
PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other");
//</editor-fold>
private final String text;
Permission(@Nonnull final String text) {
this.text = text;
}
@Override public String toString() {
return this.text;
}
}

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.permissions; package com.plotsquared.core.permissions;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import javax.annotation.Nonnegative; import javax.annotation.Nonnegative;
@ -58,15 +57,15 @@ public interface PermissionHolder {
*/ */
@Nonnegative default int hasPermissionRange(@Nonnull final String stub, @Nonnegative default int hasPermissionRange(@Nonnull final String stub,
@Nonnegative final int range) { @Nonnegative final int range) {
if (hasPermission(Captions.PERMISSION_ADMIN.toString())) { if (hasPermission(Permission.PERMISSION_ADMIN.toString())) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
String[] nodes = stub.split("\\."); String[] nodes = stub.split("\\.");
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) { for (int i = 0; i < (nodes.length - 1); i++) {
builder.append(nodes[i]).append("."); builder.append(nodes[i]).append(".");
if (!stub.equals(builder + Captions.PERMISSION_STAR.toString())) { if (!stub.equals(builder + Permission.PERMISSION_STAR.toString())) {
if (hasPermission(builder + Captions.PERMISSION_STAR.toString())) { if (hasPermission(builder + Permission.PERMISSION_STAR.toString())) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
} }

View File

@ -31,7 +31,7 @@ import com.google.common.collect.Sets;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.command.Like; import com.plotsquared.core.command.Like;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.ConfigurationUtil; import com.plotsquared.core.configuration.ConfigurationUtil;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
@ -3010,7 +3010,7 @@ public class Plot {
Template plotTemplate = Template.of("plot", this.toString()); Template plotTemplate = Template.of("plot", this.toString());
Template messageTemplate = Template.of("message", message); Template messageTemplate = Template.of("message", message);
for (final PlotPlayer<?> player : players) { for (final PlotPlayer<?> player : players) {
if (isOwner(player.getUUID()) || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_DEBUG_OTHER)) { if (isOwner(player.getUUID()) || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_DEBUG_OTHER)) {
player.sendMessage(caption, plotTemplate, messageTemplate); player.sendMessage(caption, plotTemplate, messageTemplate);
} }
} }

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.plot; package com.plotsquared.core.plot;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.plot.comment;
import com.google.common.annotations.Beta; import com.google.common.annotations.Beta;
import com.google.inject.TypeLiteral; import com.google.inject.TypeLiteral;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.plot.flag;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Collection; import java.util.Collection;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.InternalFlag; import com.plotsquared.core.plot.flag.InternalFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.types.TimedFlag; import com.plotsquared.core.plot.flag.types.TimedFlag;

View File

@ -25,7 +25,6 @@
*/ */
package com.plotsquared.core.plot.flag.implementations; package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.PlotWeather; import com.plotsquared.core.plot.PlotWeather;
import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.PlotFlag;

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.plot.flag.types; package com.plotsquared.core.plot.flag.types;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.util.BlockUtil; import com.plotsquared.core.util.BlockUtil;

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.plot.flag.types; package com.plotsquared.core.plot.flag.types;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.PlotFlag;

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.plot.flag.types; package com.plotsquared.core.plot.flag.types;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.FlagParseException;

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.plot.flag.types; package com.plotsquared.core.plot.flag.types;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.util.StringMan; import com.plotsquared.core.util.StringMan;

View File

@ -27,7 +27,6 @@ package com.plotsquared.core.setup;
import com.plotsquared.core.command.Command; import com.plotsquared.core.command.Command;
import com.plotsquared.core.command.RequiredType; import com.plotsquared.core.command.RequiredType;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ConfigurationNode; import com.plotsquared.core.configuration.ConfigurationNode;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;

View File

@ -27,7 +27,7 @@ package com.plotsquared.core.util;
import com.google.common.eventbus.EventBus; import com.google.common.eventbus.EventBus;
import com.plotsquared.core.configuration.caption.CaptionUtility; import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlayerAutoPlotEvent; import com.plotsquared.core.events.PlayerAutoPlotEvent;
@ -281,11 +281,11 @@ public class EventDispatcher {
case INTERACT_BLOCK: { case INTERACT_BLOCK: {
if (plot == null) { if (plot == null) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms);
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms);
} }
final List<BlockTypeWrapper> use = plot.getFlag(UseFlag.class); final List<BlockTypeWrapper> use = plot.getFlag(UseFlag.class);
for (final BlockTypeWrapper blockTypeWrapper : use) { for (final BlockTypeWrapper blockTypeWrapper : use) {
@ -294,7 +294,7 @@ public class EventDispatcher {
return true; return true;
} }
} }
if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.toString(), false)) { if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), false)) {
return true; return true;
} }
if (notifyPerms) { if (notifyPerms) {
@ -306,11 +306,11 @@ public class EventDispatcher {
case TRIGGER_PHYSICAL: { case TRIGGER_PHYSICAL: {
if (plot == null) { if (plot == null) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.toString(), false); Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), false);
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), false); Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), false);
} }
if (plot.getFlag(DeviceInteractFlag.class)) { if (plot.getFlag(DeviceInteractFlag.class)) {
return true; return true;
@ -323,17 +323,17 @@ public class EventDispatcher {
} }
} }
return Permissions return Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.toString(), .hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(),
false); false);
} }
case SPAWN_MOB: { case SPAWN_MOB: {
if (plot == null) { if (plot == null) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms);
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms);
} }
if (plot.getFlag(MobPlaceFlag.class)) { if (plot.getFlag(MobPlaceFlag.class)) {
return true; return true;
@ -346,7 +346,7 @@ public class EventDispatcher {
} }
} }
if (Permissions if (Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.toString(), .hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(),
false)) { false)) {
return true; return true;
} }
@ -360,11 +360,11 @@ public class EventDispatcher {
case PLACE_MISC: { case PLACE_MISC: {
if (plot == null) { if (plot == null) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms);
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms);
} }
if (plot.getFlag(MiscPlaceFlag.class)) { if (plot.getFlag(MiscPlaceFlag.class)) {
return true; return true;
@ -377,7 +377,7 @@ public class EventDispatcher {
} }
} }
if (Permissions if (Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.toString(), .hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(),
false)) { false)) {
return true; return true;
} }
@ -391,11 +391,11 @@ public class EventDispatcher {
case PLACE_VEHICLE: case PLACE_VEHICLE:
if (plot == null) { if (plot == null) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms);
} }
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms); Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms);
} }
return plot.getFlag(VehiclePlaceFlag.class); return plot.getFlag(VehiclePlaceFlag.class);
default: default:

View File

@ -25,7 +25,7 @@
*/ */
package com.plotsquared.core.util; package com.plotsquared.core.util;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.permissions.PermissionHolder; import com.plotsquared.core.permissions.PermissionHolder;
@ -41,8 +41,8 @@ import javax.annotation.Nonnull;
*/ */
public class Permissions { public class Permissions {
public static boolean hasPermission(PlotPlayer<?> player, Captions caption, boolean notify) { public static boolean hasPermission(PlotPlayer<?> player, Permission permission, boolean notify) {
return hasPermission(player, caption.toString(), notify); return hasPermission(player, permission.toString(), notify);
} }
/** /**
@ -51,7 +51,7 @@ public class Permissions {
* @param permission Permission * @param permission Permission
* @return {@code true} if the owner has the given permission, else {@code false} * @return {@code true} if the owner has the given permission, else {@code false}
*/ */
public static boolean hasPermission(@Nonnull final PermissionHolder caller, @Nonnull final Captions permission) { public static boolean hasPermission(@Nonnull final PermissionHolder caller, @Nonnull final Permission permission) {
return caller.hasPermission(permission.toString()); return caller.hasPermission(permission.toString());
} }
@ -86,8 +86,8 @@ public class Permissions {
return true; return true;
} }
public static int hasPermissionRange(PlotPlayer<?> player, Captions perm, int range) { public static int hasPermissionRange(PlotPlayer<?> player, Permission Permission, int range) {
return hasPermissionRange(player, perm.toString(), range); return hasPermissionRange(player, Permission.toString(), range);
} }
/** /**

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.util; package com.plotsquared.core.util;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;