From 4fb590889ac3b5029ab21c8607c653cc623e6e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Fri, 24 Jul 2020 17:44:47 +0200 Subject: [PATCH] Remove all permission related errors --- .../core/configuration/Captions.java | 316 +++++++++--------- .../plotsquared/core/util/Permissions.java | 9 +- 2 files changed, 159 insertions(+), 166 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Captions.java b/Core/src/main/java/com/plotsquared/core/configuration/Captions.java index 37445ea69..ab38e6f6e 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Captions.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Captions.java @@ -25,175 +25,144 @@ */ package com.plotsquared.core.configuration; -import com.plotsquared.core.PlotSquared; -import com.plotsquared.core.configuration.caption.Caption; -import com.plotsquared.core.configuration.file.YamlConfiguration; -import com.plotsquared.core.util.StringMan; - -import java.io.File; -import java.io.IOException; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; +import javax.annotation.Nonnull; /** * Captions class. */ -public enum Captions implements Caption { +public enum Captions { //@formatter:off - // - FLAG_USE("use", "static.flags"), - FLAG_BREAK("break", "static.flags"), - FLAG_PLACE("place", "static.flags"), - FLAG_PVP("pvp", "static.flags"), - FLAG_HANGING_PLACE("hanging-place", "static.flags"), - FLAG_HANGING_BREAK("hanging-break", "static.flags"), - FLAG_MISC_INTERACT("misc-interact", "static.flags"), - FLAG_MISC_BREAK("misc-break", "static.flags"), - FLAG_MISC_PLACE("misc-place", "static.flags"), - FLAG_VEHICLE_BREAK("vehicle-break", "static.flags"), - FLAG_HOSTILE_INTERACT("hostile-interact", "static.flags"), - FLAG_DEVICE_INTERACT("device-interact", "static.flags"), - FLAG_ANIMAL_INTERACT("animal-interact", "static.flags"), - FLAG_VEHICLE_USE("vehicle-use", "static.flags"), - FLAG_VEHICLE_PLACE("vehicle-place", "static.flags"), - FLAG_PLAYER_INTERACT("player-interact", "static.flags"), - FLAG_TAMED_INTERACT("tamed-interact", "static.flags"), - FLAG_DISABLE_PHYSICS("disable-physics", "static.flags"), - FLAG_MOB_PLACE("mob-place", "static.flags"), - // // - PERMISSION_STAR("*", "static.permissions"), - PERMISSION_ADMIN("plots.admin", "static.permissions"), - PERMISSION_ADMIN_SUDO_AREA("plots.admin.area.sudo", "static.permissions"), - PERMISSION_PROJECTILE_UNOWNED("plots.projectile.unowned", "static.permissions"), - PERMISSION_PROJECTILE_OTHER("plots.projectile.other", "static.permissions"), - PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS("plots.admin.interact.blockedcommands", "static.permissions"), - PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass", "static.permissions"), - PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles", "static.permissions"), - PERMISSION_PLOT_TOGGLE_CHAT("plots.toggle.chat", "static.permissions"), - PERMISSION_PLOT_TOGGLE_TIME("plots.toggle.time", "static.permissions"), - PERMISSION_ADMIN_UPDATE_NOTIFICATION("plots.admin.update.notify", "static.permissions"), - PERMISSION_ADMIN_EXIT_DENIED("plots.admin.exit.denied", "static.permissions"), - PERMISSION_ADMIN_ENTRY_DENIED("plots.admin.entry.denied", "static.permissions"), - PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted", "static.permissions"), - PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield", "static.permissions"), - PERMISSION_COMMANDS_CHAT("plots.admin.command.chat", "static.permissions"), - PERMISSION_MERGE_OTHER("plots.merge.other", "static.permissions"), - PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad", "static.permissions"), - PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other", "static.permissions"), - PERMISSION_ADMIN_DESTROY_UNOWNED("plots.admin.destroy.unowned", "static.permissions"), - PERMISSION_ADMIN_DESTROY_GROUNDLEVEL("plots.admin.destroy.groundlevel", "static.permissions"), - PERMISSION_ADMIN_DESTROY_OTHER("plots.admin.destroy.other", "static.permissions"), - PERMISSION_ADMIN_DESTROY_ROAD("plots.admin.destroy.road", "static.permissions"), - PERMISSION_ADMIN_BUILD_ROAD("plots.admin.build.road", "static.permissions"), - PERMISSION_ADMIN_BUILD_UNOWNED("plots.admin.build.unowned", "static.permissions"), - PERMISSION_ADMIN_BUILD_OTHER("plots.admin.build.other", "static.permissions"), - PERMISSION_ADMIN_INTERACT_ROAD("plots.admin.interact.road", "static.permissions"), - PERMISSION_ADMIN_INTERACT_UNOWNED("plots.admin.interact.unowned", "static.permissions"), - PERMISSION_ADMIN_INTERACT_OTHER("plots.admin.interact.other", "static.permissions"), - PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT("plots.admin.build.heightlimit", "static.permissions"), - PERMISSION_ADMIN_UPDATE("plots.admin.command.update", "static.permissions"), - PERMISSION_ADMIN_COMMAND_RATE("plots.admin.command.rate", "static.permissions"), - PERMISSION_ADMIN_COMMAND_TRUST("plots.admin.command.trust", "static.permissions"), - PERMISSION_TRUST_EVERYONE("plots.trust.everyone", "static.permissions"), - PERMISSION_AREA_CREATE("plots.area.create", "static.permissions"), + 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", "static.permissions"), - PERMISSION_AREA_LIST("plots.area.list", "static.permissions"), - PERMISSION_AREA_REGEN("plots.area.regen", "static.permissions"), - PERMISSION_AREA_TP("plots.area.tp", "static.permissions"), - PERMISSION_AUTO_MEGA("plots.auto.mega", "static.permissions"), - PERMISSION_CLAIM_SCHEMATIC("plots.claim.%s0", "static.permissions"), - PERMISSION_ADMIN_COMMAND_SCHEMATIC("plots.admin.command.schematic", "static.permissions"), - PERMISSION_ADMIN_COMMAND_CLEAR("plots.admin.command.clear", "static.permissions"), - PERMISSION_CONTINUE("plots.continue", "static.permissions"), - PERMISSION_CLUSTER_LIST("plots.cluster.list", "static.permissions"), - PERMISSION_CLUSTER_CREATE("plots.cluster.create", "static.permissions"), - PERMISSION_CLUSTER_CREATE_OTHER("plots.cluster.create.other", "static.permissions"), - PERMISSION_CLUSTER_SIZE("plots.cluster.size", "static.permissions"), - PERMISSION_CLUSTER_DELETE("plots.cluster.delete", "static.permissions"), - PERMISSION_CLUSTER_DELETE_OTHER("plots.cluster.delete.other", "static.permissions"), - PERMISSION_CLUSTER_RESIZE("plots.cluster.resize", "static.permissions"), - PERMISSION_CLUSTER_RESIZE_OTHER("plots.cluster.resize.other", "static.permissions"), - PERMISSION_CLUSTER_RESIZE_SHRINK("plots.cluster.resize.shrink", "static.permissions"), - PERMISSION_CLUSTER_RESIZE_EXPAND("plots.cluster.resize.expand", "static.permissions"), - PERMISSION_CLUSTER("plots.cluster", "static.permissions"), - PERMISSION_CLUSTER_INVITE("plots.cluster.invite", "static.permissions"), - PERMISSION_CLUSTER_INVITE_OTHER("plots.cluster.invite.other", "static.permissions"), - PERMISSION_CLUSTER_KICK("plots.cluster.kick", "static.permissions"), - PERMISSION_CLUSTER_KICK_OTHER("plots.cluster.kick.other", "static.permissions"), - PERMISSION_CLUSTER_LEAVE("plots.cluster.leave", "static.permissions"), - PERMISSION_CLUSTER_HELPERS("plots.cluster.helpers", "static.permissions"), - PERMISSION_CLUSTER_TP("plots.cluster.tp", "static.permissions"), - PERMISSION_CLUSTER_TP_OTHER("plots.cluster.tp.other", "static.permissions"), - PERMISSION_CLUSTER_INFO("plots.cluster.info", "static.permissions"), - PERMISSION_CLUSTER_SETHOME("plots.cluster.sethome", "static.permissions"), - PERMISSION_CLUSTER_SETHOME_OTHER("plots.cluster.sethome.other", "static.permissions"), - PERMISSION_ADMIN_COMMAND_CONTINUE("plots.admin.command.continue", "static.permissions"), - PERMISSION_ADMIN_COMMAND_DELETE("plots.admin.command.delete", "static.permissions"), - PERMISSION_ADMIN_COMMAND_DENY("plots.admin.command.deny", "static.permissions"), - PERMISSION_DENY_EVERYONE("plots.deny.everyone", "static.permissions"), - PERMISSION_ADMIN_COMMAND_DONE("plots.admin.command.done", "static.permissions"), - PERMISSION_ADMIN_COMMAND_DOWNLOAD("plots.admin.command.download", "static.permissions"), - PERMISSION_DOWNLOAD_WORLD("plots.download.world", "static.permissions"), - PERMISSION_SET_FLAG_OTHER("plots.set.flag.other", "static.permissions"), - PERMISSION_SET_FLAG("plots.set.flag", "static.permissions"), - PERMISSION_SET_FLAG_KEY("plots.set.flag.%s0", "static.permissions"), - PERMISSION_SET_FLAG_KEY_VALUE("plots.set.flag.%s0.%s1", "static.permissions"), - PERMISSION_FLAG_REMOVE("plots.flag.remove", "static.permissions"), - PERMISSION_FLAG_ADD("plots.flag.add", "static.permissions"), - PERMISSION_FLAG_LIST("plots.flag.list", "static.permissions"), - PERMISSION_ADMIN_COMMAND_KICK("plots.admin.command.kick", "static.permissions"), - PERMISSION_GRANT("plots.grant.%s0", "static.permissions"), - PERMISSION_LIST_FOR_SALE("plots.list.forsale", "static.permissions"), - PERMISSION_LIST_MINE("plots.list.mine", "static.permissions"), - PERMISSION_LIST_SHARED("plots.list.shared", "static.permissions"), - PERMISSION_LIST_WORLD("plots.list.world", "static.permissions"), - PERMISSION_LIST_WORLD_NAME("plots.list.world.%s0", "static.permissions"), - PERMISSION_LIST_TOP("plots.list.top", "static.permissions"), - PERMISSION_LIST_ALL("plots.list.all", "static.permissions"), - PERMISSION_LIST_UNOWNED("plots.list.unowned", "static.permissions"), - PERMISSION_LIST_UNKNOWN("plots.list.unknown", "static.permissions"), - PERMISSION_LIST_PLAYER("plots.list.player", "static.permissions"), - PERMISSION_LIST_DONE("plots.list.done", "static.permissions"), - PERMISSION_LIST_EXPIRED("plots.list.expired", "static.permissions"), - PERMISSION_LIST_FUZZY("plots.list.fuzzy", "static.permissions"), - PERMISSION_LIST_AREA("plots.list.area", "static.permissions"), - PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load", "static.permissions"), - PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge", "static.permissions"), - PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner", "static.permissions"), - PERMISSION_COMMENT("plots.comment", "static.permissions"), - PERMISSION_ADMIN_COMMAND_REMOVE("plots.admin.command.remove", "static.permissions"), - PERMISSION_ADMIN_COMMAND_SAVE("plots.admin.command.save", "static.permissions"), - PERMISSION_ADMIN_COMMAND_SCHEMATIC_PASTE("plots.admin.command.schematic.paste", "static.permissions"), - PERMISSION_SCHEMATIC_PASTE("plots.schematic.paste", "static.permissions"), - PERMISSION_SCHEMATIC_LIST("plots.schematic.list", "static.permissions"), - PERMISSION_SCHEMATIC_SAVE("plots.schematic.save", "static.permissions"), - PERMISSION_ADMIN_COMMAND_SCHEMATIC_SAVE("plots.admin.command.schematic.save", "static.permissions"), - PERMISSION_SET_COMPONENT("plots.set.%s0", "static.permissions"), - PERMISSION_ADMIN_COMMAND("plots.admin.command.%s0", "static.permissions"), - PERMISSION_ADMIN_COMMAND_UNLINK("plots.ad2min.command.unlink", "static.permissions"), - PERMISSION_VISIT_UNOWNED("plots.visit.unowned", "static.permissions"), - PERMISSION_VISIT_OWNED("plots.visit.owned", "static.permissions"), - PERMISSION_SHARED("plots.visit.shared", "static.permissions"), - PERMISSION_VISIT_OTHER("plots.visit.other", "static.permissions"), - PERMISSION_HOME("plots.home", "static.permissions"), - PERMISSION_ALIAS_SET_OBSOLETE("plots.set.alias", "static.permissions"), // Note this is for backwards compatibility - PERMISSION_ALIAS_SET("plots.alias.set", "static.permissions"), - PERMISSION_ADMIN_ALIAS_SET("plots.admin.alias.set", "static.permissions"), - PERMISSION_ALIAS_REMOVE("plots.alias.remove", "static.permissions"), - PERMISSION_ADMIN_ALIAS_REMOVE("plots.admin.alias.remove", "static.permissions"), - PERMISSION_ADMIN_CHAT_BYPASS("plots.admin.chat.bypass", "static.permissions"), - PERMISSION_BACKUP("plots.backup", "static.permissions"), - PERMISSION_BACKUP_SAVE("plots.backup.save", "static.permissions"), - PERMISSION_BACKUP_LIST("plots.backup.list", "static.permissions"), - PERMISSION_BACKUP_LOAD("plots.backup.load", "static.permissions"), - PERMISSION_ADMIN_BACKUP_OTHER("plots.admin.backup.other", "static.permissions"), - PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe", "static.permissions"), - PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other", "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"), // // EXPIRED_CONFIRM("$2Confirmation has expired, please run the command again!", "Confirm"), @@ -830,4 +799,29 @@ public enum Captions implements Caption { 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; + } + } diff --git a/Core/src/main/java/com/plotsquared/core/util/Permissions.java b/Core/src/main/java/com/plotsquared/core/util/Permissions.java index 5ba260daf..f939473dc 100644 --- a/Core/src/main/java/com/plotsquared/core/util/Permissions.java +++ b/Core/src/main/java/com/plotsquared/core/util/Permissions.java @@ -25,7 +25,6 @@ */ package com.plotsquared.core.util; -import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.caption.TranslatableCaption; @@ -43,7 +42,7 @@ import javax.annotation.Nonnull; public class Permissions { public static boolean hasPermission(PlotPlayer player, Captions caption, boolean notify) { - return hasPermission(player, caption.getTranslated(), notify); + return hasPermission(player, caption.toString(), notify); } /** @@ -52,8 +51,8 @@ public class Permissions { * @param permission Permission * @return {@code true} if the owner has the given permission, else {@code false} */ - public static boolean hasPermission(@Nonnull final PermissionHolder caller, @Nonnull final Caption permission) { - return caller.hasPermission(permission.getTranslated()); + public static boolean hasPermission(@Nonnull final PermissionHolder caller, @Nonnull final Captions permission) { + return caller.hasPermission(permission.toString()); } /** @@ -88,7 +87,7 @@ public class Permissions { } public static int hasPermissionRange(PlotPlayer player, Captions perm, int range) { - return hasPermissionRange(player, perm.getTranslated(), range); + return hasPermissionRange(player, perm.toString(), range); } /**