update pagination to new json

This commit is contained in:
dordsor21 2020-08-06 12:23:47 +01:00
parent f1e3902fea
commit 4a960d9f2c
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
7 changed files with 129 additions and 72 deletions

View File

@ -31,6 +31,8 @@ import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil; import com.plotsquared.core.configuration.ConfigurationUtil;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.configuration.file.YamlConfiguration;
@ -73,6 +75,7 @@ import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@ -596,7 +599,7 @@ public class Area extends SubCommand {
Template regionTemplate = Template.of("name", region); Template regionTemplate = Template.of("name", region);
Template generatorTemplate = Template.of("name", generator); Template generatorTemplate = Template.of("name", generator);
Template footerTemplate = Template.of("name", TranslatableCaption.of("info.plot_info_footer").getComponent(player)); Template footerTemplate = Template.of("name", TranslatableCaption.of("info.plot_info_footer").getComponent(player));
player.sendMessage(TranslatableCaption.of("info.area_format"), headerTemplate, nameTemplate, typeTemplate, terrainTemplate, player.sendMessage(TranslatableCaption.of("info.area_info_format"), headerTemplate, nameTemplate, typeTemplate, terrainTemplate,
usageTemplate, claimedTemplate, clustersTemplate, regionTemplate, generatorTemplate, footerTemplate); usageTemplate, claimedTemplate, clustersTemplate, regionTemplate, generatorTemplate, footerTemplate);
return true; return true;
} }
@ -627,8 +630,8 @@ public class Area extends SubCommand {
} }
final List<PlotArea> areas = new ArrayList<>(Arrays.asList(this.plotAreaManager.getAllPlotAreas())); final List<PlotArea> areas = new ArrayList<>(Arrays.asList(this.plotAreaManager.getAllPlotAreas()));
paginate(player, areas, 8, page, paginate(player, areas, 8, page,
new RunnableVal3<Integer, PlotArea, Caption>() { new RunnableVal3<Integer, PlotArea, CaptionHolder>() {
@Override public void run(Integer i, PlotArea area, Caption message) { @Override public void run(Integer i, PlotArea area, CaptionHolder caption) {
String name; String name;
double percent; double percent;
int claimed = area.getPlotCount(); int claimed = area.getPlotCount();
@ -645,27 +648,29 @@ public class Area extends SubCommand {
region = area.getRegion().toString(); region = area.getRegion().toString();
} else { } else {
name = area.getWorldName(); name = area.getWorldName();
percent = claimed == 0 ? percent = claimed == 0 ? 0 : Short.MAX_VALUE * Short.MAX_VALUE / (double) claimed;
0 :
Short.MAX_VALUE * Short.MAX_VALUE / (double) claimed;
region = "N/A"; region = "N/A";
} }
PlotMessage tooltip = new PlotMessage().text("Claimed=").color("$1") Template claimedTemplate = Template.of("claimed", String.valueOf(claimed));
.text(String.valueOf(claimed)).color("$2").text("\nUsage=") Template usageTemplate = Template.of("usage", String.format("%.2f", percent) + "%");
.color("$1").text(String.format("%.2f", percent) + '%').color("$2") Template clustersTemplate = Template.of("clusters", String.valueOf(clusters));
.text("\nClusters=").color("$1").text(String.valueOf(clusters)) Template regionTemplate = Template.of("region", region);
.color("$2").text("\nRegion=").color("$1").text(region).color("$2") Template generatorTemplate = Template.of("generator", generator);
.text("\nGenerator=").color("$1").text(generator).color("$2"); String tooltip = MINI_MESSAGE.serialize(MINI_MESSAGE
.parse(TranslatableCaption.of("info.area_list_tooltip").getComponent(player), claimedTemplate, usageTemplate,
// type / terrain clustersTemplate, regionTemplate, generatorTemplate));
String visit = "/plot area tp " + area.toString(); Template tooltipTemplate = Template.of("hover_info", tooltip);
message.text("[").color("$3").text(String.valueOf(i)).command(visit) Template visitcmdTemplate = Template.of("command_tp", "/plot area tp " + area.toString());
.tooltip(visit).color("$1").text("]").color("$3").text(' ' + name) Template numberTemplate = Template.of("number", String.valueOf(i));
.tooltip(tooltip).command(getCommandString() + " info " + area) Template nameTemplate = Template.of("area_name", name);
.color("$1").text(" - ").color("$2") Template typeTemplate = Template.of("area_type", area.getType().name());
.text(area.getType() + ":" + area.getTerrain()).color("$3"); Template terrainTemplate = Template.of("area_terrain", area.getTerrain().name());
Caption item = TranslatableCaption.of("info.area_list_item");
caption.set(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE
.parse(item.getComponent(player), tooltipTemplate, visitcmdTemplate, numberTemplate, nameTemplate, typeTemplate,
terrainTemplate))));
} }
}, "/plot area list", Captions.AREA_LIST_HEADER_PAGED.getTranslated()); }, "/plot area list", TranslatableCaption.of("list.area_list_header_paged"));
return true; return true;
case "regen": case "regen":
case "clear": case "clear":

View File

@ -26,9 +26,10 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.permissions.PermissionHolder;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.util.MathMan; import com.plotsquared.core.util.MathMan;
import com.plotsquared.core.util.Permissions; import com.plotsquared.core.util.Permissions;
@ -36,7 +37,7 @@ import com.plotsquared.core.util.StringComparison;
import com.plotsquared.core.util.StringMan; import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.RunnableVal2; import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3; import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.permissions.PermissionHolder; import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -55,6 +56,8 @@ import java.util.concurrent.CompletableFuture;
public abstract class Command { public abstract class Command {
static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build();
// May be none // May be none
private final ArrayList<Command> allCommands = new ArrayList<>(); private final ArrayList<Command> allCommands = new ArrayList<>();
private final ArrayList<Command> dynamicCommands = new ArrayList<>(); private final ArrayList<Command> dynamicCommands = new ArrayList<>();
@ -82,7 +85,7 @@ public abstract class Command {
this.permission = permission; this.permission = permission;
this.required = required; this.required = required;
this.category = category; this.category = category;
this.aliases = Arrays.asList(id); this.aliases = Collections.singletonList(id);
if (this.parent != null) { if (this.parent != null) {
this.parent.register(this); this.parent.register(this);
} }
@ -98,7 +101,7 @@ public abstract class Command {
for (final Method method : getClass().getDeclaredMethods()) { for (final Method method : getClass().getDeclaredMethods()) {
if (method.isAnnotationPresent(CommandDeclaration.class)) { if (method.isAnnotationPresent(CommandDeclaration.class)) {
Class<?>[] types = method.getParameterTypes(); Class<?>[] types = method.getParameterTypes();
// final PlotPlayer player, String[] args, RunnableVal3<Command,Runnable,Runnable> confirm, RunnableVal2<Command, CommandResult> // final PlotPlayer<?> player, String[] args, RunnableVal3<Command,Runnable,Runnable> confirm, RunnableVal2<Command, CommandResult>
// whenDone // whenDone
if (types.length == 5 && types[0] == Command.class && types[1] == PlotPlayer.class if (types.length == 5 && types[0] == Command.class && types[1] == PlotPlayer.class
&& types[2] == String[].class && types[3] == RunnableVal3.class && types[2] == String[].class && types[3] == RunnableVal3.class
@ -138,7 +141,7 @@ public abstract class Command {
return this.id; return this.id;
} }
public List<Command> getCommands(PlotPlayer player) { public List<Command> getCommands(PlotPlayer<?> player) {
List<Command> commands = new ArrayList<>(); List<Command> commands = new ArrayList<>();
for (Command cmd : this.allCommands) { for (Command cmd : this.allCommands) {
if (cmd.canExecute(player, false)) { if (cmd.canExecute(player, false)) {
@ -148,7 +151,7 @@ public abstract class Command {
return commands; return commands;
} }
public List<Command> getCommands(CommandCategory category, PlotPlayer player) { public List<Command> getCommands(CommandCategory category, PlotPlayer<?> player) {
List<Command> commands = getCommands(player); List<Command> commands = getCommands(player);
if (category != null) { if (category != null) {
commands.removeIf(command -> command.category != category); commands.removeIf(command -> command.category != category);
@ -226,12 +229,12 @@ public abstract class Command {
} }
public <T> void paginate(PlotPlayer<?> player, List<T> c, int size, int page, public <T> void paginate(PlotPlayer<?> player, List<T> c, int size, int page,
RunnableVal3<Integer, T, Caption> add, String baseCommand, String header) { RunnableVal3<Integer, T, CaptionHolder> add, String baseCommand, Caption header) {
// Calculate pages & index // Calculate pages & index
if (page < 0) { if (page < 0) {
page = 0; page = 0;
} }
int totalPages = (int) Math.ceil(c.size() / size); int totalPages = (int) Math.ceil((double) c.size() / size);
if (page > totalPages) { if (page > totalPages) {
page = totalPages; page = totalPages;
} }
@ -240,35 +243,39 @@ public abstract class Command {
max = c.size(); max = c.size();
} }
// Send the header // Send the header
header = header.replaceAll("%cur", page + 1 + "").replaceAll("%max", totalPages + 1 + "") Template curTemplate = Template.of("cur", String.valueOf(page + 1));
.replaceAll("%amount%", c.size() + "").replaceAll("%word%", "all"); Template maxTemplate = Template.of("max", String.valueOf(totalPages + 1));
player.sendMessage(StaticCaption.of(header)); Template amountTemplate = Template.of("amount", String.valueOf(c.size()));
player.sendMessage(header, curTemplate, maxTemplate, amountTemplate);
// Send the page content // Send the page content
List<T> subList = c.subList(page * size, max); List<T> subList = c.subList(page * size, max);
int i = page * size; int i = page * size;
for (T obj : subList) { for (T obj : subList) {
i++; i++;
PlotMessage msg = new PlotMessage(); CaptionHolder msg = new CaptionHolder();
add.run(i, obj, msg); add.run(i, obj, msg);
msg.send(player); player.sendMessage(msg.get());
} }
// Send the footer // Send the footer
if (page < totalPages && page > 0) { // Back | Next if (page < totalPages && page > 0) { // Back | Next
new PlotMessage().text("<-").color("$1").command(baseCommand + " " + page).text(" | ") Template command1 = Template.of("command1", baseCommand + " " + page);
.color("$3").text("->").color("$1").command(baseCommand + " " + (page + 2)) Template command2 = Template.of("command2", baseCommand + " " + (page + 2));
.text(Captions.CLICKABLE.getTranslated()).color("$2").send(player); Template clickable = Template.of("clickable", TranslatableCaption.of("list.clickable").getComponent(player));
player.sendMessage(TranslatableCaption.of("list.page_turn"), command1, command2, clickable);
return; return;
} }
if (page == 0 && totalPages != 0) { // Next if (page == 0 && totalPages != 0) { // Next
new PlotMessage().text("<-").color("$3").text(" | ").color("$3").text("->").color("$1") Template command1 = Template.of("command1", "");
.command(baseCommand + " " + 2).text(Captions.CLICKABLE.getTranslated()).color("$2") Template command2 = Template.of("command2", baseCommand + " " + (page + 2));
.send(player); Template clickable = Template.of("clickable", TranslatableCaption.of("list.clickable").getComponent(player));
player.sendMessage(TranslatableCaption.of("list.page_turn"), command1, command2, clickable);
return; return;
} }
if (totalPages != 0) { // Back if (totalPages != 0) { // Back
new PlotMessage().text("<-").color("$1").command(baseCommand + " " + page).text(" | ") Template command1 = Template.of("command1", "");
.color("$3").text("->").color("$3").text(Captions.CLICKABLE.getTranslated()) Template command2 = Template.of("command2", "");
.color("$2").send(player); Template clickable = Template.of("clickable", TranslatableCaption.of("list.clickable").getComponent(player));
player.sendMessage(TranslatableCaption.of("list.page_turn"), command1, command2, clickable);
} }
} }
@ -351,7 +358,7 @@ public abstract class Command {
return CompletableFuture.completedFuture(true); return CompletableFuture.completedFuture(true);
} }
public boolean checkArgs(PlotPlayer player, String[] args) { public boolean checkArgs(PlotPlayer<?> player, String[] args) {
Argument<?>[] reqArgs = getRequiredArguments(); Argument<?>[] reqArgs = getRequiredArguments();
if (reqArgs != null && reqArgs.length > 0) { if (reqArgs != null && reqArgs.length > 0) {
boolean failed = args.length < reqArgs.length; boolean failed = args.length < reqArgs.length;
@ -446,7 +453,7 @@ public abstract class Command {
return null; return null;
} }
public boolean canExecute(PlotPlayer player, boolean message) { public boolean canExecute(PlotPlayer<?> player, boolean message) {
if (player == null) { if (player == null) {
return true; return true;
} }
@ -502,7 +509,7 @@ public abstract class Command {
return getCommandString() + " " + args + "]"; return getCommandString() + " " + args + "]";
} }
public Collection<Command> tabOf(PlotPlayer player, String[] input, boolean space, public Collection<Command> tabOf(PlotPlayer<?> player, String[] input, boolean space,
String... args) { String... args) {
if (!space) { if (!space) {
return null; return null;
@ -523,7 +530,7 @@ public abstract class Command {
return result; return result;
} }
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
switch (args.length) { switch (args.length) {
case 0: case 0:
return this.allCommands; return this.allCommands;
@ -537,7 +544,7 @@ public abstract class Command {
return null; return null;
} }
} else { } else {
Set<Command> commands = new HashSet<Command>(); Set<Command> commands = new HashSet<>();
for (Map.Entry<String, Command> entry : this.staticCommands.entrySet()) { for (Map.Entry<String, Command> entry : this.staticCommands.entrySet()) {
if (entry.getKey().startsWith(arg) && entry.getValue() if (entry.getKey().startsWith(arg) && entry.getValue()
.canExecute(player, false)) { .canExecute(player, false)) {

View File

@ -27,10 +27,10 @@ package com.plotsquared.core.command;
import com.google.common.io.Files; import com.google.common.io.Files;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.internal.cglib.transform.$ClassTransformer;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
@ -414,15 +414,15 @@ public class DebugExec extends SubCommand {
} }
List<File> allFiles = Arrays.asList(filesArray); List<File> allFiles = Arrays.asList(filesArray);
paginate(player, allFiles, 8, page, paginate(player, allFiles, 8, page, new RunnableVal3<Integer, File, CaptionHolder>() {
new RunnableVal3<Integer, File, PlotMessage>() { @Override public void run(Integer i, File file, CaptionHolder message) {
String name = file.getName();
@Override public void run(Integer i, File file, PlotMessage message) { Template numTemplate = Template.of("number", String.valueOf(i));
String name = file.getName(); Template nameTemplate = Template.of("name", name);
message.text("[").color("$3").text(String.valueOf(i)).color("$1") message.set(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE
.text("]").color("$3").text(' ' + name).color("$1"); .parse(TranslatableCaption.of("debugexec.script_list_item").getComponent(player), numTemplate, nameTemplate))));
} }
}, "/plot debugexec list-scripts", "List of scripts"); }, "/plot debugexec list-scripts", StaticCaption.of("List of scripts"));
return true; return true;
case "all": case "all":
if (args.length < 3) { if (args.length < 3) {

View File

@ -29,6 +29,7 @@ import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
@ -47,6 +48,7 @@ import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.TabCompletions; import com.plotsquared.core.util.TabCompletions;
import com.plotsquared.core.util.query.PlotQuery; import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.query.SortingStrategy; import com.plotsquared.core.util.query.SortingStrategy;
import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDMapping;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
@ -356,12 +358,12 @@ public class ListCmd extends SubCommand {
return true; return true;
} }
public void displayPlots(final PlotPlayer player, List<Plot> plots, int pageSize, int page, String[] args) { public void displayPlots(final PlotPlayer<?> player, List<Plot> plots, int pageSize, int page, String[] args) {
// Header // Header
plots.removeIf(plot -> !plot.isBasePlot()); plots.removeIf(plot -> !plot.isBasePlot());
this.paginate(player, plots, pageSize, page, this.paginate(player, plots, pageSize, page,
new RunnableVal3<Integer, Plot, PlotMessage>() { new RunnableVal3<Integer, Plot, CaptionHolder>() {
@Override public void run(Integer i, Plot plot, PlotMessage message) { @Override public void run(Integer i, Plot plot, CaptionHolder caption) {
String color; String color;
if (plot.getOwner() == null) { if (plot.getOwner() == null) {
color = "$3"; color = "$3";
@ -420,10 +422,10 @@ public class ListCmd extends SubCommand {
player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout")); player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout"));
} }
} }
}, "/plot list " + args[0], Captions.PLOT_LIST_HEADER_PAGED.getTranslated()); }, "/plot list " + args[0], TranslatableCaption.of("list.plot_list_header_paged"));
} }
@Override public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) { @Override public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<String> completions = new LinkedList<>(); final List<String> completions = new LinkedList<>();
if (this.econHandler != null && Permissions if (this.econHandler != null && Permissions
.hasPermission(player, Captions.PERMISSION_LIST_FOR_SALE)) { .hasPermission(player, Captions.PERMISSION_LIST_FOR_SALE)) {
@ -454,11 +456,9 @@ public class ListCmd extends SubCommand {
completions.add("expired"); completions.add("expired");
} }
final List<Command> commands = new LinkedList<>(); final List<Command> commands = completions.stream().filter(completion -> completion.toLowerCase().startsWith(args[0].toLowerCase()))
commands.addAll(completions.stream() .map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) {
.filter(completion -> completion.toLowerCase().startsWith(args[0].toLowerCase())) }).collect(Collectors.toCollection(LinkedList::new));
.map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) {})
.collect(Collectors.toList()));
if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_PLAYER) && args[0].length() > 0) { if (Permissions.hasPermission(player, Captions.PERMISSION_LIST_PLAYER) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList()));

View File

@ -0,0 +1,41 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) ${year} IntellectualSites
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.plotsquared.core.configuration.caption;
public class CaptionHolder {
private Caption caption = StaticCaption.of("");
public void set(Caption caption) {
this.caption = caption;
}
public Caption get() {
return this.caption;
}
}

View File

@ -46,7 +46,7 @@ public abstract class BlockTypeListFlag<F extends ListFlag<BlockTypeWrapper, F>>
public static boolean skipCategoryVerification = false; public static boolean skipCategoryVerification = false;
protected BlockTypeListFlag(List<BlockTypeWrapper> blockTypeList, Caption description) { protected BlockTypeListFlag(List<BlockTypeWrapper> blockTypeList, Caption description) {
super(blockTypeList, Captions.FLAG_CATEGORY_BLOCK_LIST, description); super(blockTypeList, TranslatableCaption.of("flags.flag_category_block_list"), description);
} }
@Override public F parse(@Nonnull String input) throws FlagParseException { @Override public F parse(@Nonnull String input) throws FlagParseException {

View File

@ -280,6 +280,7 @@
"debugexec.task_not_running": "<prefix><gray>Task not running.</gray>", "debugexec.task_not_running": "<prefix><gray>Task not running.</gray>",
"debugexec.expiry_started": "<prefix><gold>Started plot expiry task.</gold>", "debugexec.expiry_started": "<prefix><gold>Started plot expiry task.</gold>",
"debugexec.expiry_already_started": "<prefix><gold>Plot expiry task already started.</gold>", "debugexec.expiry_already_started": "<prefix><gold>Plot expiry task already started.</gold>",
"debugexec.script_list_item": "<dark_grey>[</dark_grey><gold><number></gold><dark_grey>]</dark_grey><gold> <name></gold>",
"debugimportworlds.single_plot_area": "<prefix><red>Must be a single plot area.</red>", "debugimportworlds.single_plot_area": "<prefix><red>Must be a single plot area.</red>",
"debugimportworlds.world_container": "<prefix><red>World container must be configured to be a separate directory to your base files.</red>", "debugimportworlds.world_container": "<prefix><red>World container must be configured to be a separate directory to your base files.</red>",
@ -375,8 +376,10 @@
"info.plot_no_description": "<prefix><gray>No description set.</gray>", "info.plot_no_description": "<prefix><gray>No description set.</gray>",
"info.plot_caps_header": "<dark_gray><strikethrough>--------- <reset><gold>CAPS </gold><dark_gray><strikethrough>---------<reset>", "info.plot_caps_header": "<dark_gray><strikethrough>--------- <reset><gold>CAPS </gold><dark_gray><strikethrough>---------<reset>",
"info.plot_caps_format": "<prefix><gray>- Cap Type: </gray><gold><cap> </gold><gray>| Status: </gray><gold><current></gold><gray>/</gray><gold><limit> </gold><gray>(</gray><gold><percentage>%</gold><gray>)</gray>", "info.plot_caps_format": "<prefix><gray>- Cap Type: </gray><gold><cap> </gold><gray>| Status: </gray><gold><current></gold><gray>/</gray><gold><limit> </gold><gray>(</gray><gold><percentage>%</gold><gray>)</gray>",
"info.area_format": "<header>\n<reset><gold>NAME: </gold><grey><name></grey>\n<gold>Type: </gold><grey><type></grey>\n<gold>Terrain: </gold><grey><terrain></grey>\n<gold>Usage: </gold><grey><usage>%</grey>\n<gold>Claimed: </gold><grey><claimed></grey>\n<gold>Clusters: </gold><grey><clusters></grey>\n<gold>Region: </gold><grey><region></grey>\n<gold>Generator: </gold><grey><generator></grey>\n<footer>", "info.area_info_format": "<header>\n<reset><gold>NAME: </gold><grey><name></grey>\n<gold>Type: </gold><grey><type></grey>\n<gold>Terrain: </gold><grey><terrain></grey>\n<gold>Usage: </gold><grey><usage>%</grey>\n<gold>Claimed: </gold><grey><claimed></grey>\n<gold>Clusters: </gold><grey><clusters></grey>\n<gold>Region: </gold><grey><region></grey>\n<gold>Generator: </gold><grey><generator></grey>\n<footer>",
"info.area_list_tooltip": "<gold>Claimed=</gold><grey><claimed></grey>\n<gold>Usage=</gold><grey><usage></grey>\n<gold>Clusters=</gold><grey><clusters></grey>\n<gold>Region=</gold><grey><region></grey>\n<gold>Generator=</gold><grey><generator></grey>\n",
"info.area_list_item": "<click:run_command:<command_tp>><hover:show_text:<command_tp>><dark_grey>[</dark_grey><gold><number></gold><dark_grey>]</dark_grey></hover></click><click:run_command:<command_info>><hover:show_text:<hover_info>><gold> <area_name></gold></hover></click><grey> - </grey><dark_grey><area_type>:<area_terrain></dark_grey>",
"working.generating_component": "<prefix><gold>Started generating component from your settings.</gold>", "working.generating_component": "<prefix><gold>Started generating component from your settings.</gold>",
"working.clearing_done": "<prefix><dark_aqua>Clear completed! Took <amount>ms.</dark_aqua>", "working.clearing_done": "<prefix><dark_aqua>Clear completed! Took <amount>ms.</dark_aqua>",
"working.deleting_done": "<prefix><dark_aqua>Delete completed! Took <amount>ms.</dark_aqua>", "working.deleting_done": "<prefix><dark_aqua>Delete completed! Took <amount>ms.</dark_aqua>",
@ -389,7 +392,8 @@
"list.area_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gold><gray>) </gray><gold>List of <amount> areas</gold>", "list.area_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gold><gray>) </gray><gold>List of <amount> areas</gold>",
"list.plot_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gray><gray>) </gray><gold>List of <amount> plots</gold>", "list.plot_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gray><gray>) </gray><gold>List of <amount> plots</gold>",
"list.plot_list_header": "<prefix><gold>List of <word> plots.</gold>", "list.plot_list_header": "<prefix><gold>List of <word> plots.</gold>",
"list.page_turn": "<gold><click:run_command:<command1>><-</click></gold><dark_gray> | </dark_gray><gold><click:run_command:<command2>>-></click></gold><grey><clickable></grey>",
"chat.plot_chat_spy_format": "<gray>[<gold>Plot Spy</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>", "chat.plot_chat_spy_format": "<gray>[<gold>Plot Spy</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
"chat.plot_chat_format": "<gray>[<gold>Plot Chat</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>", "chat.plot_chat_format": "<gray>[<gold>Plot Chat</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
"chat.plot_chat_forced": "<prefix><gray>This world forces everyone to use plot chat.</gray>", "chat.plot_chat_forced": "<prefix><gray>This world forces everyone to use plot chat.</gray>",