mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
parent
539ad9f05c
commit
8f685b754a
@ -223,8 +223,8 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
|
||||
if (!chunk.isLoaded()) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PlotSquared
|
||||
.debug(Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
PlotSquared.debug(Captions.PREFIX.getTranslated()
|
||||
+ "&aSuccessfully processed and unloaded chunk!");
|
||||
chunk.unload(true);
|
||||
return;
|
||||
}
|
||||
@ -232,8 +232,8 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
|
||||
if (tiles.length == 0) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PlotSquared
|
||||
.debug(Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
PlotSquared.debug(Captions.PREFIX.getTranslated()
|
||||
+ "&aSuccessfully processed and unloaded chunk!");
|
||||
chunk.unload(true);
|
||||
return;
|
||||
}
|
||||
@ -243,8 +243,8 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
|
||||
if (i >= tiles.length) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PlotSquared.debug(
|
||||
Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
PlotSquared.debug(Captions.PREFIX.getTranslated()
|
||||
+ "&aSuccessfully processed and unloaded chunk!");
|
||||
chunk.unload(true);
|
||||
return;
|
||||
}
|
||||
@ -268,13 +268,15 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
|
||||
}
|
||||
}
|
||||
PlotSquared.debug(
|
||||
Captions.PREFIX.s() + "&a detected unsafe chunk and processed: " + (chunk.getX()
|
||||
Captions.PREFIX.getTranslated() + "&a detected unsafe chunk and processed: " + (
|
||||
chunk.getX()
|
||||
<< 4) + "," + (chunk.getX() << 4));
|
||||
}
|
||||
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
|
||||
if (unload) {
|
||||
PlotSquared.debug(
|
||||
Captions.PREFIX.s() + "&c detected unsafe chunk: " + (chunk.getX() << 4) + ","
|
||||
Captions.PREFIX.getTranslated() + "&c detected unsafe chunk: " + (chunk.getX()
|
||||
<< 4) + ","
|
||||
+ (chunk.getX() << 4));
|
||||
cleanChunk(chunk);
|
||||
return true;
|
||||
|
@ -637,7 +637,7 @@ import java.util.regex.Pattern;
|
||||
EventUtil.manager.doJoinTask(pp);
|
||||
}, 20);
|
||||
|
||||
if (pp.hasPermission(Captions.PERMISSION_ADMIN_UPDATE_NOTIFICATION.s())
|
||||
if (pp.hasPermission(Captions.PERMISSION_ADMIN_UPDATE_NOTIFICATION.getTranslated())
|
||||
&& PlotSquared.get().getUpdateUtility() != null) {
|
||||
final UpdateUtility updateUtility = PlotSquared.get().getUpdateUtility();
|
||||
final BukkitMain bukkitMain = BukkitMain.getPlugin(BukkitMain.class);
|
||||
@ -941,7 +941,7 @@ import java.util.regex.Pattern;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
String message = event.getMessage();
|
||||
String format = Captions.PLOT_CHAT_FORMAT.s();
|
||||
String format = Captions.PLOT_CHAT_FORMAT.getTranslated();
|
||||
String sender = event.getPlayer().getDisplayName();
|
||||
PlotId id = plot.getId();
|
||||
Set<Player> recipients = event.getRecipients();
|
||||
@ -968,8 +968,8 @@ import java.util.regex.Pattern;
|
||||
receiver.sendMessage(full);
|
||||
}
|
||||
if (!spies.isEmpty()) {
|
||||
String spyMessage =
|
||||
Captions.PLOT_CHAT_SPY_FORMAT.s().replace("%plot_id%", id.x + ";" + id.y)
|
||||
String spyMessage = Captions.PLOT_CHAT_SPY_FORMAT.getTranslated()
|
||||
.replace("%plot_id%", id.x + ";" + id.y)
|
||||
.replace("%sender%", sender).replace("%msg%", message);
|
||||
for (Player player : spies) {
|
||||
player.sendMessage(spyMessage);
|
||||
@ -1001,7 +1001,7 @@ import java.util.regex.Pattern;
|
||||
&& !Permissions
|
||||
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
||||
event.setCancelled(true);
|
||||
MainUtil.sendMessage(plotPlayer, Captions.HEIGHT_LIMIT.s()
|
||||
MainUtil.sendMessage(plotPlayer, Captions.HEIGHT_LIMIT.getTranslated()
|
||||
.replace("{limit}", String.valueOf(area.MAX_BUILD_HEIGHT)));
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
@ -2991,7 +2991,7 @@ import java.util.regex.Pattern;
|
||||
if ((location.getY() > area.MAX_BUILD_HEIGHT || location.getY() < area.MIN_BUILD_HEIGHT)
|
||||
&& !Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
||||
event.setCancelled(true);
|
||||
MainUtil.sendMessage(pp, Captions.HEIGHT_LIMIT.s()
|
||||
MainUtil.sendMessage(pp, Captions.HEIGHT_LIMIT.getTranslated()
|
||||
.replace("{limit}", String.valueOf(area.MAX_BUILD_HEIGHT)));
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
|
@ -112,15 +112,15 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
}
|
||||
|
||||
@Override public int hasPermissionRange(final String stub, final int range) {
|
||||
if (hasPermission(Captions.PERMISSION_ADMIN.s())) {
|
||||
if (hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
final String[] nodes = stub.split("\\.");
|
||||
final StringBuilder n = new StringBuilder();
|
||||
for (int i = 0; i < (nodes.length - 1); i++) {
|
||||
n.append(nodes[i]).append(".");
|
||||
if (!stub.equals(n + Captions.PERMISSION_STAR.s())) {
|
||||
if (hasPermission(n + Captions.PERMISSION_STAR.s())) {
|
||||
if (!stub.equals(n + Captions.PERMISSION_STAR.getTranslated())) {
|
||||
if (hasPermission(n + Captions.PERMISSION_STAR.getTranslated())) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -218,6 +218,13 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
StringWrapper wrap = new StringWrapper(name);
|
||||
if (!toAdd.containsKey(wrap)) {
|
||||
UUID uuid = FileUUIDHandler.this.uuidWrapper.getUUID(offlinePlotPlayer);
|
||||
if (toAdd.containsValue(uuid)) {
|
||||
StringWrapper duplicate = toAdd.inverse().get(uuid);
|
||||
PlotSquared.debug(
|
||||
"The UUID: " + uuid.toString() + " is already mapped to "
|
||||
+ duplicate
|
||||
+ "\n It cannot be added to the Map with a key of " + wrap);
|
||||
}
|
||||
toAdd.putIfAbsent(wrap, uuid);
|
||||
if (ExpireManager.IMP != null) {
|
||||
ExpireManager.IMP.storeDate(uuid, last);
|
||||
|
@ -165,7 +165,7 @@ import java.util.UUID;
|
||||
* @see Captions
|
||||
*/
|
||||
public void sendConsoleMessage(Captions caption) {
|
||||
sendConsoleMessage(caption.s());
|
||||
sendConsoleMessage(caption.getTranslated());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,19 +38,19 @@ public abstract class Command {
|
||||
private RequiredType required;
|
||||
private String usage;
|
||||
private String description;
|
||||
private String perm;
|
||||
private String permission;
|
||||
private boolean confirmation;
|
||||
private CommandCategory category;
|
||||
private Argument[] arguments;
|
||||
|
||||
public Command(Command parent, boolean isStatic, String id, String perm, RequiredType required,
|
||||
CommandCategory cat) {
|
||||
public Command(Command parent, boolean isStatic, String id, String permission,
|
||||
RequiredType required, CommandCategory category) {
|
||||
this.parent = parent;
|
||||
this.isStatic = isStatic;
|
||||
this.id = id;
|
||||
this.perm = perm;
|
||||
this.permission = permission;
|
||||
this.required = required;
|
||||
this.category = cat;
|
||||
this.category = category;
|
||||
this.aliases = Arrays.asList(id);
|
||||
if (this.parent != null) {
|
||||
this.parent.register(this);
|
||||
@ -154,7 +154,7 @@ public abstract class Command {
|
||||
|
||||
public void init(CommandDeclaration declaration) {
|
||||
this.id = declaration.command();
|
||||
this.perm = declaration.permission();
|
||||
this.permission = declaration.permission();
|
||||
this.required = declaration.requiredType();
|
||||
this.category = declaration.category();
|
||||
List<String> aliasOptions = new ArrayList<>();
|
||||
@ -204,8 +204,8 @@ public abstract class Command {
|
||||
}
|
||||
|
||||
public String getPermission() {
|
||||
if (this.perm != null && !this.perm.isEmpty()) {
|
||||
return this.perm;
|
||||
if (this.permission != null && !this.permission.isEmpty()) {
|
||||
return this.permission;
|
||||
}
|
||||
if (this.parent == null) {
|
||||
return "plots.use";
|
||||
@ -244,18 +244,19 @@ public abstract class Command {
|
||||
if (page < totalPages && page > 0) { // Back | Next
|
||||
new PlotMessage().text("<-").color("$1").command(baseCommand + " " + page).text(" | ")
|
||||
.color("$3").text("->").color("$1").command(baseCommand + " " + (page + 2))
|
||||
.text(Captions.CLICKABLE.s()).color("$2").send(player);
|
||||
.text(Captions.CLICKABLE.getTranslated()).color("$2").send(player);
|
||||
return;
|
||||
}
|
||||
if (page == 0 && totalPages != 0) { // Next
|
||||
new PlotMessage().text("<-").color("$3").text(" | ").color("$3").text("->").color("$1")
|
||||
.command(baseCommand + " " + 2).text(Captions.CLICKABLE.s()).color("$2")
|
||||
.command(baseCommand + " " + 2).text(Captions.CLICKABLE.getTranslated()).color("$2")
|
||||
.send(player);
|
||||
return;
|
||||
}
|
||||
if (totalPages != 0) { // Back
|
||||
new PlotMessage().text("<-").color("$1").command(baseCommand + " " + page).text(" | ")
|
||||
.color("$3").text("->").color("$3").text(Captions.CLICKABLE.s()).color("$2")
|
||||
.color("$3").text("->").color("$3").text(Captions.CLICKABLE.getTranslated())
|
||||
.color("$2")
|
||||
.send(player);
|
||||
}
|
||||
}
|
||||
@ -489,7 +490,7 @@ public abstract class Command {
|
||||
return null;
|
||||
}
|
||||
List<Command> result = new ArrayList<>();
|
||||
int index = input.length - (space ? 0 : 1);
|
||||
int index = input.length;
|
||||
for (String arg : args) {
|
||||
arg = arg.replace(getCommandString() + " ", "");
|
||||
String[] split = arg.split(" ");
|
||||
|
@ -54,8 +54,7 @@ import java.util.zip.ZipInputStream;
|
||||
* An implementation of the core, with a static getter for easy access.
|
||||
*/
|
||||
@SuppressWarnings({"unused", "WeakerAccess"}) public class PlotSquared {
|
||||
private static final Set<Plot> EMPTY_SET = Collections.
|
||||
unmodifiableSet(Collections.emptySet());
|
||||
private static final Set<Plot> EMPTY_SET = Collections.unmodifiableSet(Collections.emptySet());
|
||||
private static PlotSquared instance;
|
||||
// Implementation
|
||||
public final IPlotMain IMP;
|
||||
@ -217,21 +216,6 @@ import java.util.zip.ZipInputStream;
|
||||
.runTask(() -> EconHandler.manager = PlotSquared.this.IMP.getEconomyHandler());
|
||||
}
|
||||
|
||||
/* // Check for updates
|
||||
if (Settings.Enabled_Components.UPDATER) {
|
||||
updater = new Updater();
|
||||
TaskManager.IMP.taskAsync(new Runnable() {
|
||||
@Override public void run() {
|
||||
updater.update(getPlatform(), getVersion());
|
||||
}
|
||||
});
|
||||
TaskManager.IMP.taskRepeatAsync(new Runnable() {
|
||||
@Override public void run() {
|
||||
updater.update(getPlatform(), getVersion());
|
||||
}
|
||||
}, 36000);
|
||||
}*/
|
||||
|
||||
// World generators:
|
||||
final ConfigurationSection section = this.worlds.getConfigurationSection("worlds");
|
||||
if (section != null) {
|
||||
@ -249,13 +233,14 @@ import java.util.zip.ZipInputStream;
|
||||
continue;
|
||||
}
|
||||
if (!WorldUtil.IMP.isWorld(world) && !world.equals("*")) {
|
||||
debug(
|
||||
"&c`" + world + "` was not properly loaded - " + IMP.getPluginName()
|
||||
debug("`" + world + "` was not properly loaded - " + IMP.getPluginName()
|
||||
+ " will now try to load it properly: ");
|
||||
debug(
|
||||
"&8 - &7Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml");
|
||||
" - Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml");
|
||||
debug(
|
||||
"&8 - &7Your world management plugin may be faulty (or non existent)");
|
||||
" - Your world management plugin may be faulty (or non existent)");
|
||||
debug(
|
||||
" This message may also be a false positive and could be ignored.");
|
||||
PlotSquared.this.IMP.setGenerator(world);
|
||||
}
|
||||
}
|
||||
@ -614,9 +599,7 @@ import java.util.zip.ZipInputStream;
|
||||
*/
|
||||
private void sortPlotsByHash(Plot[] input) {
|
||||
List<Plot>[] bucket = new ArrayList[32];
|
||||
for (int i = 0; i < bucket.length; i++) {
|
||||
bucket[i] = new ArrayList<>();
|
||||
}
|
||||
Arrays.fill(bucket, new ArrayList<>());
|
||||
boolean maxLength = false;
|
||||
int placement = 1;
|
||||
while (!maxLength) {
|
||||
@ -1191,7 +1174,7 @@ import java.util.zip.ZipInputStream;
|
||||
"Invalid type for multi-area world. Expected `2`, got `" + 1 + "`");
|
||||
}
|
||||
for (String areaId : areasSection.getKeys(false)) {
|
||||
PlotSquared.log(Captions.PREFIX + "&3 - " + areaId);
|
||||
PlotSquared.log(Captions.PREFIX + " - " + areaId);
|
||||
String[] split = areaId.split("(?<=[^;-])-");
|
||||
if (split.length != 3) {
|
||||
throw new IllegalArgumentException("Invalid Area identifier: " + areaId
|
||||
@ -1678,11 +1661,11 @@ import java.util.zip.ZipInputStream;
|
||||
.getString("configuration_version")
|
||||
.equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION)) {
|
||||
// Conversion needed
|
||||
log(Captions.LEGACY_CONFIG_FOUND.s());
|
||||
log(Captions.LEGACY_CONFIG_FOUND.getTranslated());
|
||||
try {
|
||||
com.google.common.io.Files
|
||||
.copy(this.worldsFile, new File(folder, "worlds.yml.old"));
|
||||
log(Captions.LEGACY_CONFIG_BACKUP.s());
|
||||
log(Captions.LEGACY_CONFIG_BACKUP.getTranslated());
|
||||
final ConfigurationSection worlds =
|
||||
this.worlds.getConfigurationSection("worlds");
|
||||
final LegacyConverter converter = new LegacyConverter(worlds);
|
||||
@ -1691,9 +1674,9 @@ import java.util.zip.ZipInputStream;
|
||||
.set("configuration_version", LegacyConverter.CONFIGURATION_VERSION);
|
||||
this.worlds.set("worlds", worlds); // Redundant, but hey... ¯\_(ツ)_/¯
|
||||
this.worlds.save(this.worldsFile);
|
||||
log(Captions.LEGACY_CONFIG_DONE.s());
|
||||
log(Captions.LEGACY_CONFIG_DONE.getTranslated());
|
||||
} catch (final Exception e) {
|
||||
log(Captions.LEGACY_CONFIG_CONVERSION_FAILED.s());
|
||||
log(Captions.LEGACY_CONFIG_CONVERSION_FAILED.getTranslated());
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Disable plugin
|
||||
|
@ -101,13 +101,14 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
|
||||
return false;
|
||||
}
|
||||
plot.setAlias(alias);
|
||||
MainUtil.sendMessage(player, Captions.ALIAS_SET_TO.s().replaceAll("%alias%", alias));
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.ALIAS_SET_TO.getTranslated().replaceAll("%alias%", alias));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean removeAlias(PlotPlayer player, Plot plot) {
|
||||
plot.setAlias(null);
|
||||
MainUtil.sendMessage(player, Captions.ALIAS_REMOVED.s());
|
||||
MainUtil.sendMessage(player, Captions.ALIAS_REMOVED.getTranslated());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -331,8 +331,8 @@ import java.util.Set;
|
||||
+ "\n$1Claimed: $2" + claimed + "\n$1Clusters: $2" + clusters + "\n$1Region: $2"
|
||||
+ region + "\n$1Generator: $2" + generator;
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.PLOT_INFO_HEADER.s() + '\n' + value + '\n' + Captions.PLOT_INFO_FOOTER
|
||||
.s(), false);
|
||||
Captions.PLOT_INFO_HEADER.getTranslated() + '\n' + value + '\n'
|
||||
+ Captions.PLOT_INFO_FOOTER.getTranslated(), false);
|
||||
return true;
|
||||
}
|
||||
case "l":
|
||||
@ -394,7 +394,7 @@ import java.util.Set;
|
||||
.color("$1").text(" - ").color("$2")
|
||||
.text(area.TYPE + ":" + area.TERRAIN).color("$3");
|
||||
}
|
||||
}, "/plot area list", Captions.AREA_LIST_HEADER_PAGED.s());
|
||||
}, "/plot area list", Captions.AREA_LIST_HEADER_PAGED.getTranslated());
|
||||
return true;
|
||||
case "regen":
|
||||
case "clear":
|
||||
|
@ -16,10 +16,11 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil;
|
||||
@Override public boolean set(final PlotPlayer player, final Plot plot, final String value) {
|
||||
int biome = WorldUtil.IMP.getBiomeFromString(value);
|
||||
if (biome == -1) {
|
||||
String biomes =
|
||||
StringMan.join(WorldUtil.IMP.getBiomeList(), Captions.BLOCK_LIST_SEPARATER.s());
|
||||
String biomes = StringMan
|
||||
.join(WorldUtil.IMP.getBiomeList(), Captions.BLOCK_LIST_SEPARATER.getTranslated());
|
||||
Captions.NEED_BIOME.send(player);
|
||||
MainUtil.sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.s() + biomes);
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.SUBCOMMAND_SET_OPTIONS_HEADER.getTranslated() + biomes);
|
||||
return false;
|
||||
}
|
||||
if (plot.getRunning() > 0) {
|
||||
@ -29,7 +30,8 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil;
|
||||
plot.addRunning();
|
||||
plot.setBiome(value.toUpperCase(), () -> {
|
||||
plot.removeRunning();
|
||||
MainUtil.sendMessage(player, Captions.BIOME_SET_TO.s() + value.toLowerCase());
|
||||
MainUtil
|
||||
.sendMessage(player, Captions.BIOME_SET_TO.getTranslated() + value.toLowerCase());
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
@ -297,7 +297,8 @@ import java.util.UUID;
|
||||
Settings.Limit.MAX_PLOTS);
|
||||
if (current + cluster.getArea() > allowed) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PERMISSION,
|
||||
Captions.PERMISSION_CLUSTER.s() + "." + (current + cluster.getArea()));
|
||||
Captions.PERMISSION_CLUSTER.getTranslated() + "." + (current + cluster
|
||||
.getArea()));
|
||||
return false;
|
||||
}
|
||||
// resize cluster
|
||||
@ -588,7 +589,7 @@ import java.util.UUID;
|
||||
String size = (cluster.getP2().x - cluster.getP1().x + 1) + "x" + (
|
||||
cluster.getP2().y - cluster.getP1().y + 1);
|
||||
String rights = cluster.isAdded(player.getUUID()) + "";
|
||||
String message = Captions.CLUSTER_INFO.s();
|
||||
String message = Captions.CLUSTER_INFO.getTranslated();
|
||||
message = message.replaceAll("%id%", id);
|
||||
message = message.replaceAll("%owner%", owner);
|
||||
message = message.replaceAll("%name%", name);
|
||||
|
@ -16,7 +16,7 @@ import lombok.RequiredArgsConstructor;
|
||||
* Teleportation CommandConfig.
|
||||
* Such as: /plot visit
|
||||
*/
|
||||
TELEPORT(Captions.COMMAND_CATEGORY_TELEPPORT),
|
||||
TELEPORT(Captions.COMMAND_CATEGORY_TELEPORT),
|
||||
/**
|
||||
* Protection.
|
||||
*/
|
||||
@ -53,6 +53,6 @@ import lombok.RequiredArgsConstructor;
|
||||
private final Captions caption;
|
||||
|
||||
@Override public String toString() {
|
||||
return this.caption.s();
|
||||
return this.caption.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
||||
return !MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.s())) {
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PLOT_PERMS);
|
||||
return false;
|
||||
}
|
||||
|
@ -15,15 +15,15 @@ public class Debug extends SubCommand {
|
||||
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
|
||||
StringBuilder msg = new StringBuilder();
|
||||
for (Captions caption : Captions.values()) {
|
||||
msg.append(caption.s()).append("\n");
|
||||
msg.append(caption.getTranslated()).append("\n");
|
||||
}
|
||||
MainUtil.sendMessage(player, msg.toString());
|
||||
return true;
|
||||
}
|
||||
StringBuilder information = new StringBuilder();
|
||||
String header = Captions.DEBUG_HEADER.s();
|
||||
String line = Captions.DEBUG_LINE.s();
|
||||
String section = Captions.DEBUG_SECTION.s();
|
||||
String header = Captions.DEBUG_HEADER.getTranslated();
|
||||
String line = Captions.DEBUG_LINE.getTranslated();
|
||||
String section = Captions.DEBUG_SECTION.getTranslated();
|
||||
information.append(header);
|
||||
information.append(getSection(section, "PlotArea"));
|
||||
information.append(
|
||||
|
@ -124,8 +124,8 @@ import java.util.stream.Collectors;
|
||||
final String pasteId = jsonObject.get("paste_id").getAsString();
|
||||
final String link =
|
||||
String.format("https://athion.net/ISPaster/paste/view/%s", pasteId);
|
||||
player
|
||||
.sendMessage(Captions.DEBUG_REPORT_CREATED.s().replace("%url%", link));
|
||||
player.sendMessage(
|
||||
Captions.DEBUG_REPORT_CREATED.getTranslated().replace("%url%", link));
|
||||
} else {
|
||||
final String responseMessage = jsonObject.get("response").getAsString();
|
||||
MainUtil.sendMessage(player, String
|
||||
|
@ -105,7 +105,7 @@ import java.util.UUID;
|
||||
WorldUtil.IMP.getSpawn(PlotSquared.get().getPlotAreaManager().getAllWorlds()[0]);
|
||||
if (plot.equals(newSpawn.getPlot())) {
|
||||
// Kick from server if you can't be teleported to spawn
|
||||
player.kick(Captions.YOU_GOT_DENIED.s());
|
||||
player.kick(Captions.YOU_GOT_DENIED.getTranslated());
|
||||
} else {
|
||||
player.teleport(newSpawn);
|
||||
}
|
||||
|
@ -8,7 +8,11 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.WorldUtil;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
|
||||
import java.net.URL;
|
||||
@ -37,7 +41,7 @@ import java.net.URL;
|
||||
return false;
|
||||
}
|
||||
if ((!plot.isOwner(player.getUUID())) && !Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.s())) {
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PLOT_PERMS);
|
||||
return false;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public class GenerateDocs {
|
||||
|
||||
Matcher m2 = p2.matcher(line);
|
||||
while (m2.find()) {
|
||||
perms.add(Captions.valueOf("PERMISSION_" + m2.group(1)).s());
|
||||
perms.add(Captions.valueOf("PERMISSION_" + m2.group(1)).getTranslated());
|
||||
}
|
||||
if (line.contains("Permissions.hasPermission(")) {
|
||||
String[] split = line.split("Permissions.hasPermission");
|
||||
@ -151,7 +151,7 @@ public class GenerateDocs {
|
||||
String perm = method.split("[,|)]")[1].trim();
|
||||
if (!perm.equalsIgnoreCase(perm)) {
|
||||
if (perm.startsWith("C.")) {
|
||||
perm = Captions.valueOf(perm.split("\\.")[1]).s();
|
||||
perm = Captions.valueOf(perm.split("\\.")[1]).getTranslated();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
@ -181,7 +181,7 @@ public class GenerateDocs {
|
||||
String perm = method.split("[,|)]")[1].trim();
|
||||
if (!perm.equalsIgnoreCase(perm)) {
|
||||
if (perm.startsWith("C.")) {
|
||||
perm = Captions.valueOf(perm.split("\\.")[1]).s();
|
||||
perm = Captions.valueOf(perm.split("\\.")[1]).getTranslated();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
@ -77,16 +77,17 @@ public class Help extends Command {
|
||||
}
|
||||
if (cat == null && page == 0) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(Captions.HELP_HEADER.s());
|
||||
builder.append(Captions.HELP_HEADER.getTranslated());
|
||||
for (CommandCategory c : CommandCategory.values()) {
|
||||
builder.append("\n").append(StringMan
|
||||
.replaceAll(Captions.HELP_INFO_ITEM.s(), "%category%", c.toString().toLowerCase(),
|
||||
.replaceAll(Captions.HELP_INFO_ITEM.getTranslated(), "%category%",
|
||||
c.toString().toLowerCase(),
|
||||
"%category_desc%", c.toString()));
|
||||
}
|
||||
builder.append("\n")
|
||||
.append(Captions.HELP_INFO_ITEM.s().replaceAll("%category%", "all")
|
||||
.append(Captions.HELP_INFO_ITEM.getTranslated().replaceAll("%category%", "all")
|
||||
.replaceAll("%category_desc%", "Display all commands"));
|
||||
builder.append("\n").append(Captions.HELP_FOOTER.s());
|
||||
builder.append("\n").append(Captions.HELP_FOOTER.getTranslated());
|
||||
MainUtil.sendMessage(player, builder.toString(), false);
|
||||
return true;
|
||||
}
|
||||
|
@ -40,7 +40,8 @@ import java.util.List;
|
||||
}
|
||||
StringBuilder string = new StringBuilder();
|
||||
string.append(StringMan
|
||||
.replaceAll(Captions.COMMENT_LIST_HEADER_PAGED.s(), "%amount%", comments.length, "%cur",
|
||||
.replaceAll(Captions.COMMENT_LIST_HEADER_PAGED.getTranslated(), "%amount%",
|
||||
comments.length, "%cur",
|
||||
page + 1, "%max", totalPages + 1, "%word", "all") + '\n');
|
||||
|
||||
// This might work xD
|
||||
|
@ -5,7 +5,11 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotInventory;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager;
|
||||
|
||||
@ -53,7 +57,7 @@ public class Info extends SubCommand {
|
||||
plot = player.getCurrentPlot();
|
||||
}
|
||||
if (plot == null) {
|
||||
MainUtil.sendMessage(player, Captions.NOT_IN_PLOT.s());
|
||||
MainUtil.sendMessage(player, Captions.NOT_IN_PLOT.getTranslated());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -70,7 +74,8 @@ public class Info extends SubCommand {
|
||||
boolean allowed = false;
|
||||
for (final String argument : args) {
|
||||
if (argument.equalsIgnoreCase("-f")) {
|
||||
if (!player.hasPermission(Captions.PERMISSION_AREA_INFO_FORCE.s())) {
|
||||
if (!player
|
||||
.hasPermission(Captions.PERMISSION_AREA_INFO_FORCE.getTranslated())) {
|
||||
Captions.NO_PERMISSION.send(player, Captions.PERMISSION_AREA_INFO_FORCE);
|
||||
return true;
|
||||
}
|
||||
@ -125,7 +130,7 @@ public class Info extends SubCommand {
|
||||
plot.getId().x + ";" + plot.getId().y);
|
||||
return true;
|
||||
}
|
||||
String info = Captions.PLOT_INFO.s();
|
||||
String info = Captions.PLOT_INFO.getTranslated();
|
||||
boolean full;
|
||||
if (arg != null) {
|
||||
info = getCaption(arg);
|
||||
@ -148,8 +153,8 @@ public class Info extends SubCommand {
|
||||
MainUtil.format(info, plot, player, full, new RunnableVal<String>() {
|
||||
@Override public void run(String value) {
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.PLOT_INFO_HEADER.s() + '\n' + value + '\n' + Captions.PLOT_INFO_FOOTER
|
||||
.s(), false);
|
||||
Captions.PLOT_INFO_HEADER.getTranslated() + '\n' + value + '\n'
|
||||
+ Captions.PLOT_INFO_FOOTER.getTranslated(), false);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
@ -158,29 +163,29 @@ public class Info extends SubCommand {
|
||||
private String getCaption(String string) {
|
||||
switch (string) {
|
||||
case "trusted":
|
||||
return Captions.PLOT_INFO_TRUSTED.s();
|
||||
return Captions.PLOT_INFO_TRUSTED.getTranslated();
|
||||
case "alias":
|
||||
return Captions.PLOT_INFO_ALIAS.s();
|
||||
return Captions.PLOT_INFO_ALIAS.getTranslated();
|
||||
case "biome":
|
||||
return Captions.PLOT_INFO_BIOME.s();
|
||||
return Captions.PLOT_INFO_BIOME.getTranslated();
|
||||
case "denied":
|
||||
return Captions.PLOT_INFO_DENIED.s();
|
||||
return Captions.PLOT_INFO_DENIED.getTranslated();
|
||||
case "flags":
|
||||
return Captions.PLOT_INFO_FLAGS.s();
|
||||
return Captions.PLOT_INFO_FLAGS.getTranslated();
|
||||
case "id":
|
||||
return Captions.PLOT_INFO_ID.s();
|
||||
return Captions.PLOT_INFO_ID.getTranslated();
|
||||
case "size":
|
||||
return Captions.PLOT_INFO_SIZE.s();
|
||||
return Captions.PLOT_INFO_SIZE.getTranslated();
|
||||
case "members":
|
||||
return Captions.PLOT_INFO_MEMBERS.s();
|
||||
return Captions.PLOT_INFO_MEMBERS.getTranslated();
|
||||
case "owner":
|
||||
return Captions.PLOT_INFO_OWNER.s();
|
||||
return Captions.PLOT_INFO_OWNER.getTranslated();
|
||||
case "rating":
|
||||
return Captions.PLOT_INFO_RATING.s();
|
||||
return Captions.PLOT_INFO_RATING.getTranslated();
|
||||
case "likes":
|
||||
return Captions.PLOT_INFO_LIKES.s();
|
||||
return Captions.PLOT_INFO_LIKES.getTranslated();
|
||||
case "seen":
|
||||
return Captions.PLOT_INFO_SEEN.s();
|
||||
return Captions.PLOT_INFO_SEEN.getTranslated();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ import java.util.UUID;
|
||||
.getSpawn(PlotSquared.get().getPlotAreaManager().getAllWorlds()[0]);
|
||||
if (plot.equals(newSpawn.getPlot())) {
|
||||
// Kick from server if you can't be teleported to spawn
|
||||
player2.kick(Captions.YOU_GOT_KICKED.s());
|
||||
player2.kick(Captions.YOU_GOT_KICKED.getTranslated());
|
||||
} else {
|
||||
player2.plotkick(newSpawn);
|
||||
}
|
||||
|
@ -72,8 +72,8 @@ public class ListCmd extends SubCommand {
|
||||
}
|
||||
|
||||
public void noArgs(PlotPlayer player) {
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.SUBCOMMAND_SET_OPTIONS_HEADER.s() + Arrays.toString(getArgumentList(player)));
|
||||
MainUtil.sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.getTranslated() + Arrays
|
||||
.toString(getArgumentList(player)));
|
||||
}
|
||||
|
||||
@Override public boolean onCommand(PlotPlayer player, String[] args) {
|
||||
@ -367,19 +367,19 @@ public class ListCmd extends SubCommand {
|
||||
color = "$1";
|
||||
}
|
||||
PlotMessage trusted = new PlotMessage().text(Captions.color(
|
||||
Captions.PLOT_INFO_TRUSTED.s()
|
||||
Captions.PLOT_INFO_TRUSTED.getTranslated()
|
||||
.replaceAll("%trusted%", MainUtil.getPlayerList(plot.getTrusted()))))
|
||||
.color("$1");
|
||||
PlotMessage members = new PlotMessage().text(Captions.color(
|
||||
Captions.PLOT_INFO_MEMBERS.s()
|
||||
Captions.PLOT_INFO_MEMBERS.getTranslated()
|
||||
.replaceAll("%members%", MainUtil.getPlayerList(plot.getMembers()))))
|
||||
.color("$1");
|
||||
String strFlags = StringMan.join(plot.getFlags().values(), ",");
|
||||
if (strFlags.isEmpty()) {
|
||||
strFlags = Captions.NONE.s();
|
||||
strFlags = Captions.NONE.getTranslated();
|
||||
}
|
||||
PlotMessage flags = new PlotMessage().text(Captions
|
||||
.color(Captions.PLOT_INFO_FLAGS.s().replaceAll("%flags%", strFlags)))
|
||||
PlotMessage flags = new PlotMessage().text(Captions.color(
|
||||
Captions.PLOT_INFO_FLAGS.getTranslated().replaceAll("%flags%", strFlags)))
|
||||
.color("$1");
|
||||
message.text("[").color("$3").text(i + "")
|
||||
.command("/plot visit " + plot.getArea() + ";" + plot.getId())
|
||||
@ -407,7 +407,7 @@ public class ListCmd extends SubCommand {
|
||||
prefix = ", ";
|
||||
}
|
||||
}
|
||||
}, "/plot list " + args[0], Captions.PLOT_LIST_HEADER_PAGED.s());
|
||||
}, "/plot list " + args[0], Captions.PLOT_LIST_HEADER_PAGED.getTranslated());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class Merge extends SubCommand {
|
||||
if (!terrain && !Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_MERGE_KEEP_ROAD)) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PERMISSION,
|
||||
Captions.PERMISSION_MERGE_KEEP_ROAD.s());
|
||||
Captions.PERMISSION_MERGE_KEEP_ROAD.getTranslated());
|
||||
return true;
|
||||
}
|
||||
if (plot.autoMerge(-1, maxSize, uuid, terrain)) {
|
||||
@ -133,7 +133,7 @@ public class Merge extends SubCommand {
|
||||
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
|
||||
"/plot merge <" + StringMan.join(values, "|") + "> [removeroads]");
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.DIRECTION.s().replaceAll("%dir%", direction(loc.getYaw())));
|
||||
Captions.DIRECTION.getTranslated().replaceAll("%dir%", direction(loc.getYaw())));
|
||||
return false;
|
||||
}
|
||||
final boolean terrain;
|
||||
@ -144,7 +144,7 @@ public class Merge extends SubCommand {
|
||||
}
|
||||
if (!terrain && !Permissions.hasPermission(player, Captions.PERMISSION_MERGE_KEEP_ROAD)) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PERMISSION,
|
||||
Captions.PERMISSION_MERGE_KEEP_ROAD.s());
|
||||
Captions.PERMISSION_MERGE_KEEP_ROAD.getTranslated());
|
||||
return true;
|
||||
}
|
||||
if (plot.autoMerge(direction, maxSize - size, uuid, terrain)) {
|
||||
@ -193,8 +193,8 @@ public class Merge extends SubCommand {
|
||||
MainUtil.sendMessage(player, Captions.SUCCESS_MERGE);
|
||||
};
|
||||
if (hasConfirmation(player)) {
|
||||
CmdConfirm.addPending(accepter,
|
||||
Captions.MERGE_REQUEST_CONFIRM.s().replaceAll("%s", player.getName()), run);
|
||||
CmdConfirm.addPending(accepter, Captions.MERGE_REQUEST_CONFIRM.getTranslated()
|
||||
.replaceAll("%s", player.getName()), run);
|
||||
} else {
|
||||
run.run();
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
||||
return !MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.s())) {
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PLOT_PERMS);
|
||||
return false;
|
||||
}
|
||||
@ -50,7 +50,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
||||
return false;
|
||||
}
|
||||
if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.s()))) {
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated()))) {
|
||||
Captions.PLOTWORLD_INCOMPATIBLE.send(player);
|
||||
return false;
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ import java.util.UUID;
|
||||
if (uuid == null || value.equalsIgnoreCase("-")) {
|
||||
if (value.equalsIgnoreCase("none") || value.equalsIgnoreCase("null") || value
|
||||
.equalsIgnoreCase("-")) {
|
||||
if (!Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_SET_OWNER.s(), true)) {
|
||||
if (!Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_COMMAND_SET_OWNER.getTranslated(), true)) {
|
||||
return false;
|
||||
}
|
||||
Set<Plot> connected = plot.getConnectedPlots();
|
||||
|
@ -126,7 +126,8 @@ import java.util.stream.IntStream;
|
||||
newValues.addAll(
|
||||
Arrays.asList(plot.getManager().getPlotComponents(plot.getId())));
|
||||
}
|
||||
MainUtil.sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.s() + StringMan
|
||||
MainUtil
|
||||
.sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.getTranslated() + StringMan
|
||||
.join(newValues, Captions.BLOCK_LIST_SEPARATER.formatted()));
|
||||
return false;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class Swap extends SubCommand {
|
||||
return !MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.s())) {
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
MainUtil.sendMessage(player, Captions.NO_PLOT_PERMS);
|
||||
return false;
|
||||
}
|
||||
|
@ -21,9 +21,7 @@ import java.util.Set;
|
||||
public enum Captions {
|
||||
|
||||
//@formatter:off
|
||||
/*
|
||||
* Static flags
|
||||
*/
|
||||
//<editor-fold desc="Static Flags">
|
||||
FLAG_USE("use", "static.flags"),
|
||||
FLAG_BREAK("break", "static.flags"),
|
||||
FLAG_PLACE("place", "static.flags"),
|
||||
@ -44,9 +42,8 @@ public enum Captions {
|
||||
FLAG_TAMED_INTERACT("tamed-interact", "static.flags"),
|
||||
FLAG_DISABLE_PHYSICS("disable-physics", "static.flags"),
|
||||
FLAG_MOB_PLACE("mob-place", "static.flags"),
|
||||
/*
|
||||
* Static permission
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Static Permission">
|
||||
PERMISSION_STAR("*", "static.permissions"),
|
||||
PERMISSION_ADMIN("plots.admin", "static.permissions"),
|
||||
PERMISSION_PROJECTILE_UNOWNED("plots.projectile.unowned", "static.permissions"),
|
||||
@ -162,37 +159,32 @@ public enum Captions {
|
||||
PERMISSION_ALIAS_SET_OBSOLETE("plots.set.alias", "static.permissions"), // Note this is for backwards compatibility
|
||||
PERMISSION_ALIAS_SET("plots.alias.set", "static.permissions"),
|
||||
PERMISSION_ALIAS_REMOVE("plots.alias.remove", "static.permissions"),
|
||||
/*
|
||||
* Static console
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Static Console">
|
||||
CONSOLE_JAVA_OUTDATED(
|
||||
"&cYour version of java is outdated. It is highly recommended that you update to Java 8 as it increases performance "
|
||||
+ "and security. %s0 will require Java 8 in a future update.",
|
||||
"static.console"), CONSOLE_PLEASE_ENABLE_METRICS(
|
||||
"&dPlease enable metrics for %s0. Using metrics improves plugin stability, performance, and features. "
|
||||
+ "Bug fixes and new features are influenced on metrics.", "static.console"),
|
||||
/*
|
||||
* Confirm
|
||||
*/
|
||||
//</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"),
|
||||
/*
|
||||
* Move
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Move">
|
||||
MOVE_SUCCESS("$4Successfully moved plot.", "Move"), COPY_SUCCESS("$4Successfully copied plot.",
|
||||
"Move"),
|
||||
REQUIRES_UNOWNED("$2The location specified is already occupied.", "Move"),
|
||||
/*
|
||||
* Area Create
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Area Create">
|
||||
REQUIRES_UNMERGED("$2The plot cannot be merged", "debug"),
|
||||
SET_ATTRIBUTE("$4Successfully set %s0 set to %s1", "Set"),
|
||||
/*
|
||||
* Web
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Web">
|
||||
GENERATING_LINK("$1Processing plot...", "Web"),
|
||||
GENERATING_LINK_FAILED(
|
||||
"$2Failed to generate download link!", "Web"),
|
||||
@ -201,13 +193,11 @@ public enum Captions {
|
||||
LOAD_FAILED("$2Failed to load schematic", "Web"),
|
||||
LOAD_LIST("$2To load a schematic, use $1/plot load #", "Web"),
|
||||
SAVE_SUCCESS("$1Successfully saved!", "Web"),
|
||||
/*
|
||||
* Compass
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Compass">
|
||||
COMPASS_TARGET("$4Successfully targeted plot with compass", "Compass"),
|
||||
/*
|
||||
* Cluster
|
||||
*/
|
||||
//</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(
|
||||
@ -233,18 +223,15 @@ public enum Captions {
|
||||
CLUSTER_INFO(
|
||||
"$1Current cluster: $2%id%&-$1Name: $2%name%&-$1Owner: $2%owner%&-$1Size: $2%size%&-$1Rights: $2%rights%",
|
||||
"Cluster"),
|
||||
/*
|
||||
* Border
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Border">
|
||||
BORDER("$2You are outside the current map border", "Border"),
|
||||
/*
|
||||
* Un-claim
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Un-Claim">
|
||||
UNCLAIM_SUCCESS("$4You successfully unclaimed the plot.", "Unclaim"), UNCLAIM_FAILED(
|
||||
"$2Could not unclaim the plot", "Unclaim"),
|
||||
/*
|
||||
* WorldEdit masks
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="WorldEdit Masks">
|
||||
WORLDEDIT_DELAYED("$2Please wait while we process your WorldEdit action...",
|
||||
"WorldEdit Masks"), WORLDEDIT_RUN("$2Apologies for the delay. Now executing: %s",
|
||||
"WorldEdit Masks"),
|
||||
@ -270,25 +257,20 @@ public enum Captions {
|
||||
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"),
|
||||
/*
|
||||
* Records
|
||||
*/
|
||||
RECORD_PLAY("$2%player $2started playing record $1%name", "Records"), NOTIFY_ENTER(
|
||||
"$2%player $2entered your plot ($1%plot$2)", "Records"),
|
||||
|
||||
//</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"),
|
||||
/*
|
||||
* Swap
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Swap">
|
||||
SWAP_OVERLAP("$2The proposed areas are not allowed to overlap", "Swap"), SWAP_DIMENSIONS(
|
||||
"$2The proposed areas must have comparable dimensions", "Swap"),
|
||||
|
||||
SWAP_SYNTAX("$2/plot swap <id>", "Swap"), SWAP_SUCCESS("$4Successfully swapped plots", "Swap"),
|
||||
|
||||
STARTED_SWAP("$2Started plot swap task. You will be notified when it finishes", "Swap"),
|
||||
/*
|
||||
* Comment
|
||||
*/
|
||||
//</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"),
|
||||
|
||||
@ -306,21 +288,18 @@ public enum Captions {
|
||||
|
||||
COMMENT_HEADER("$2&m---------&r $1Comments $2&m---------&r", "Comment"), INBOX_EMPTY(
|
||||
"$2No comments", "Comment"),
|
||||
/*
|
||||
* Console
|
||||
*/
|
||||
//</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"),
|
||||
/*
|
||||
Inventory
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Inventory">
|
||||
INVENTORY_USAGE("&cUsage: &6{usage}", "Inventory"), INVENTORY_DESC("&cDescription: &6{desc}",
|
||||
"Inventory"),
|
||||
|
||||
INVENTORY_CATEGORY("&cCategory: &6{category}", "Inventory"),
|
||||
/*
|
||||
* Clipboard
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Clipboard">
|
||||
CLIPBOARD_SET(
|
||||
"$2The current plot is now copied to your clipboard, use $1/plot paste$2 to paste it",
|
||||
"Clipboard"), PASTED(
|
||||
@ -333,16 +312,15 @@ public enum Captions {
|
||||
CLIPBOARD_INFO(
|
||||
"$2Current Selection - Plot ID: $1%id$2, Width: $1%width$2, Total Blocks: $1%total$2",
|
||||
"Clipboard"),
|
||||
/*
|
||||
* Toggle
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Toggle">
|
||||
TOGGLE_ENABLED("$2Enabled setting: %s", "Toggle"), TOGGLE_DISABLED("$2Disabled setting: %s",
|
||||
"Toggle"),
|
||||
|
||||
COMMAND_BLOCKED("$2That command is not allowed in this plot", "Blocked Command"),
|
||||
/*
|
||||
* Done
|
||||
*/
|
||||
//</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"),
|
||||
|
||||
@ -351,10 +329,8 @@ public enum Captions {
|
||||
"Done"), DONE_SUCCESS("$1Successfully marked this plot as done.", "Done"),
|
||||
|
||||
DONE_REMOVED("$1You may now continue building in this plot.", "Done"),
|
||||
/*
|
||||
* Ratings
|
||||
*/
|
||||
|
||||
//</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"),
|
||||
|
||||
@ -368,16 +344,12 @@ public enum Captions {
|
||||
"$2You can only rate finished plots.", "Ratings"),
|
||||
|
||||
RATING_NOT_OWNED("$2You cannot rate a plot that is not claimed by anyone", "Ratings"),
|
||||
/*
|
||||
* Tutorial
|
||||
*/
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Tutorial">
|
||||
RATE_THIS("$2Rate this plot!", "Tutorial"), COMMENT_THIS(
|
||||
"$2Leave some feedback on this plot: %s", "Tutorial"),
|
||||
/*
|
||||
* Economy Stuff
|
||||
*/
|
||||
|
||||
//</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"),
|
||||
|
||||
@ -392,10 +364,8 @@ public enum Captions {
|
||||
"$1%s $2has been taken from your balance", "Economy"),
|
||||
|
||||
REMOVED_GRANTED_PLOT("$2You used %s plot grant(s), you've got $1%s $2left", "Economy"),
|
||||
/*
|
||||
* Setup Stuff
|
||||
*/
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="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"),
|
||||
|
||||
@ -415,9 +385,8 @@ public enum Captions {
|
||||
+ "$1/plot setup back&-$2 - $1/plot setup cancel", "Setup"),
|
||||
|
||||
SETUP_INVALID_GENERATOR("$2Invalid generator. Possible options: %s", "Setup"),
|
||||
/*
|
||||
* Schematic Stuff
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Schematic">
|
||||
|
||||
SCHEMATIC_TOO_LARGE("$2The plot is too large for this action!",
|
||||
"Schematics"), SCHEMATIC_MISSING_ARG(
|
||||
@ -431,38 +400,29 @@ public enum Captions {
|
||||
"Schematics"), SCHEMATIC_PASTE_SUCCESS("$4The schematic pasted successfully", "Schematics"),
|
||||
|
||||
SCHEMATIC_LIST("$4Saved Schematics: $1%s", "Schematics"),
|
||||
|
||||
/*
|
||||
* Title Stuff
|
||||
*/
|
||||
TITLE_ENTERED_PLOT("$1Plot: %world%;%x%;%z%", "Titles"), TITLE_ENTERED_PLOT_SUB("$4Owned by %s",
|
||||
"Titles"),
|
||||
|
||||
PREFIX_GREETING("$1%id%$2> ", "Titles"), PREFIX_FAREWELL("$1%id%$2> ", "Titles"),
|
||||
/*
|
||||
* Core Stuff
|
||||
*/
|
||||
|
||||
TASK_START("Starting task...", "Core"), PREFIX("$3[$1P2$3] $2", "Core"),
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Titles">
|
||||
TITLE_ENTERED_PLOT("$1Plot: %world%;%x%;%z%", "Titles"),
|
||||
TITLE_ENTERED_PLOT_SUB("$4Owned by %s", "Titles"),
|
||||
PREFIX_GREETING("$1%id%$2> ", "Titles"),
|
||||
PREFIX_FAREWELL("$1%id%$2> ", "Titles"),
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Core">
|
||||
TASK_START("Starting task...", "Core"),
|
||||
PREFIX("$3[$1P2$3] $2", "Core"),
|
||||
ENABLED("$1%s0 is now enabled", "Core"),
|
||||
/*
|
||||
* Reload
|
||||
*/
|
||||
|
||||
RELOADED_CONFIGS("$1Translations and world settings have been reloaded",
|
||||
"Reload"), RELOAD_FAILED("$2Failed to reload file configurations", "Reload"),
|
||||
/*
|
||||
* BarAPI
|
||||
*/
|
||||
|
||||
DESC_SET("$2Plot description set", "Desc"), DESC_UNSET("$2Plot description unset", "Desc"),
|
||||
|
||||
//</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"),
|
||||
MISSING_DESC("$2You need to specify a description", "Desc"),
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Alias">
|
||||
|
||||
/*
|
||||
* Alias
|
||||
*/
|
||||
ALIAS_SET_TO("$2Plot alias set to $1%alias%", "Alias"), ALIAS_REMOVED("$2Plot alias removed",
|
||||
"Alias"),
|
||||
|
||||
@ -470,9 +430,8 @@ public enum Captions {
|
||||
"$2The alias must be < 50 characters in length", "Alias"),
|
||||
|
||||
ALIAS_IS_TAKEN("$2That alias is already taken", "Alias"),
|
||||
/*
|
||||
* Position
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Position">
|
||||
|
||||
MISSING_POSITION("$2You need to specify a position. Possible values: $1none",
|
||||
"Position"), POSITION_SET("$1Home position set to your current location", "Position"),
|
||||
@ -481,38 +440,25 @@ public enum Captions {
|
||||
"$2Use /plot set home [none]", "Position"),
|
||||
|
||||
INVALID_POSITION("$2That is not a valid position value", "Position"),
|
||||
/*
|
||||
* Cap
|
||||
*/
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Cap">
|
||||
ENTITY_CAP("$2You are not allowed to spawn more mobs", "cap"),
|
||||
/*
|
||||
* Time
|
||||
*/
|
||||
|
||||
TIME_FORMAT("$1%hours%, %min%, %sec%", "Time"),
|
||||
/*
|
||||
* Permission
|
||||
*/
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Permission">
|
||||
NO_SCHEMATIC_PERMISSION("$2You don't have the permission required to use schematic $1%s",
|
||||
"Permission"), NO_PERMISSION("$2You are lacking the permission node: $1%s", "Permission"),
|
||||
|
||||
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"),
|
||||
"Permission"),
|
||||
NO_PERMISSION("$2You are lacking the permission node: $1%s", "Permission"),
|
||||
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"),
|
||||
|
||||
YOU_BE_DENIED("$2You are not allowed to enter this plot", "Permission"),
|
||||
|
||||
/*
|
||||
* Merge
|
||||
*/
|
||||
//</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"),
|
||||
|
||||
@ -528,10 +474,8 @@ public enum Captions {
|
||||
|
||||
UNLINK_IMPOSSIBLE("$2You can only unlink a mega-plot", "Merge"), UNLINK_SUCCESS(
|
||||
"$2Successfully unlinked plots.", "Merge"),
|
||||
/*
|
||||
* CommandConfig
|
||||
*/
|
||||
|
||||
//</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"),
|
||||
|
||||
@ -540,100 +484,69 @@ public enum Captions {
|
||||
|
||||
SUBCOMMAND_SET_OPTIONS_HEADER("$2Possible Values: ", "CommandConfig"), COMMAND_SYNTAX(
|
||||
"$1Usage: $2%s", "CommandConfig"),
|
||||
/*
|
||||
* Player not found
|
||||
*/
|
||||
|
||||
INVALID_PLAYER_WAIT("$2Player not found: $1%s$2, fetching it. Try again soon.",
|
||||
"Errors"), INVALID_PLAYER("$2Player not found: $1%s$2.", "Errors"),
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Errors">
|
||||
INVALID_PLAYER_WAIT("$2Player not found: $1%s$2, fetching it. Try again soon.", "Errors"),
|
||||
INVALID_PLAYER("$2Player not found: $1%s$2.", "Errors"),
|
||||
INVALID_PLAYER_OFFLINE("$2The player must be online: $1%s.", "Errors"),
|
||||
/*
|
||||
* Command flag
|
||||
*/
|
||||
|
||||
INVALID_COMMAND_FLAG("$2Invalid command flag: %s0", "Errors"), /*
|
||||
* Unknown Error
|
||||
*/
|
||||
|
||||
ERROR("$2An error occurred: %s",
|
||||
"Errors"), // SETTINGS_PASTE_UPLOADED("$2settings.yml was uploaded to: $1%url%", "Paste"),
|
||||
|
||||
// LATEST_LOG_UPLOADED("$2latest.log was uploaded to: $1%url%", "Paste"),
|
||||
INVALID_COMMAND_FLAG("$2Invalid command flag: %s0", "Errors"),
|
||||
ERROR("$2An error occurred: %s", "Errors"),
|
||||
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_LOADED("$2The plot could not be loaded", "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"),
|
||||
WAIT_FOR_TIMER(
|
||||
"$2A set block timer is bound to either the current plot or you. Please wait for it to finish",
|
||||
"Errors"),
|
||||
//</editor-fold>
|
||||
DEBUG_REPORT_CREATED("$1Uploaded a full debug to: $1%url%", "Paste"),
|
||||
|
||||
COMMAND_WENT_WRONG("$2Something went wrong when executing that command...", "Errors"),
|
||||
/*
|
||||
* purge
|
||||
*/
|
||||
|
||||
PURGE_SUCCESS("$4Successfully purged %s plots", "Purge"),
|
||||
/*
|
||||
* trim
|
||||
*/
|
||||
|
||||
TRIM_IN_PROGRESS("A world trim task is already in progress!",
|
||||
"Trim"), NOT_VALID_HYBRID_PLOT_WORLD(
|
||||
"The hybrid plot manager is required to perform this action", "Trim"),
|
||||
/*
|
||||
* No <plot>
|
||||
*/
|
||||
|
||||
NO_FREE_PLOTS("$2There are no free plots available", "Errors"), NOT_IN_PLOT(
|
||||
"$2You're not in a plot", "Errors"),
|
||||
|
||||
NOT_LOADED("$2The plot could not be loaded", "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"),
|
||||
/*
|
||||
* Block List
|
||||
*/
|
||||
//<editor-fold desc="Trim">
|
||||
TRIM_IN_PROGRESS("A world trim task is already in progress!", "Trim"),
|
||||
NOT_VALID_HYBRID_PLOT_WORLD("The hybrid plot manager is required to perform this action", "Trim"),
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Block List">
|
||||
|
||||
BLOCK_LIST_SEPARATER("$1,$2 ", "Block List"),
|
||||
/*
|
||||
* Biome
|
||||
*/
|
||||
//</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"),
|
||||
/*
|
||||
* Teleport / Entry
|
||||
*/
|
||||
//</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"), TELEPORT_FAILED(
|
||||
"$2Teleportation cancelled due to movement or damage", "Teleport"),
|
||||
/*
|
||||
* Set Block
|
||||
*/
|
||||
//</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">
|
||||
|
||||
/*
|
||||
AllowUnsafe
|
||||
*/
|
||||
DEBUGALLOWUNSAFE_ON("$2Unsafe actions allowed", "unsafe"), DEBUGALLOWUNSAFE_OFF(
|
||||
"$2Unsafe actions disabled", "unsafe"),
|
||||
/*
|
||||
* Debug
|
||||
*/
|
||||
//</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"),
|
||||
|
||||
/*
|
||||
* Invalid
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Invalid">
|
||||
|
||||
NOT_VALID_DATA("$2That's not a valid data id.", "Invalid"), NOT_VALID_BLOCK(
|
||||
"$2That's not a valid block: %s", "Invalid"),
|
||||
@ -651,30 +564,26 @@ public enum Captions {
|
||||
"$2Found no plots with your search query", "Invalid"),
|
||||
|
||||
FOUND_NO_PLOTS_FOR_PLAYER("$2No plots found for player: %s", "Invalid"),
|
||||
/*
|
||||
* Need
|
||||
*/
|
||||
NEED_PLOT_NUMBER("$2You've got to specify a plot number or alias", "Need"), NEED_BLOCK(
|
||||
"$2You've got to specify a block", "Need"),
|
||||
|
||||
NEED_PLOT_ID("$2You've got to specify a plot id.", "Need"), NEED_PLOT_WORLD(
|
||||
"$2You've got to specify a plot area.", "Need"),
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Need">
|
||||
NEED_PLOT_NUMBER("$2You've got to specify a plot number or alias", "Need"),
|
||||
NEED_BLOCK("$2You've got to specify a block", "Need"),
|
||||
NEED_PLOT_ID("$2You've got to specify a plot id.", "Need"),
|
||||
NEED_PLOT_WORLD("$2You've got to specify a plot area.", "Need"),
|
||||
NEED_USER("$2You need to specify a username", "Need"),
|
||||
/*
|
||||
* Near
|
||||
*/
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Near">
|
||||
PLOT_NEAR("$1Players: %s0", "Near"),
|
||||
/*
|
||||
* Info
|
||||
*/
|
||||
//</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(
|
||||
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_INFO_HEADER(
|
||||
@ -685,11 +594,12 @@ public enum Captions {
|
||||
PLOT_INFO("$1ID: $2%id%$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%", "Info"), PLOT_INFO_FOOTER(
|
||||
+ "$1Denied: $2%denied%$1&-" + "$1Flags: $2%flags%", "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_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"),
|
||||
|
||||
@ -704,195 +614,116 @@ public enum Captions {
|
||||
PLOT_INFO_SEEN("$1Seen:$2 %seen%", "Info"), PLOT_USER_LIST(" $1%user%$2,", "Info"),
|
||||
|
||||
PLOT_FLAG_LIST("$1%s0:%s1$2", "Info"), INFO_SYNTAX_CONSOLE("$2/plot info X;Y", "Info"),
|
||||
/*
|
||||
* Generating
|
||||
*/
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Working">
|
||||
GENERATING_COMPONENT("$1Started generating component from your settings", "Working"),
|
||||
/*
|
||||
* Clearing
|
||||
*/
|
||||
|
||||
CLEARING_PLOT("$2Clearing plot async.", "Working"), CLEARING_DONE(
|
||||
"$4Clear completed! Took %sms.", "Working"),
|
||||
|
||||
CLEARING_PLOT("$2Clearing plot async.", "Working"),
|
||||
CLEARING_DONE("$4Clear completed! Took %sms.", "Working"),
|
||||
DELETING_DONE("$4Delete completed! Took %sms.", "Working"),
|
||||
/*
|
||||
* Claiming
|
||||
*/
|
||||
|
||||
PLOT_NOT_CLAIMED("$2Plot not claimed", "Working"), PLOT_IS_CLAIMED(
|
||||
"$2This plot is already claimed", "Working"),
|
||||
|
||||
PLOT_NOT_CLAIMED("$2Plot not claimed", "Working"),
|
||||
PLOT_IS_CLAIMED("$2This plot is already claimed", "Working"),
|
||||
CLAIMED("$4You successfully claimed the plot", "Working"),
|
||||
/*
|
||||
* 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"), PLOT_LIST_ITEM(
|
||||
"$2>> $1%id$2:$1%world $2- $1%owner", "List"),
|
||||
|
||||
PLOT_LIST_ITEM_ORDERED("$2[$1%in$2] >> $1%id$2:$1%world $2- $1%owner",
|
||||
"List"), PLOT_LIST_FOOTER("$2>> $1%word% a total of $2%num% $1claimed %plot%.", "List"),
|
||||
/*
|
||||
* Left
|
||||
*/
|
||||
|
||||
LEFT_PLOT("$2You left a plot", "Left"),
|
||||
/*
|
||||
* Wait
|
||||
*/
|
||||
|
||||
WAIT_FOR_TIMER(
|
||||
"$2A setblock timer is bound to either the current plot or you. Please wait for it to finish",
|
||||
"Errors"),
|
||||
/*
|
||||
* 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"), PLOT_CHAT_ON(
|
||||
"$4Plot chat enabled.", "Chat"),
|
||||
|
||||
//</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"),
|
||||
PLOT_LIST_ITEM("$2>> $1%id$2:$1%world $2- $1%owner", "List"),
|
||||
PLOT_LIST_ITEM_ORDERED("$2[$1%in$2] >> $1%id$2:$1%world $2- $1%owner", "List"),
|
||||
PLOT_LIST_FOOTER("$2>> $1%word% a total of $2%num% $1claimed %plot%.", "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"),
|
||||
PLOT_CHAT_ON("$4Plot chat enabled.", "Chat"),
|
||||
PLOT_CHAT_OFF("$4Plot chat disabled.", "Chat"),
|
||||
/*
|
||||
* Denied
|
||||
*/
|
||||
|
||||
DENIED_REMOVED("$4You successfully undenied the player from this plot", "Deny"), DENIED_ADDED(
|
||||
"$4You successfully denied the player from this plot", "Deny"),
|
||||
|
||||
DENIED_NEED_ARGUMENT(
|
||||
"$2Arguments are missing. $1/plot denied add <name> $2or $1/plot denied remove <name>",
|
||||
"Deny"), WAS_NOT_DENIED("$2That player was not denied on this plot", "Deny"),
|
||||
|
||||
YOU_GOT_DENIED(
|
||||
"$4You are denied from the plot you were previously on, and got teleported to spawn",
|
||||
"Deny"),
|
||||
/*
|
||||
* Kick
|
||||
*/
|
||||
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Deny">
|
||||
DENIED_REMOVED("$4You successfully undenied the player from this plot", "Deny"),
|
||||
DENIED_ADDED("$4You successfully denied the player from this plot", "Deny"),
|
||||
DENIED_NEED_ARGUMENT("$2Arguments are missing. $1/plot denied add <name> $2or $1/plot denied remove <name>", "Deny"),
|
||||
WAS_NOT_DENIED("$2That player was not denied on this plot", "Deny"),
|
||||
YOU_GOT_DENIED("$4You are denied from the plot you were previously on, and got teleported to spawn", "Deny"),
|
||||
//</editor-fold>
|
||||
YOU_GOT_KICKED("$4You got kicked!", "Kick"),
|
||||
/*
|
||||
* Rain
|
||||
*/
|
||||
//<editor-fold desc="Flag">
|
||||
FLAG_KEY("$2Key: %s", "Flag"),
|
||||
FLAG_TYPE("$2Type: %s", "Flag"),
|
||||
FLAG_DESC("$2Desc: %s", "Flag"),
|
||||
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"),
|
||||
NOT_VALID_VALUE("$2Flag values must be alphanumerical", "Flag"),
|
||||
FLAG_NOT_IN_PLOT("$2The plot does not have that flag", "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_ADDED("$4Successfully added flag", "Flag"),
|
||||
FLAG_TUTORIAL_USAGE("$1Have an admin set the flag: $2%s", "CommandConfig"),
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Trusted">
|
||||
TRUSTED_ADDED("$4You successfully trusted a user to the plot", "Trusted"),
|
||||
TRUSTED_REMOVED("$4You successfully removed a trusted user from the plot", "Trusted"),
|
||||
WAS_NOT_ADDED("$2That player was not trusted on this plot", "Trusted"),
|
||||
PLOT_REMOVED_USER("$1Plot %s of which you were added to has been deleted due to owner inactivity", "Trusted"),
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Member">
|
||||
REMOVED_PLAYERS("$2Removed %s players from this plot.", "Member"),
|
||||
ALREADY_OWNER("$2That user is already the plot owner: %s0", "Member"),
|
||||
|
||||
NEED_ON_OFF("$2You need to specify a value. Possible values: $1on$2, $1off",
|
||||
"Rain"), SETTING_UPDATED("$4You successfully updated the setting", "Rain"),
|
||||
/*
|
||||
* Flag
|
||||
*/
|
||||
|
||||
FLAG_KEY("$2Key: %s", "Flag"), FLAG_TYPE("$2Type: %s", "Flag"),
|
||||
|
||||
FLAG_DESC("$2Desc: %s", "Flag"), 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"), NOT_VALID_VALUE("$2Flag values must be alphanumerical", "Flag"),
|
||||
|
||||
FLAG_NOT_IN_PLOT("$2The plot does not have that flag", "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_ADDED("$4Successfully added flag", "Flag"), FLAG_TUTORIAL_USAGE(
|
||||
"$1Have an admin set the flag: $2%s", "CommandConfig"),
|
||||
/*
|
||||
* Trusted
|
||||
*/
|
||||
|
||||
TRUSTED_ADDED("$4You successfully trusted a user to the plot", "Trusted"), TRUSTED_REMOVED(
|
||||
"$4You successfully removed a trusted user from the plot", "Trusted"),
|
||||
|
||||
WAS_NOT_ADDED("$2That player was not trusted on this plot", "Trusted"), PLOT_REMOVED_USER(
|
||||
"$1Plot %s of which you were added to has been deleted due to owner inactivity",
|
||||
"Trusted"),
|
||||
/*
|
||||
* Member
|
||||
*/
|
||||
|
||||
REMOVED_PLAYERS("$2Removed %s players from this plot.", "Member"), ALREADY_OWNER(
|
||||
"$2That user is already the plot owner: %s0", "Member"),
|
||||
|
||||
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"),
|
||||
|
||||
MEMBER_REMOVED("$1You successfully removed a user from the plot",
|
||||
"Member"), MEMBER_WAS_NOT_ADDED("$2That player was not added as a user on this plot",
|
||||
"Member"),
|
||||
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"),
|
||||
|
||||
MEMBER_REMOVED("$1You successfully removed a user from the plot", "Member"),
|
||||
MEMBER_WAS_NOT_ADDED("$2That player was not added as a user on this plot", "Member"),
|
||||
PLOT_MAX_MEMBERS("$2You are not allowed to add any more players to this plot", "Member"),
|
||||
/*
|
||||
* Set Owner
|
||||
*/
|
||||
|
||||
SET_OWNER("$4You successfully set the plot owner", "Owner"), SET_OWNER_CANCELLED(
|
||||
"$2The setowner action was cancelled", "Owner"),
|
||||
|
||||
//</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"),
|
||||
NOW_OWNER("$4You are now owner of plot %s", "Owner"),
|
||||
/*
|
||||
* 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"),
|
||||
/*
|
||||
* Help
|
||||
*/
|
||||
|
||||
HELP_HEADER("$3&m---------&r $1Plot\u00B2 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\u00B2 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"),
|
||||
|
||||
//</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>
|
||||
|
||||
BUCKET_ENTRIES_IGNORED(
|
||||
"$2Total bucket values add up to 1 or more. Blocks without a spcified chance will be ignored",
|
||||
"Generator_Bucket"),
|
||||
|
||||
|
||||
/**
|
||||
* Command Categories
|
||||
*/
|
||||
COMMAND_CATEGORY_CLAIMING("Claiming", "Category"), COMMAND_CATEGORY_TELEPPORT("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"),
|
||||
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"),
|
||||
|
||||
/*
|
||||
* Direction
|
||||
*/
|
||||
|
||||
DIRECTION("$1Current direction: %dir%", "Help"),
|
||||
/*
|
||||
* Grant
|
||||
*/
|
||||
|
||||
GRANTED_PLOTS("$1Result: $2%s $1grants left", "Grants"), GRANTED_PLOT(
|
||||
"$1You granted %s0 plot to $2%s1", "Grants"),
|
||||
|
||||
//<editor-fold desc="Grants">
|
||||
GRANTED_PLOTS("$1Result: $2%s $1grants left", "Grants"),
|
||||
GRANTED_PLOT("$1You granted %s0 plot to $2%s1", "Grants"),
|
||||
GRANTED_PLOT_FAILED("$1Grant failed: $2%s", "Grants"),
|
||||
/*
|
||||
* Custom
|
||||
*/
|
||||
//</editor-fold>
|
||||
|
||||
/**
|
||||
* Legacy Configuration Conversion
|
||||
@ -915,48 +746,25 @@ public enum Captions {
|
||||
|
||||
public static final HashMap<String, String> replacements = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Default.
|
||||
*/
|
||||
private final String def;
|
||||
/**
|
||||
* What locale category should this translation fall under.
|
||||
*/
|
||||
private final String defaultString;
|
||||
private final String category;
|
||||
/**
|
||||
* Should the string be prefixed.
|
||||
*/
|
||||
private final boolean prefix;
|
||||
/**
|
||||
* Translated.
|
||||
*/
|
||||
private String s;
|
||||
private String translatedString;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param def default
|
||||
* @param prefix use prefix
|
||||
*/
|
||||
Captions(String def, boolean prefix, String category) {
|
||||
this.def = def;
|
||||
this.s = def;
|
||||
Captions(String defaultString, boolean prefix, String category) {
|
||||
this.defaultString = defaultString;
|
||||
this.translatedString = defaultString;
|
||||
this.prefix = prefix;
|
||||
this.category = category.toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param def default
|
||||
*/
|
||||
Captions(String def, String category) {
|
||||
this(def, true, category.toLowerCase());
|
||||
Captions(String defaultString, String category) {
|
||||
this(defaultString, true, category.toLowerCase());
|
||||
}
|
||||
|
||||
public static String format(String m, Object... args) {
|
||||
public static String format(String message, Object... args) {
|
||||
if (args.length == 0) {
|
||||
return m;
|
||||
return message;
|
||||
}
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
for (int i = args.length - 1; i >= 0; i--) {
|
||||
@ -971,15 +779,15 @@ public enum Captions {
|
||||
map.put("%s", arg);
|
||||
}
|
||||
}
|
||||
m = StringMan.replaceFromMap(m, map);
|
||||
return m;
|
||||
message = StringMan.replaceFromMap(message, map);
|
||||
return message;
|
||||
}
|
||||
|
||||
public static String format(Captions caption, Object... args) {
|
||||
if (caption.usePrefix() && caption.s.length() > 0) {
|
||||
return Captions.PREFIX.s() + format(caption.s, args);
|
||||
if (caption.usePrefix() && caption.translatedString.length() > 0) {
|
||||
return Captions.PREFIX.getTranslated() + format(caption.translatedString, args);
|
||||
} else {
|
||||
return format(caption.s, args);
|
||||
return format(caption.translatedString, args);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1031,7 +839,7 @@ public enum Captions {
|
||||
yml.set(caption.category + '.' + caption.name().toLowerCase(), value);
|
||||
}
|
||||
captions.add(caption);
|
||||
caption.s = value;
|
||||
caption.translatedString = value;
|
||||
} else {
|
||||
toRemove.add(key);
|
||||
}
|
||||
@ -1059,9 +867,11 @@ public enum Captions {
|
||||
continue;
|
||||
}
|
||||
changed = true;
|
||||
yml.set(caption.category + '.' + caption.name().toLowerCase(), caption.def);
|
||||
yml.set(caption.category + '.' + caption.name().toLowerCase(),
|
||||
caption.defaultString);
|
||||
}
|
||||
caption.s = StringMan.replaceFromMap(caption.s, replacements);
|
||||
caption.translatedString =
|
||||
StringMan.replaceFromMap(caption.translatedString, replacements);
|
||||
}
|
||||
if (changed) {
|
||||
yml.save(file);
|
||||
@ -1072,15 +882,15 @@ public enum Captions {
|
||||
}
|
||||
|
||||
public String f(final Object... args) {
|
||||
return format(s(), args);
|
||||
return format(getTranslated(), args);
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return this.s;
|
||||
return this.translatedString;
|
||||
}
|
||||
|
||||
public String s() {
|
||||
return this.s;
|
||||
public String getTranslated() {
|
||||
return this.translatedString;
|
||||
}
|
||||
|
||||
public boolean usePrefix() {
|
||||
@ -1088,7 +898,7 @@ public enum Captions {
|
||||
}
|
||||
|
||||
public String formatted() {
|
||||
return StringMan.replaceFromMap(s(), replacements);
|
||||
return StringMan.replaceFromMap(getTranslated(), replacements);
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
|
@ -7,7 +7,11 @@ import com.github.intellectualsites.plotsquared.plot.flag.FlagManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.listener.WEExtent;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.ChunkManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.MathMan;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.WorldUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis;
|
||||
@ -167,7 +171,7 @@ public abstract class HybridUtils {
|
||||
regeneratePlotWalls(area);
|
||||
|
||||
HybridUtils.UPDATE = false;
|
||||
PlotSquared.debug(Captions.PREFIX.s() + "Finished road conversion");
|
||||
PlotSquared.debug(Captions.PREFIX.getTranslated() + "Finished road conversion");
|
||||
// CANCEL TASK
|
||||
} else {
|
||||
final Runnable task = this;
|
||||
|
@ -57,7 +57,9 @@ public class PlotListener {
|
||||
Optional<String> greetingFlag = plot.getFlag(Flags.GREETING);
|
||||
if (greetingFlag.isPresent()) {
|
||||
greeting = greetingFlag.get();
|
||||
MainUtil.format(Captions.PREFIX_GREETING.s() + greeting, plot, player, false,
|
||||
MainUtil
|
||||
.format(Captions.PREFIX_GREETING.getTranslated() + greeting, plot, player,
|
||||
false,
|
||||
new RunnableVal<String>() {
|
||||
@Override public void run(String value) {
|
||||
MainUtil.sendMessage(player, value);
|
||||
@ -72,8 +74,8 @@ public class PlotListener {
|
||||
for (UUID uuid : plot.getOwners()) {
|
||||
PlotPlayer owner = UUIDHandler.getPlayer(uuid);
|
||||
if (owner != null && !owner.getUUID().equals(player.getUUID())) {
|
||||
MainUtil.sendMessage(owner,
|
||||
Captions.NOTIFY_ENTER.s().replace("%player", player.getName())
|
||||
MainUtil.sendMessage(owner, Captions.NOTIFY_ENTER.getTranslated()
|
||||
.replace("%player", player.getName())
|
||||
.replace("%plot", plot.getId().toString()));
|
||||
}
|
||||
}
|
||||
@ -99,7 +101,8 @@ public class PlotListener {
|
||||
player.setGameMode(gamemodeFlag.get());
|
||||
} else {
|
||||
MainUtil.sendMessage(player, StringMan
|
||||
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.s(), "{plot}",
|
||||
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.getTranslated(),
|
||||
"{plot}",
|
||||
plot.getId(), "{gamemode}", gamemodeFlag.get()));
|
||||
}
|
||||
}
|
||||
@ -112,7 +115,8 @@ public class PlotListener {
|
||||
player.setGameMode(guestGamemodeFlag.get());
|
||||
} else {
|
||||
MainUtil.sendMessage(player, StringMan
|
||||
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.s(), "{plot}",
|
||||
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.getTranslated(),
|
||||
"{plot}",
|
||||
plot.getId(), "{gamemode}", guestGamemodeFlag.get()));
|
||||
}
|
||||
}
|
||||
@ -160,8 +164,8 @@ public class PlotListener {
|
||||
CommentManager.sendTitle(player, plot);
|
||||
}
|
||||
if (titles) {
|
||||
if (!Captions.TITLE_ENTERED_PLOT.s().isEmpty() || !Captions.TITLE_ENTERED_PLOT_SUB
|
||||
.s().isEmpty()) {
|
||||
if (!Captions.TITLE_ENTERED_PLOT.getTranslated().isEmpty()
|
||||
|| !Captions.TITLE_ENTERED_PLOT_SUB.getTranslated().isEmpty()) {
|
||||
TaskManager.runTaskLaterAsync(() -> {
|
||||
Plot lastPlot = player.getMeta(PlotPlayer.META_LAST_PLOT);
|
||||
if ((lastPlot != null) && plot.getId().equals(lastPlot.getId())) {
|
||||
@ -173,9 +177,11 @@ public class PlotListener {
|
||||
replacements.put("%alias", plot.toString());
|
||||
replacements.put("%s", MainUtil.getName(plot.getOwner()));
|
||||
String main = StringMan
|
||||
.replaceFromMap(Captions.TITLE_ENTERED_PLOT.s(), replacements);
|
||||
.replaceFromMap(Captions.TITLE_ENTERED_PLOT.getTranslated(),
|
||||
replacements);
|
||||
String sub = StringMan
|
||||
.replaceFromMap(Captions.TITLE_ENTERED_PLOT_SUB.s(), replacements);
|
||||
.replaceFromMap(Captions.TITLE_ENTERED_PLOT_SUB.getTranslated(),
|
||||
replacements);
|
||||
player.sendTitle(main, sub);
|
||||
}
|
||||
}, 20);
|
||||
@ -207,14 +213,14 @@ public class PlotListener {
|
||||
player.setGameMode(pw.GAMEMODE);
|
||||
} else {
|
||||
MainUtil.sendMessage(player, StringMan
|
||||
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.s(), "{plot}",
|
||||
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.getTranslated(), "{plot}",
|
||||
plot.toString(), "{gamemode}", pw.GAMEMODE.name().toLowerCase()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Optional<String> farewell = plot.getFlag(Flags.FAREWELL);
|
||||
farewell.ifPresent(s -> MainUtil
|
||||
.format(Captions.PREFIX_FAREWELL.s() + s, plot, player, false,
|
||||
.format(Captions.PREFIX_FAREWELL.getTranslated() + s, plot, player, false,
|
||||
new RunnableVal<String>() {
|
||||
@Override public void run(String value) {
|
||||
MainUtil.sendMessage(player, value);
|
||||
@ -226,8 +232,8 @@ public class PlotListener {
|
||||
for (UUID uuid : plot.getOwners()) {
|
||||
PlotPlayer owner = UUIDHandler.getPlayer(uuid);
|
||||
if ((owner != null) && !owner.getUUID().equals(player.getUUID())) {
|
||||
MainUtil.sendMessage(owner,
|
||||
Captions.NOTIFY_LEAVE.s().replace("%player", player.getName())
|
||||
MainUtil.sendMessage(owner, Captions.NOTIFY_LEAVE.getTranslated()
|
||||
.replace("%player", player.getName())
|
||||
.replace("%plot", plot.getId().toString()));
|
||||
}
|
||||
}
|
||||
|
@ -2136,7 +2136,7 @@ public class Plot {
|
||||
}
|
||||
loop:
|
||||
for (int i = 4; i > 0; i--) {
|
||||
String caption = Captions.valueOf("OWNER_SIGN_LINE_" + i).s();
|
||||
String caption = Captions.valueOf("OWNER_SIGN_LINE_" + i).getTranslated();
|
||||
int index = caption.indexOf("%plr%");
|
||||
if (index < 0) {
|
||||
continue;
|
||||
|
@ -171,15 +171,15 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
||||
}
|
||||
|
||||
public int hasPermissionRange(String stub, int range) {
|
||||
if (hasPermission(Captions.PERMISSION_ADMIN.s())) {
|
||||
if (hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
String[] nodes = stub.split("\\.");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < (nodes.length - 1); i++) {
|
||||
builder.append(nodes[i]).append(".");
|
||||
if (!stub.equals(builder + Captions.PERMISSION_STAR.s())) {
|
||||
if (hasPermission(builder + Captions.PERMISSION_STAR.s())) {
|
||||
if (!stub.equals(builder + Captions.PERMISSION_STAR.getTranslated())) {
|
||||
if (hasPermission(builder + Captions.PERMISSION_STAR.getTranslated())) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ public class CommentManager {
|
||||
total = count.get();
|
||||
}
|
||||
if ((size.decrementAndGet() == 0) && (total > 0)) {
|
||||
player.sendTitle("",
|
||||
Captions.INBOX_NOTIFICATION.s().replaceAll("%s", "" + total));
|
||||
player.sendTitle("", Captions.INBOX_NOTIFICATION.getTranslated()
|
||||
.replaceAll("%s", "" + total));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -111,13 +111,13 @@ public abstract class EventUtil {
|
||||
return true;
|
||||
case BREAK_BLOCK:
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
Optional<HashSet<PlotBlock>> use = plot.getFlag(Flags.USE);
|
||||
@ -137,126 +137,128 @@ public abstract class EventUtil {
|
||||
}
|
||||
}
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(), false)) {
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_USE.s() + '/' + Captions.FLAG_BREAK.s()));
|
||||
Captions.FLAG_USE.getTranslated() + '/' + Captions.FLAG_BREAK.getTranslated()));
|
||||
case BREAK_HANGING:
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.HANGING_BREAK).orElse(false)) {
|
||||
return true;
|
||||
}
|
||||
if (plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(), false)
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)
|
||||
|| !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_HANGING_BREAK.s()));
|
||||
Captions.FLAG_HANGING_BREAK.getTranslated()));
|
||||
}
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
case BREAK_MISC:
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.MISC_BREAK).orElse(false)) {
|
||||
return true;
|
||||
}
|
||||
if (plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(), false)
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)
|
||||
|| !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_MISC_BREAK.s()));
|
||||
Captions.FLAG_MISC_BREAK.getTranslated()));
|
||||
}
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
case BREAK_VEHICLE:
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.VEHICLE_BREAK).orElse(false)) {
|
||||
return true;
|
||||
}
|
||||
if (plot.hasOwner()) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_VEHICLE_BREAK.s()));
|
||||
Captions.FLAG_VEHICLE_BREAK.getTranslated()));
|
||||
}
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
case INTERACT_BLOCK: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
Optional<HashSet<PlotBlock>> flagValue = plot.getFlag(Flags.USE);
|
||||
HashSet<PlotBlock> value = flagValue.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(), false)
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)
|
||||
|| !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE, Captions.FLAG_USE.s()));
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_USE.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case PLACE_BLOCK: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_BUILD_ROAD.s(),
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_BUILD_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_BUILD_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_BUILD_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
Optional<HashSet<PlotBlock>> flagValue = plot.getFlag(Flags.PLACE);
|
||||
HashSet<PlotBlock> value = flagValue.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_BUILD_OTHER.s(), false)) {
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_BUILD_OTHER.getTranslated(), false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_PLACE.s()));
|
||||
Captions.FLAG_PLACE.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case TRIGGER_PHYSICAL: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(), false);
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), false);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
false);
|
||||
}
|
||||
if (plot.getFlag(Flags.DEVICE_INTERACT).orElse(false)) {
|
||||
@ -266,8 +268,8 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flagValue.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
@ -277,13 +279,13 @@ public abstract class EventUtil {
|
||||
}
|
||||
case INTERACT_HANGING: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.HOSTILE_INTERACT).orElse(false)) {
|
||||
@ -293,26 +295,27 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flagValue.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_USE.s() + '/' + Captions.FLAG_HANGING_INTERACT.s()));
|
||||
Captions.FLAG_USE.getTranslated() + '/' + Captions.FLAG_HANGING_INTERACT
|
||||
.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case INTERACT_MISC: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.MISC_INTERACT).orElse(false)) {
|
||||
@ -322,26 +325,27 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flag.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_USE.s() + '/' + Captions.FLAG_MISC_INTERACT.s()));
|
||||
Captions.FLAG_USE.getTranslated() + '/' + Captions.FLAG_MISC_INTERACT
|
||||
.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case INTERACT_VEHICLE: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.VEHICLE_USE).orElse(false)) {
|
||||
@ -351,26 +355,27 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flag.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_USE.s() + '/' + Captions.FLAG_VEHICLE_USE.s()));
|
||||
Captions.FLAG_USE.getTranslated() + '/' + Captions.FLAG_VEHICLE_USE
|
||||
.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case SPAWN_MOB: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.MOB_PLACE).orElse(false)) {
|
||||
@ -380,26 +385,27 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flagValue.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_MOB_PLACE.s() + '/' + Captions.FLAG_PLACE.s()));
|
||||
Captions.FLAG_MOB_PLACE.getTranslated() + '/' + Captions.FLAG_PLACE
|
||||
.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case PLACE_MISC: {
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.MISC_PLACE).orElse(false)) {
|
||||
@ -409,27 +415,28 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flag.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_MISC_PLACE.s() + '/' + Captions.FLAG_PLACE.s()));
|
||||
Captions.FLAG_MISC_PLACE.getTranslated() + '/' + Captions.FLAG_PLACE
|
||||
.getTranslated()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
case PLACE_VEHICLE:
|
||||
if (plot == null) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (!plot.hasOwner()) {
|
||||
return Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.s(),
|
||||
return Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
|
||||
notifyPerms);
|
||||
}
|
||||
if (plot.getFlag(Flags.VEHICLE_PLACE).orElse(false)) {
|
||||
@ -439,14 +446,15 @@ public abstract class EventUtil {
|
||||
HashSet<PlotBlock> value = flag.orElse(null);
|
||||
if (value == null || !PlotBlock.containsEverything(value) && !value
|
||||
.contains(block.getPlotBlock())) {
|
||||
if (Permissions
|
||||
.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.s(),
|
||||
if (Permissions.hasPermission(player,
|
||||
Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
|
||||
false)) {
|
||||
return true;
|
||||
}
|
||||
return !(!notifyPerms || MainUtil
|
||||
.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
|
||||
Captions.FLAG_VEHICLE_PLACE.s() + '/' + Captions.FLAG_PLACE.s()));
|
||||
Captions.FLAG_VEHICLE_PLACE.getTranslated() + '/' + Captions.FLAG_PLACE
|
||||
.getTranslated()));
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
|
@ -88,7 +88,7 @@ public class MainUtil {
|
||||
|
||||
public static void sendAdmin(final String s) {
|
||||
for (final PlotPlayer player : UUIDHandler.getPlayers().values()) {
|
||||
if (player.hasPermission(Captions.PERMISSION_ADMIN.s())) {
|
||||
if (player.hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
player.sendMessage(Captions.color(s));
|
||||
}
|
||||
}
|
||||
@ -331,17 +331,17 @@ public class MainUtil {
|
||||
*/
|
||||
@Nonnull public static String getName(UUID owner) {
|
||||
if (owner == null) {
|
||||
return Captions.NONE.s();
|
||||
return Captions.NONE.getTranslated();
|
||||
}
|
||||
if (owner.equals(DBFunc.EVERYONE)) {
|
||||
return Captions.EVERYONE.s();
|
||||
return Captions.EVERYONE.getTranslated();
|
||||
}
|
||||
if (owner.equals(DBFunc.SERVER)) {
|
||||
return Captions.SERVER.s();
|
||||
return Captions.SERVER.getTranslated();
|
||||
}
|
||||
String name = UUIDHandler.getName(owner);
|
||||
if (name == null) {
|
||||
return Captions.UNKNOWN.s();
|
||||
return Captions.UNKNOWN.getTranslated();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
@ -588,10 +588,11 @@ public class MainUtil {
|
||||
public static boolean sendMessage(CommandCaller player, String msg, boolean prefix) {
|
||||
if (!msg.isEmpty()) {
|
||||
if (player == null) {
|
||||
String message = (prefix ? Captions.PREFIX.s() : "") + msg;
|
||||
String message = (prefix ? Captions.PREFIX.getTranslated() : "") + msg;
|
||||
PlotSquared.log(message);
|
||||
} else {
|
||||
player.sendMessage((prefix ? Captions.PREFIX.s() : "") + Captions.color(msg));
|
||||
player.sendMessage(
|
||||
(prefix ? Captions.PREFIX.getTranslated() : "") + Captions.color(msg));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -617,7 +618,7 @@ public class MainUtil {
|
||||
*/
|
||||
public static boolean sendMessage(final CommandCaller player, final Captions caption,
|
||||
final Object... args) {
|
||||
if (caption.s().isEmpty()) {
|
||||
if (caption.getTranslated().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
TaskManager.runTaskAsync(() -> {
|
||||
@ -713,7 +714,7 @@ public class MainUtil {
|
||||
public static void format(String info, final Plot plot, PlotPlayer player, final boolean full,
|
||||
final RunnableVal<String> whenDone) {
|
||||
int num = plot.getConnectedPlots().size();
|
||||
String alias = !plot.getAlias().isEmpty() ? plot.getAlias() : Captions.NONE.s();
|
||||
String alias = !plot.getAlias().isEmpty() ? plot.getAlias() : Captions.NONE.getTranslated();
|
||||
Location bot = plot.getCorners()[0];
|
||||
String biome = WorldUtil.IMP.getBiome(plot.getWorldName(), bot.getX(), bot.getZ());
|
||||
String trusted = getPlayerList(plot.getTrusted());
|
||||
@ -722,28 +723,27 @@ public class MainUtil {
|
||||
String seen;
|
||||
if (Settings.Enabled_Components.PLOT_EXPIRY && ExpireManager.IMP != null) {
|
||||
if (plot.isOnline()) {
|
||||
seen = Captions.NOW.s();
|
||||
seen = Captions.NOW.getTranslated();
|
||||
} else {
|
||||
int time = (int) (ExpireManager.IMP.getAge(plot) / 1000);
|
||||
if (time != 0) {
|
||||
seen = MainUtil.secToTime(time);
|
||||
} else {
|
||||
seen = Captions.UNKNOWN.s();
|
||||
seen = Captions.UNKNOWN.getTranslated();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
seen = Captions.NEVER.s();
|
||||
seen = Captions.NEVER.getTranslated();
|
||||
}
|
||||
Optional<String> descriptionFlag = plot.getFlag(Flags.DESCRIPTION);
|
||||
String description = !descriptionFlag.isPresent() ?
|
||||
Captions.NONE.s() :
|
||||
String description = !descriptionFlag.isPresent() ? Captions.NONE.getTranslated() :
|
||||
Flags.DESCRIPTION.valueToString(descriptionFlag.get());
|
||||
|
||||
StringBuilder flags = new StringBuilder();
|
||||
HashMap<Flag<?>, Object> flagMap =
|
||||
FlagManager.getPlotFlags(plot.getArea(), plot.getSettings(), true);
|
||||
if (flagMap.isEmpty()) {
|
||||
flags.append(Captions.NONE.s());
|
||||
flags.append(Captions.NONE.getTranslated());
|
||||
} else {
|
||||
String prefix = "";
|
||||
for (Entry<Flag<?>, Object> entry : flagMap.entrySet()) {
|
||||
@ -837,11 +837,11 @@ public class MainUtil {
|
||||
public static String getPlayerList(Collection<UUID> uuids) {
|
||||
ArrayList<UUID> l = new ArrayList<>(uuids);
|
||||
if (l.size() < 1) {
|
||||
return Captions.NONE.s();
|
||||
return Captions.NONE.getTranslated();
|
||||
}
|
||||
List<String> users =
|
||||
l.stream().map(MainUtil::getName).sorted().collect(Collectors.toList());
|
||||
String c = Captions.PLOT_USER_LIST.s();
|
||||
String c = Captions.PLOT_USER_LIST.getTranslated();
|
||||
StringBuilder list = new StringBuilder();
|
||||
for (int x = 0; x < users.size(); x++) {
|
||||
if (x + 1 == l.size()) {
|
||||
|
@ -15,7 +15,7 @@ import java.util.HashMap;
|
||||
public class Permissions {
|
||||
|
||||
public static boolean hasPermission(PlotPlayer player, Captions caption, boolean notify) {
|
||||
return hasPermission(player, caption.s(), notify);
|
||||
return hasPermission(player, caption.getTranslated(), notify);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@ public class Permissions {
|
||||
* @return
|
||||
*/
|
||||
public static boolean hasPermission(PlotPlayer player, Captions caption) {
|
||||
return hasPermission(player, caption.s());
|
||||
return hasPermission(player, caption.getTranslated());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ public class Permissions {
|
||||
} else if (caller.isPermissionSet(permission)) {
|
||||
return false;
|
||||
}
|
||||
if (caller.hasPermission(Captions.PERMISSION_ADMIN.s())) {
|
||||
if (caller.hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) {
|
||||
return true;
|
||||
}
|
||||
permission = permission.toLowerCase().replaceAll("^[^a-z|0-9|\\.|_|-]", "");
|
||||
@ -76,7 +76,7 @@ public class Permissions {
|
||||
StringBuilder n = new StringBuilder();
|
||||
for (int i = 0; i <= (nodes.length - 1); i++) {
|
||||
n.append(nodes[i] + ".");
|
||||
String combined = n + Captions.PERMISSION_STAR.s();
|
||||
String combined = n + Captions.PERMISSION_STAR.getTranslated();
|
||||
if (!permission.equals(combined)) {
|
||||
if (caller.hasPermission(combined)) {
|
||||
return true;
|
||||
@ -107,7 +107,7 @@ public class Permissions {
|
||||
}
|
||||
|
||||
public static int hasPermissionRange(PlotPlayer player, Captions perm, int range) {
|
||||
return hasPermissionRange(player, perm.s(), range);
|
||||
return hasPermissionRange(player, perm.getTranslated(), range);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -102,7 +102,7 @@ public class UUIDHandler {
|
||||
return null;
|
||||
}
|
||||
if (uuid != null && uuid.equals(DBFunc.SERVER)) {
|
||||
return Captions.SERVER.s();
|
||||
return Captions.SERVER.getTranslated();
|
||||
}
|
||||
return implementation.getName(uuid);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class HelpObject {
|
||||
private final String _rendered;
|
||||
|
||||
public HelpObject(final Command command, final String label) {
|
||||
_rendered = StringMan.replaceAll(Captions.HELP_ITEM.s(), "%usage%",
|
||||
_rendered = StringMan.replaceAll(Captions.HELP_ITEM.getTranslated(), "%usage%",
|
||||
command.getUsage().replaceAll("\\{label\\}", label), "[%alias%]",
|
||||
!command.getAliases().isEmpty() ?
|
||||
"(" + StringMan.join(command.getAliases(), "|") + ")" :
|
||||
|
@ -16,7 +16,7 @@ public class HelpPage {
|
||||
|
||||
public HelpPage(CommandCategory category, int currentPage, int maxPages) {
|
||||
this.helpObjects = new ArrayList<>();
|
||||
this.header = Captions.HELP_PAGE_HEADER.s()
|
||||
this.header = Captions.HELP_PAGE_HEADER.getTranslated()
|
||||
.replace("%category%", category == null ? "ALL" : category.toString())
|
||||
.replace("%current%", (currentPage + 1) + "").replace("%max%", (maxPages + 1) + "");
|
||||
}
|
||||
@ -25,8 +25,9 @@ public class HelpPage {
|
||||
if (this.helpObjects.size() < 1) {
|
||||
MainUtil.sendMessage(player, Captions.NOT_VALID_NUMBER, "(0)");
|
||||
} else {
|
||||
String message = Captions.HELP_HEADER.s() + "\n" + this.header + "\n" + StringMan
|
||||
.join(this.helpObjects, "\n") + "\n" + Captions.HELP_FOOTER.s();
|
||||
String message =
|
||||
Captions.HELP_HEADER.getTranslated() + "\n" + this.header + "\n" + StringMan
|
||||
.join(this.helpObjects, "\n") + "\n" + Captions.HELP_FOOTER.getTranslated();
|
||||
MainUtil.sendMessage(player, message, false);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user