mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
More work towards json
This commit is contained in:
parent
d3fe1d3b2b
commit
41a623a643
@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core;
|
package com.plotsquared.core;
|
||||||
|
|
||||||
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.MemorySection;
|
import com.plotsquared.core.configuration.MemorySection;
|
||||||
@ -34,7 +33,6 @@ import com.plotsquared.core.configuration.Storage;
|
|||||||
import com.plotsquared.core.configuration.caption.CaptionLoader;
|
import com.plotsquared.core.configuration.caption.CaptionLoader;
|
||||||
import com.plotsquared.core.configuration.caption.CaptionMap;
|
import com.plotsquared.core.configuration.caption.CaptionMap;
|
||||||
import com.plotsquared.core.configuration.caption.DummyCaptionMap;
|
import com.plotsquared.core.configuration.caption.DummyCaptionMap;
|
||||||
import com.plotsquared.core.configuration.caption.LocalizedCaptionMap;
|
|
||||||
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;
|
||||||
import com.plotsquared.core.configuration.serialization.ConfigurationSerialization;
|
import com.plotsquared.core.configuration.serialization.ConfigurationSerialization;
|
||||||
@ -67,10 +65,8 @@ import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
|||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.FileUtils;
|
import com.plotsquared.core.util.FileUtils;
|
||||||
import com.plotsquared.core.util.LegacyConverter;
|
import com.plotsquared.core.util.LegacyConverter;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.ReflectionUtils;
|
import com.plotsquared.core.util.ReflectionUtils;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.plotsquared.core.uuid.UUIDPipeline;
|
import com.plotsquared.core.uuid.UUIDPipeline;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
@ -1330,20 +1326,20 @@ public class PlotSquared {
|
|||||||
.equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) && !this.worldConfiguration
|
.equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) && !this.worldConfiguration
|
||||||
.getString("configuration_version").equalsIgnoreCase("v5"))) {
|
.getString("configuration_version").equalsIgnoreCase("v5"))) {
|
||||||
// Conversion needed
|
// Conversion needed
|
||||||
logger.info(Captions.LEGACY_CONFIG_FOUND.getTranslated());
|
logger.info("[P2] &aA legacy configuration file was detected. Conversion will be attempted.");
|
||||||
try {
|
try {
|
||||||
com.google.common.io.Files
|
com.google.common.io.Files
|
||||||
.copy(this.worldsFile, new File(folder, "worlds.yml.old"));
|
.copy(this.worldsFile, new File(folder, "worlds.yml.old"));
|
||||||
logger.info(Captions.LEGACY_CONFIG_BACKUP.getTranslated());
|
logger.info("[P2] &6A copy of worlds.yml has been saved in the file worlds.yml.old");
|
||||||
final ConfigurationSection worlds =
|
final ConfigurationSection worlds =
|
||||||
this.worldConfiguration.getConfigurationSection("worlds");
|
this.worldConfiguration.getConfigurationSection("worlds");
|
||||||
final LegacyConverter converter = new LegacyConverter(worlds);
|
final LegacyConverter converter = new LegacyConverter(worlds);
|
||||||
converter.convert();
|
converter.convert();
|
||||||
this.worldConfiguration.set("worlds", worlds);
|
this.worldConfiguration.set("worlds", worlds);
|
||||||
this.setConfigurationVersion(LegacyConverter.CONFIGURATION_VERSION);
|
this.setConfigurationVersion(LegacyConverter.CONFIGURATION_VERSION);
|
||||||
logger.info(Captions.LEGACY_CONFIG_DONE.getTranslated());
|
logger.info("[P2] &aThe conversion has finished. PlotSquared will now be disabled and the new configuration file will be used at next startup. Please review the new worlds.yml file. Please note that schematics will not be converted, as we are now using WorldEdit to handle schematics. You need to re-generate the schematics.");
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
logger.error(Captions.LEGACY_CONFIG_CONVERSION_FAILED.getTranslated(), e);
|
logger.error("[P2] &cFailed to convert the legacy configuration file. See stack trace for information.", e);
|
||||||
}
|
}
|
||||||
// Disable plugin
|
// Disable plugin
|
||||||
this.platform.shutdown();
|
this.platform.shutdown();
|
||||||
|
@ -66,11 +66,11 @@ public class Add extends Command {
|
|||||||
public CompletableFuture<Boolean> execute(final PlotPlayer<?> player, String[] args,
|
public CompletableFuture<Boolean> execute(final PlotPlayer<?> player, String[] args,
|
||||||
RunnableVal3<Command, Runnable, Runnable> confirm,
|
RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||||
RunnableVal2<Command, CommandResult> whenDone) throws CommandException {
|
RunnableVal2<Command, CommandResult> whenDone) throws CommandException {
|
||||||
final Plot plot = check(player.getCurrentPlot(), Captions.NOT_IN_PLOT);
|
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
||||||
checkTrue(plot.hasOwner(), Captions.PLOT_UNOWNED);
|
checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
|
||||||
checkTrue(plot.isOwner(player.getUUID()) || Permissions
|
checkTrue(plot.isOwner(player.getUUID()) || Permissions
|
||||||
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST),
|
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST),
|
||||||
Captions.NO_PLOT_PERMS);
|
TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"),
|
checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"),
|
||||||
Template.of("value", "/plot add <player | *>"));
|
Template.of("value", "/plot add <player | *>"));
|
||||||
final CompletableFuture<Boolean> future = new CompletableFuture<>();
|
final CompletableFuture<Boolean> future = new CompletableFuture<>();
|
||||||
@ -116,7 +116,7 @@ public class Add extends Command {
|
|||||||
}
|
}
|
||||||
checkTrue(!uuids.isEmpty(), null);
|
checkTrue(!uuids.isEmpty(), null);
|
||||||
checkTrue(size <= plot.getArea().getMaxPlotMembers() || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST),
|
checkTrue(size <= plot.getArea().getMaxPlotMembers() || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_TRUST),
|
||||||
Captions.PLOT_MAX_MEMBERS);
|
TranslatableCaption.of("members.plot_max_members"));
|
||||||
// Success
|
// Success
|
||||||
confirm.run(this, () -> {
|
confirm.run(this, () -> {
|
||||||
for (UUID uuid : uuids) {
|
for (UUID uuid : uuids) {
|
||||||
|
@ -56,7 +56,7 @@ public class Biome extends SetCommand {
|
|||||||
}
|
}
|
||||||
if (biome == null) {
|
if (biome == null) {
|
||||||
String biomes = StringMan
|
String biomes = StringMan
|
||||||
.join(BiomeType.REGISTRY.values(), Captions.BLOCK_LIST_SEPARATOR.getTranslated());
|
.join(BiomeType.REGISTRY.values(), Captions.BLOCK_LIST_SEPARATOR.toString());
|
||||||
player.sendMessage(TranslatableCaption.of("biome.need_biome"));
|
player.sendMessage(TranslatableCaption.of("biome.need_biome"));
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("commandconfig.subcommand_set_options_header"),
|
TranslatableCaption.of("commandconfig.subcommand_set_options_header"),
|
||||||
|
@ -69,7 +69,7 @@ public class Buy extends Command {
|
|||||||
RunnableVal3<Command, Runnable, Runnable> confirm,
|
RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||||
final RunnableVal2<Command, CommandResult> whenDone) {
|
final RunnableVal2<Command, CommandResult> whenDone) {
|
||||||
|
|
||||||
check(this.econHandler, Captions.ECON_DISABLED);
|
check(this.econHandler, TranslatableCaption.of("economy.econ_disabled"));
|
||||||
final Plot plot;
|
final Plot plot;
|
||||||
if (args.length != 0) {
|
if (args.length != 0) {
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
@ -78,18 +78,18 @@ public class Buy extends Command {
|
|||||||
}
|
}
|
||||||
plot = check(Plot.getPlotFromString(player, args[0], true), null);
|
plot = check(Plot.getPlotFromString(player, args[0], true), null);
|
||||||
} else {
|
} else {
|
||||||
plot = check(player.getCurrentPlot(), Captions.NOT_IN_PLOT);
|
plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
||||||
}
|
}
|
||||||
checkTrue(plot.hasOwner(), Captions.PLOT_UNOWNED);
|
checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
|
||||||
checkTrue(!plot.isOwner(player.getUUID()), Captions.CANNOT_BUY_OWN);
|
checkTrue(!plot.isOwner(player.getUUID()), TranslatableCaption.of("economy.cannot_buy_own"));
|
||||||
Set<Plot> plots = plot.getConnectedPlots();
|
Set<Plot> plots = plot.getConnectedPlots();
|
||||||
checkTrue(player.getPlotCount() + plots.size() <= player.getAllowedPlots(),
|
checkTrue(player.getPlotCount() + plots.size() <= player.getAllowedPlots(),
|
||||||
Captions.CANT_CLAIM_MORE_PLOTS);
|
TranslatableCaption.of("permission.cant_claim_more_plots"));
|
||||||
double price = plot.getFlag(PriceFlag.class);
|
double price = plot.getFlag(PriceFlag.class);
|
||||||
if (price <= 0) {
|
if (price <= 0) {
|
||||||
throw new CommandException(Captions.NOT_FOR_SALE);
|
throw new CommandException(TranslatableCaption.of("economy.not_for_sale"));
|
||||||
}
|
}
|
||||||
checkTrue(player.getMoney() >= price, Captions.CANNOT_AFFORD_PLOT);
|
checkTrue(player.getMoney() >= price, TranslatableCaption.of("economy.cannot_afford_plot"));
|
||||||
player.withdraw(price);
|
player.withdraw(price);
|
||||||
// Failure
|
// Failure
|
||||||
// Success
|
// Success
|
||||||
|
@ -169,7 +169,8 @@ public class Claim extends SubCommand {
|
|||||||
}
|
}
|
||||||
int border = area.getBorder();
|
int border = area.getBorder();
|
||||||
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
||||||
return !sendMessage(player, Captions.BORDER);
|
player.sendMessage(TranslatableCaption.of("border.border"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
plot.setOwnerAbs(player.getUUID());
|
plot.setOwnerAbs(player.getUUID());
|
||||||
final String finalSchematic = schematic;
|
final String finalSchematic = schematic;
|
||||||
@ -177,7 +178,7 @@ public class Claim extends SubCommand {
|
|||||||
try {
|
try {
|
||||||
TaskManager.getPlatformImplementation().sync(() -> {
|
TaskManager.getPlatformImplementation().sync(() -> {
|
||||||
if (!plot.claim(player, true, finalSchematic, false)) {
|
if (!plot.claim(player, true, finalSchematic, false)) {
|
||||||
logger.info(Captions.PREFIX.getTranslated() + String
|
logger.info(TranslatableCaption.of("core.prefix") + String
|
||||||
.format("Failed to claim plot %s", plot.getId().toCommaSeparatedString()));
|
.format("Failed to claim plot %s", plot.getId().toCommaSeparatedString()));
|
||||||
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
|
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
|
||||||
plot.setOwnerAbs(null);
|
plot.setOwnerAbs(null);
|
||||||
@ -199,7 +200,7 @@ public class Claim extends SubCommand {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}, () -> {
|
}, () -> {
|
||||||
logger.info(Captions.PREFIX.getTranslated() + String
|
logger.info(TranslatableCaption.of("core.prefix") + String
|
||||||
.format("Failed to add plot %s to the database",
|
.format("Failed to add plot %s to the database",
|
||||||
plot.getId().toCommaSeparatedString()));
|
plot.getId().toCommaSeparatedString()));
|
||||||
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
|
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
|
||||||
|
@ -75,7 +75,7 @@ public class Clear extends Command {
|
|||||||
sendUsage(player);
|
sendUsage(player);
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
final Plot plot = check(player.getCurrentPlot(), Captions.NOT_IN_PLOT);
|
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
||||||
Result eventResult = this.eventDispatcher.callClear(plot).getEventResult();
|
Result eventResult = this.eventDispatcher.callClear(plot).getEventResult();
|
||||||
if (eventResult == Result.DENY) {
|
if (eventResult == Result.DENY) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -86,10 +86,10 @@ public class Clear extends Command {
|
|||||||
boolean force = eventResult == Result.FORCE;
|
boolean force = eventResult == Result.FORCE;
|
||||||
checkTrue(force || plot.isOwner(player.getUUID()) || Permissions
|
checkTrue(force || plot.isOwner(player.getUUID()) || Permissions
|
||||||
.hasPermission(player, "plots.admin.command.clear"),
|
.hasPermission(player, "plots.admin.command.clear"),
|
||||||
Captions.NO_PLOT_PERMS);
|
TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
checkTrue(plot.getRunning() == 0, Captions.WAIT_FOR_TIMER);
|
checkTrue(plot.getRunning() == 0, TranslatableCaption.of("errors.wait_for_timer"));
|
||||||
checkTrue(force || !Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot) || Permissions
|
checkTrue(force || !Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot) || Permissions
|
||||||
.hasPermission(player, "plots.continue"), Captions.DONE_ALREADY_DONE);
|
.hasPermission(player, "plots.continue"), TranslatableCaption.of("done.done_already_done"));
|
||||||
confirm.run(this, () -> {
|
confirm.run(this, () -> {
|
||||||
BackupManager.backup(player, plot, () -> {
|
BackupManager.backup(player, plot, () -> {
|
||||||
final long start = System.currentTimeMillis();
|
final long start = System.currentTimeMillis();
|
||||||
|
@ -426,7 +426,7 @@ public class Cluster extends SubCommand {
|
|||||||
.hasPermission(player, Captions.PERMISSION_CLUSTER_INVITE_OTHER)) {
|
.hasPermission(player, Captions.PERMISSION_CLUSTER_INVITE_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_INVITE_OTHER.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_INVITE_OTHER.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -466,7 +466,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_KICK)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_KICK)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_KICK.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_KICK.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -491,7 +491,7 @@ public class Cluster extends SubCommand {
|
|||||||
.hasPermission(player, Captions.PERMISSION_CLUSTER_KICK_OTHER)) {
|
.hasPermission(player, Captions.PERMISSION_CLUSTER_KICK_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_KICK_OTHER.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_KICK_OTHER.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -548,7 +548,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_LEAVE)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_LEAVE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_LEAVE.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_LEAVE.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -615,7 +615,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_HELPERS)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_HELPERS)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_HELPERS.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_HELPERS.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_TP)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_TP)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_TP.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_TP.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -699,7 +699,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_TP_OTHER)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_TP_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_TP_OTHER.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_TP_OTHER.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -714,7 +714,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_INFO)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_INFO)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_TP.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_TP.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -776,7 +776,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_SETHOME)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_CLUSTER_SETHOME)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_SETHOME.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_SETHOME.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -801,7 +801,7 @@ public class Cluster extends SubCommand {
|
|||||||
.hasPermission(player, Captions.PERMISSION_CLUSTER_SETHOME_OTHER)) {
|
.hasPermission(player, Captions.PERMISSION_CLUSTER_SETHOME_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_CLUSTER_SETHOME_OTHER.getTranslated())
|
Template.of("node", Captions.PERMISSION_CLUSTER_SETHOME_OTHER.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class Continue extends SubCommand {
|
|||||||
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_CONTINUE)) {
|
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_CONTINUE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.NO_PLOT_PERMS.getTranslated())
|
Template.of("node", Captions.NO_PLOT_PERMS.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ public class Continue extends SubCommand {
|
|||||||
< player.getPlotCount() + size)) {
|
< player.getPlotCount() + size)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_ADMIN_COMMAND_CONTINUE.getTranslated())
|
Template.of("node", Captions.PERMISSION_ADMIN_COMMAND_CONTINUE.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public class Copy extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
||||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated())) {
|
.hasPermission(player, Captions.PERMISSION_ADMIN.toString())) {
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,8 @@ public class Delete extends SubCommand {
|
|||||||
boolean force = eventResult == Result.FORCE;
|
boolean force = eventResult == Result.FORCE;
|
||||||
if (!force && !plot.isOwner(player.getUUID()) && !Permissions
|
if (!force && !plot.isOwner(player.getUUID()) && !Permissions
|
||||||
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DELETE)) {
|
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DELETE)) {
|
||||||
return !sendMessage(player, Captions.NO_PLOT_PERMS);
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
final PlotArea plotArea = plot.getArea();
|
final PlotArea plotArea = plot.getArea();
|
||||||
final java.util.Set<Plot> plots = plot.getConnectedPlots();
|
final java.util.Set<Plot> plots = plot.getConnectedPlots();
|
||||||
|
@ -69,7 +69,8 @@ public class Download extends SubCommand {
|
|||||||
@Override public boolean onCommand(final PlotPlayer<?> player, String[] args) {
|
@Override public boolean onCommand(final PlotPlayer<?> player, String[] args) {
|
||||||
String world = player.getLocation().getWorldName();
|
String world = player.getLocation().getWorldName();
|
||||||
if (!this.plotAreaManager.hasPlotArea(world)) {
|
if (!this.plotAreaManager.hasPlotArea(world)) {
|
||||||
return !sendMessage(player, Captions.NOT_IN_PLOT_WORLD);
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
final Plot plot = player.getCurrentPlot();
|
final Plot plot = player.getCurrentPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
@ -86,7 +87,7 @@ public class Download extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((!plot.isOwner(player.getUUID())) && !Permissions
|
if ((!plot.isOwner(player.getUUID())) && !Permissions
|
||||||
.hasPermission(player, Captions.PERMISSION_ADMIN.getTranslated())) {
|
.hasPermission(player, Captions.PERMISSION_ADMIN.toString())) {
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -121,7 +122,7 @@ public class Download extends SubCommand {
|
|||||||
if (!Permissions.hasPermission(player, Captions.PERMISSION_DOWNLOAD_WORLD)) {
|
if (!Permissions.hasPermission(player, Captions.PERMISSION_DOWNLOAD_WORLD)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_DOWNLOAD_WORLD.getTranslated())
|
Template.of("node", Captions.PERMISSION_DOWNLOAD_WORLD.toString())
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@CommandDeclaration(command = "grant",
|
@CommandDeclaration(command = "grant",
|
||||||
category = CommandCategory.CLAIMING,
|
category = CommandCategory.CLAIMING,
|
||||||
usage = "/plot grant <check|add> [player]",
|
usage = "/plot grant <check | add> [player]",
|
||||||
permission = "plots.grant",
|
permission = "plots.grant",
|
||||||
requiredType = RequiredType.NONE)
|
requiredType = RequiredType.NONE)
|
||||||
public class Grant extends Command {
|
public class Grant extends Command {
|
||||||
@ -61,7 +61,7 @@ public class Grant extends Command {
|
|||||||
public CompletableFuture<Boolean> execute(final PlotPlayer<?> player, String[] args,
|
public CompletableFuture<Boolean> execute(final PlotPlayer<?> player, String[] args,
|
||||||
RunnableVal3<Command, Runnable, Runnable> confirm,
|
RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||||
RunnableVal2<Command, CommandResult> whenDone) throws CommandException {
|
RunnableVal2<Command, CommandResult> whenDone) throws CommandException {
|
||||||
checkTrue(args.length >= 1 && args.length <= 2, Captions.COMMAND_SYNTAX, getUsage());
|
checkTrue(args.length >= 1 && args.length <= 2, TranslatableCaption.of("commandconfig.command_syntax"), Template.of("value", "/plot grant <check | add> [player]"));
|
||||||
final String arg0 = args[0].toLowerCase();
|
final String arg0 = args[0].toLowerCase();
|
||||||
switch (arg0) {
|
switch (arg0) {
|
||||||
case "add":
|
case "add":
|
||||||
@ -90,7 +90,8 @@ public class Grant extends Command {
|
|||||||
try (final MetaDataAccess<Integer> access = pp.accessPersistentMetaData(
|
try (final MetaDataAccess<Integer> access = pp.accessPersistentMetaData(
|
||||||
PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS)) {
|
PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS)) {
|
||||||
if (args[0].equalsIgnoreCase("check")) {
|
if (args[0].equalsIgnoreCase("check")) {
|
||||||
Captions.GRANTED_PLOTS.send(player, access.get().orElse(0));
|
player.sendMessage(TranslatableCaption.of("grants.granted_plots"),
|
||||||
|
Template.of("grants", String.valueOf(access.get().orElse(0))));
|
||||||
} else {
|
} else {
|
||||||
access.set(access.get().orElse(0) + 1);
|
access.set(access.get().orElse(0) + 1);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ public class HomeCommand extends Command {
|
|||||||
.hasPermission(player, Captions.PERMISSION_HOME)) {
|
.hasPermission(player, Captions.PERMISSION_HOME)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Captions.PERMISSION_VISIT_OWNED.getTranslated())
|
Template.of("node", Captions.PERMISSION_VISIT_OWNED.toString())
|
||||||
);
|
);
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ public class Kick extends SubCommand {
|
|||||||
Location newSpawn = this.worldUtil.getSpawn(this.plotAreaManager.getAllWorlds()[0]);
|
Location newSpawn = this.worldUtil.getSpawn(this.plotAreaManager.getAllWorlds()[0]);
|
||||||
if (plot.equals(newSpawn.getPlot())) {
|
if (plot.equals(newSpawn.getPlot())) {
|
||||||
// Kick from server if you can't be teleported to spawn
|
// Kick from server if you can't be teleported to spawn
|
||||||
player2.kick(Captions.YOU_GOT_KICKED.getTranslated());
|
player2.sendMessage(TranslatableCaption.of("kick.you_got_kicked"));
|
||||||
} else {
|
} else {
|
||||||
player2.plotkick(newSpawn);
|
player2.plotkick(newSpawn);
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ import com.plotsquared.core.util.PatternUtil;
|
|||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -134,13 +135,13 @@ public class ComponentPresetManager {
|
|||||||
final Plot plot = player.getCurrentPlot();
|
final Plot plot = player.getCurrentPlot();
|
||||||
|
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
Captions.NOT_IN_PLOT.send(player);
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return null;
|
return null;
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
Captions.PLOT_UNOWNED.send(player);
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return null;
|
return null;
|
||||||
} else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID())) {
|
} else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID())) {
|
||||||
Captions.NO_PLOT_PERMS.send(player);
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,23 +170,24 @@ public class ComponentPresetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plot.getRunning() > 0) {
|
if (plot.getRunning() > 0) {
|
||||||
Captions.WAIT_FOR_TIMER.send(player);
|
player.sendMessage(TranslatableCaption.of("errors.wait_for_timer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Pattern pattern = PatternUtil.parse(null, componentPreset.getPattern(), false);
|
final Pattern pattern = PatternUtil.parse(null, componentPreset.getPattern(), false);
|
||||||
if (pattern == null) {
|
if (pattern == null) {
|
||||||
Captions.PRESET_INVALID.send(player);
|
player.sendMessage(TranslatableCaption.of("preset.preset_invalid"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (componentPreset.getCost() > 0.0D && econHandler != null && plot.getArea().useEconomy()) {
|
if (componentPreset.getCost() > 0.0D && econHandler != null && plot.getArea().useEconomy()) {
|
||||||
if (econHandler.getMoney(player) < componentPreset.getCost()) {
|
if (econHandler.getMoney(player) < componentPreset.getCost()) {
|
||||||
Captions.PRESET_CANNOT_AFFORD.send(player);
|
player.sendMessage(TranslatableCaption.of("preset.preset_cannot_afford"));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
econHandler.withdrawMoney(player, componentPreset.getCost());
|
econHandler.withdrawMoney(player, componentPreset.getCost());
|
||||||
Captions.REMOVED_BALANCE.send(player, componentPreset.getCost() + "");
|
player.sendMessage(TranslatableCaption.of("economy.removed_balance"),
|
||||||
|
Template.of("money", componentPreset.getCost() + ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ import com.plotsquared.core.events.PlotFlagRemoveEvent;
|
|||||||
import com.plotsquared.core.events.Result;
|
import com.plotsquared.core.events.Result;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.player.MetaDataAccess;
|
import com.plotsquared.core.player.MetaDataAccess;
|
||||||
import com.plotsquared.core.player.MetaDataKey;
|
|
||||||
import com.plotsquared.core.player.PlayerMetaDataKeys;
|
import com.plotsquared.core.player.PlayerMetaDataKeys;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
@ -61,7 +60,6 @@ import com.plotsquared.core.plot.flag.implementations.WeatherFlag;
|
|||||||
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.StringMan;
|
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.plotsquared.core.util.task.TaskTime;
|
import com.plotsquared.core.util.task.TaskTime;
|
||||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||||
@ -161,8 +159,7 @@ public class PlotListener {
|
|||||||
|
|
||||||
final String greeting = plot.getFlag(GreetingFlag.class);
|
final String greeting = plot.getFlag(GreetingFlag.class);
|
||||||
if (!greeting.isEmpty()) {
|
if (!greeting.isEmpty()) {
|
||||||
plot.format(Captions.PREFIX_GREETING.getTranslated() + greeting, player, false)
|
plot.format(greeting, player, false).thenAcceptAsync(player::sendMessage);
|
||||||
.thenAcceptAsync(player::sendMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plot.getFlag(NotifyEnterFlag.class)) {
|
if (plot.getFlag(NotifyEnterFlag.class)) {
|
||||||
@ -349,8 +346,7 @@ public class PlotListener {
|
|||||||
|
|
||||||
final String farewell = plot.getFlag(FarewellFlag.class);
|
final String farewell = plot.getFlag(FarewellFlag.class);
|
||||||
if (!farewell.isEmpty()) {
|
if (!farewell.isEmpty()) {
|
||||||
plot.format(Captions.PREFIX_FAREWELL.getTranslated() + farewell, player, false)
|
plot.format(farewell, player, false).thenAcceptAsync(player::sendMessage);
|
||||||
.thenAcceptAsync(player::sendMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plot.getFlag(NotifyLeaveFlag.class)) {
|
if (plot.getFlag(NotifyLeaveFlag.class)) {
|
||||||
|
@ -58,15 +58,15 @@ public interface PermissionHolder {
|
|||||||
*/
|
*/
|
||||||
@Nonnegative default int hasPermissionRange(@Nonnull final String stub,
|
@Nonnegative default int hasPermissionRange(@Nonnull final String stub,
|
||||||
@Nonnegative final int range) {
|
@Nonnegative final int range) {
|
||||||
if (hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) {
|
if (hasPermission(Captions.PERMISSION_ADMIN.toString())) {
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
String[] nodes = stub.split("\\.");
|
String[] nodes = stub.split("\\.");
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
for (int i = 0; i < (nodes.length - 1); i++) {
|
for (int i = 0; i < (nodes.length - 1); i++) {
|
||||||
builder.append(nodes[i]).append(".");
|
builder.append(nodes[i]).append(".");
|
||||||
if (!stub.equals(builder + Captions.PERMISSION_STAR.getTranslated())) {
|
if (!stub.equals(builder + Captions.PERMISSION_STAR.toString())) {
|
||||||
if (hasPermission(builder + Captions.PERMISSION_STAR.getTranslated())) {
|
if (hasPermission(builder + Captions.PERMISSION_STAR.toString())) {
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ import com.plotsquared.core.collection.ByteArrayUtilities;
|
|||||||
import com.plotsquared.core.command.CommandCaller;
|
import com.plotsquared.core.command.CommandCaller;
|
||||||
import com.plotsquared.core.command.RequiredType;
|
import com.plotsquared.core.command.RequiredType;
|
||||||
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.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.configuration.caption.CaptionMap;
|
import com.plotsquared.core.configuration.caption.CaptionMap;
|
||||||
import com.plotsquared.core.configuration.caption.CaptionUtility;
|
import com.plotsquared.core.configuration.caption.CaptionUtility;
|
||||||
|
@ -35,6 +35,7 @@ import com.plotsquared.core.configuration.ConfigurationNode;
|
|||||||
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.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.generator.GridPlotWorld;
|
import com.plotsquared.core.generator.GridPlotWorld;
|
||||||
import com.plotsquared.core.generator.IndependentPlotGenerator;
|
import com.plotsquared.core.generator.IndependentPlotGenerator;
|
||||||
@ -371,7 +372,7 @@ public abstract class PlotArea {
|
|||||||
StringBuilder flagBuilder = new StringBuilder();
|
StringBuilder flagBuilder = new StringBuilder();
|
||||||
Collection<PlotFlag<?, ?>> flagCollection = this.getFlagContainer().getFlagMap().values();
|
Collection<PlotFlag<?, ?>> flagCollection = this.getFlagContainer().getFlagMap().values();
|
||||||
if (flagCollection.isEmpty()) {
|
if (flagCollection.isEmpty()) {
|
||||||
flagBuilder.append(Captions.NONE.getTranslated());
|
flagBuilder.append(TranslatableCaption.of("info.none"));
|
||||||
} else {
|
} else {
|
||||||
String prefix = " ";
|
String prefix = " ";
|
||||||
for (final PlotFlag<?, ?> flag : flagCollection) {
|
for (final PlotFlag<?, ?> flag : flagCollection) {
|
||||||
@ -406,7 +407,7 @@ public abstract class PlotArea {
|
|||||||
StringBuilder roadFlagBuilder = new StringBuilder();
|
StringBuilder roadFlagBuilder = new StringBuilder();
|
||||||
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getFlagContainer().getFlagMap().values();
|
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getFlagContainer().getFlagMap().values();
|
||||||
if (roadFlagCollection.isEmpty()) {
|
if (roadFlagCollection.isEmpty()) {
|
||||||
roadFlagBuilder.append(Captions.NONE.getTranslated());
|
roadFlagBuilder.append(TranslatableCaption.of("info.none"));
|
||||||
} else {
|
} else {
|
||||||
roadFlags = true;
|
roadFlags = true;
|
||||||
String prefix = " ";
|
String prefix = " ";
|
||||||
|
@ -27,6 +27,7 @@ package com.plotsquared.core.plot;
|
|||||||
|
|
||||||
import com.plotsquared.core.configuration.caption.Caption;
|
import com.plotsquared.core.configuration.caption.Caption;
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -36,9 +37,9 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public enum PlotAreaType {
|
public enum PlotAreaType {
|
||||||
NORMAL(Captions.PLOT_AREA_TYPE_NORMAL),
|
NORMAL(TranslatableCaption.of("plotareatype.plot_area_type_normal")),
|
||||||
AUGMENTED(Captions.PLOT_AREA_TYPE_AUGMENTED),
|
AUGMENTED(TranslatableCaption.of("plotareatype.plot_area_type_augmented")),
|
||||||
PARTIAL(Captions.PLOT_AREA_TYPE_PARTIAL);
|
PARTIAL(TranslatableCaption.of("plotareatype.plot_area_type_partial"));
|
||||||
|
|
||||||
private final Caption description;
|
private final Caption description;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.InternalFlag;
|
import com.plotsquared.core.plot.flag.InternalFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.ListFlag;
|
import com.plotsquared.core.plot.flag.types.ListFlag;
|
||||||
@ -37,7 +37,7 @@ import java.util.List;
|
|||||||
public class AnalysisFlag extends ListFlag<Integer, AnalysisFlag> implements InternalFlag {
|
public class AnalysisFlag extends ListFlag<Integer, AnalysisFlag> implements InternalFlag {
|
||||||
|
|
||||||
public AnalysisFlag(final List<Integer> valueList) {
|
public AnalysisFlag(final List<Integer> valueList) {
|
||||||
super(valueList, Captions.NONE, Captions.NONE);
|
super(valueList, TranslatableCaption.of("info.none"), TranslatableCaption.of("info.none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public AnalysisFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public AnalysisFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +37,7 @@ public class AnimalAttackFlag extends BooleanFlag<AnimalAttackFlag> {
|
|||||||
public static final AnimalAttackFlag ANIMAL_ATTACK_FALSE = new AnimalAttackFlag(false);
|
public static final AnimalAttackFlag ANIMAL_ATTACK_FALSE = new AnimalAttackFlag(false);
|
||||||
|
|
||||||
private AnimalAttackFlag(boolean value) {
|
private AnimalAttackFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_ATTACK);
|
super(value, TranslatableCaption.of("flags.flag_description_animal_attack"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected AnimalAttackFlag flagOf(@Nonnull Boolean value) {
|
@Override protected AnimalAttackFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -34,7 +35,7 @@ public class AnimalCapFlag extends NonNegativeIntegerFlag<AnimalCapFlag> {
|
|||||||
public static final AnimalCapFlag ANIMAL_CAP_UNLIMITED = new AnimalCapFlag(Integer.MAX_VALUE);
|
public static final AnimalCapFlag ANIMAL_CAP_UNLIMITED = new AnimalCapFlag(Integer.MAX_VALUE);
|
||||||
|
|
||||||
protected AnimalCapFlag(int value) {
|
protected AnimalCapFlag(int value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_CAP);
|
super(value, TranslatableCaption.of("flags.flag_description_animal_cap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected AnimalCapFlag flagOf(@Nonnull Integer value) {
|
@Override protected AnimalCapFlag flagOf(@Nonnull Integer value) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +37,7 @@ public class AnimalInteractFlag extends BooleanFlag<AnimalInteractFlag> {
|
|||||||
public static final AnimalInteractFlag ANIMAL_INTERACT_FALSE = new AnimalInteractFlag(false);
|
public static final AnimalInteractFlag ANIMAL_INTERACT_FALSE = new AnimalInteractFlag(false);
|
||||||
|
|
||||||
private AnimalInteractFlag(boolean value) {
|
private AnimalInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_animal_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected AnimalInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected AnimalInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +37,7 @@ public class BlockBurnFlag extends BooleanFlag<BlockBurnFlag> {
|
|||||||
public static final BlockBurnFlag BLOCK_BURN_FALSE = new BlockBurnFlag(false);
|
public static final BlockBurnFlag BLOCK_BURN_FALSE = new BlockBurnFlag(false);
|
||||||
|
|
||||||
private BlockBurnFlag(boolean value) {
|
private BlockBurnFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_BLOCK_BURN);
|
super(value, TranslatableCaption.of("flags.flag_description_block_burn"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected BlockBurnFlag flagOf(@Nonnull Boolean value) {
|
@Override protected BlockBurnFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +37,7 @@ public class BlockIgnitionFlag extends BooleanFlag<BlockIgnitionFlag> {
|
|||||||
public static final BlockIgnitionFlag BLOCK_IGNITION_FALSE = new BlockIgnitionFlag(false);
|
public static final BlockIgnitionFlag BLOCK_IGNITION_FALSE = new BlockIgnitionFlag(false);
|
||||||
|
|
||||||
private BlockIgnitionFlag(boolean value) {
|
private BlockIgnitionFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_BLOCK_IGNITION);
|
super(value, TranslatableCaption.of("flags.flag_description_block_ignition"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected BlockIgnitionFlag flagOf(@Nonnull Boolean value) {
|
@Override protected BlockIgnitionFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.types.ListFlag;
|
import com.plotsquared.core.plot.flag.types.ListFlag;
|
||||||
|
|
||||||
@ -40,8 +40,8 @@ public class BlockedCmdsFlag extends ListFlag<String, BlockedCmdsFlag> {
|
|||||||
new BlockedCmdsFlag(Collections.emptyList());
|
new BlockedCmdsFlag(Collections.emptyList());
|
||||||
|
|
||||||
protected BlockedCmdsFlag(List<String> valueList) {
|
protected BlockedCmdsFlag(List<String> valueList) {
|
||||||
super(valueList, Captions.FLAG_CATEGORY_STRING_LIST,
|
super(valueList, TranslatableCaption.of("flags.flag_category_string_list"),
|
||||||
Captions.FLAG_DESCRIPTION_BLOCKED_CMDS);
|
TranslatableCaption.of("flags.flag_description_blocked_cmds"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public BlockedCmdsFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public BlockedCmdsFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
|
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ public class BreakFlag extends BlockTypeListFlag<BreakFlag> {
|
|||||||
public static final BreakFlag BREAK_NONE = new BreakFlag(Collections.emptyList());
|
public static final BreakFlag BREAK_NONE = new BreakFlag(Collections.emptyList());
|
||||||
|
|
||||||
protected BreakFlag(List<BlockTypeWrapper> blockTypeList) {
|
protected BreakFlag(List<BlockTypeWrapper> blockTypeList) {
|
||||||
super(blockTypeList, Captions.FLAG_DESCRIPTION_BREAK);
|
super(blockTypeList, TranslatableCaption.of("flags.flag_description_break"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected BreakFlag flagOf(@Nonnull List<BlockTypeWrapper> value) {
|
@Override protected BreakFlag flagOf(@Nonnull List<BlockTypeWrapper> value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class ChatFlag extends BooleanFlag<ChatFlag> {
|
|||||||
public static final ChatFlag CHAT_FLAG_FALSE = new ChatFlag(false);
|
public static final ChatFlag CHAT_FLAG_FALSE = new ChatFlag(false);
|
||||||
|
|
||||||
protected ChatFlag(boolean value) {
|
protected ChatFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_CHAT);
|
super(value, TranslatableCaption.of("flags.flag_description_chat"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected ChatFlag flagOf(@Nonnull Boolean value) {
|
@Override protected ChatFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class CoralDryFlag extends BooleanFlag<CoralDryFlag> {
|
|||||||
public static final CoralDryFlag CORAL_DRY_FALSE = new CoralDryFlag(false);
|
public static final CoralDryFlag CORAL_DRY_FALSE = new CoralDryFlag(false);
|
||||||
|
|
||||||
private CoralDryFlag(boolean value) {
|
private CoralDryFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_CORAL_DRY);
|
super(value, TranslatableCaption.of("flags.flag_description_coral_dry"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected CoralDryFlag flagOf(@Nonnull Boolean value) {
|
@Override protected CoralDryFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class DenyExitFlag extends BooleanFlag<DenyExitFlag> {
|
|||||||
public static final DenyExitFlag DENY_EXIT_FLAG_FALSE = new DenyExitFlag(false);
|
public static final DenyExitFlag DENY_EXIT_FLAG_FALSE = new DenyExitFlag(false);
|
||||||
|
|
||||||
protected DenyExitFlag(boolean value) {
|
protected DenyExitFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_DENY_EXIT);
|
super(value, TranslatableCaption.of("flags.flag_description_deny_exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected DenyExitFlag flagOf(@Nonnull Boolean value) {
|
@Override protected DenyExitFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,11 +25,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -47,7 +48,7 @@ public class DenyTeleportFlag extends PlotFlag<DenyTeleportFlag.DeniedGroup, Den
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
protected DenyTeleportFlag(@Nonnull DeniedGroup value) {
|
protected DenyTeleportFlag(@Nonnull DeniedGroup value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_ENUM, Captions.FLAG_DESCRIPTION_DENY_TELEPORT);
|
super(value, TranslatableCaption.of("flags.flag_category_enum"), TranslatableCaption.of("flags.flag_description_deny_teleport"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean allowsTeleport(PlotPlayer player, Plot plot) {
|
public static boolean allowsTeleport(PlotPlayer player, Plot plot) {
|
||||||
@ -82,8 +83,8 @@ public class DenyTeleportFlag extends PlotFlag<DenyTeleportFlag.DeniedGroup, Den
|
|||||||
@Override public DenyTeleportFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public DenyTeleportFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
final DeniedGroup group = DeniedGroup.fromString(input);
|
final DeniedGroup group = DeniedGroup.fromString(input);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
throw new FlagParseException(this, input, Captions.FLAG_ERROR_ENUM,
|
throw new FlagParseException(this, input, TranslatableCaption.of("flags.flag_error_enum"),
|
||||||
"members, nonmembers, trusted, nontrusted, nonowners");
|
Template.of("list", "members, nonmembers, trusted, nontrusted, nonowners"));
|
||||||
}
|
}
|
||||||
return flagOf(group);
|
return flagOf(group);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -35,7 +35,7 @@ public class DescriptionFlag extends PlotFlag<String, DescriptionFlag> {
|
|||||||
public static final DescriptionFlag DESCRIPTION_FLAG_EMPTY = new DescriptionFlag("");
|
public static final DescriptionFlag DESCRIPTION_FLAG_EMPTY = new DescriptionFlag("");
|
||||||
|
|
||||||
protected DescriptionFlag(@Nonnull String value) {
|
protected DescriptionFlag(@Nonnull String value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_STRING, Captions.FLAG_DESCRIPTION_DESCRIPTION);
|
super(value, TranslatableCaption.of("flags.flag_category_string"), TranslatableCaption.of("flags.flag_description_description"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public DescriptionFlag parse(@Nonnull String input) {
|
@Override public DescriptionFlag parse(@Nonnull String input) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class DeviceInteractFlag extends BooleanFlag<DeviceInteractFlag> {
|
|||||||
public static final DeviceInteractFlag DEVICE_INTERACT_FALSE = new DeviceInteractFlag(false);
|
public static final DeviceInteractFlag DEVICE_INTERACT_FALSE = new DeviceInteractFlag(false);
|
||||||
|
|
||||||
private DeviceInteractFlag(boolean value) {
|
private DeviceInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_DEVICE_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_device_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected DeviceInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected DeviceInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class DisablePhysicsFlag extends BooleanFlag<DisablePhysicsFlag> {
|
|||||||
public static final DisablePhysicsFlag DISABLE_PHYSICS_FALSE = new DisablePhysicsFlag(false);
|
public static final DisablePhysicsFlag DISABLE_PHYSICS_FALSE = new DisablePhysicsFlag(false);
|
||||||
|
|
||||||
private DisablePhysicsFlag(boolean value) {
|
private DisablePhysicsFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_DISABLE_PHYSICS);
|
super(value, TranslatableCaption.of("flags.flag_description_disable_physics"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected DisablePhysicsFlag flagOf(@Nonnull Boolean value) {
|
@Override protected DisablePhysicsFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.InternalFlag;
|
import com.plotsquared.core.plot.flag.InternalFlag;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
@ -40,7 +41,7 @@ public class DoneFlag extends PlotFlag<String, DoneFlag> implements InternalFlag
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
public DoneFlag(@Nonnull String value) {
|
public DoneFlag(@Nonnull String value) {
|
||||||
super(value, Captions.NONE, Captions.NONE);
|
super(value, TranslatableCaption.of("info.none"), TranslatableCaption.of("info.none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDone(final Plot plot) {
|
public static boolean isDone(final Plot plot) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class DropProtectionFlag extends BooleanFlag<DropProtectionFlag> {
|
|||||||
public static final DropProtectionFlag DROP_PROTECTION_FALSE = new DropProtectionFlag(false);
|
public static final DropProtectionFlag DROP_PROTECTION_FALSE = new DropProtectionFlag(false);
|
||||||
|
|
||||||
private DropProtectionFlag(boolean value) {
|
private DropProtectionFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_DROP_PROTECTION);
|
super(value, TranslatableCaption.of("flags.flag_description_drop_protection"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected DropProtectionFlag flagOf(@Nonnull Boolean value) {
|
@Override protected DropProtectionFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -34,7 +34,7 @@ public class EntityCapFlag extends NonNegativeIntegerFlag<EntityCapFlag> {
|
|||||||
public static final EntityCapFlag ENTITY_CAP_UNLIMITED = new EntityCapFlag(Integer.MAX_VALUE);
|
public static final EntityCapFlag ENTITY_CAP_UNLIMITED = new EntityCapFlag(Integer.MAX_VALUE);
|
||||||
|
|
||||||
protected EntityCapFlag(int value) {
|
protected EntityCapFlag(int value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ENTITY_CAP);
|
super(value, TranslatableCaption.of("flags.flag_description_entity_cap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected EntityCapFlag flagOf(@Nonnull Integer value) {
|
@Override protected EntityCapFlag flagOf(@Nonnull Integer value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class ExplosionFlag extends BooleanFlag<ExplosionFlag> {
|
|||||||
public static final ExplosionFlag EXPLOSION_FALSE = new ExplosionFlag(false);
|
public static final ExplosionFlag EXPLOSION_FALSE = new ExplosionFlag(false);
|
||||||
|
|
||||||
private ExplosionFlag(boolean value) {
|
private ExplosionFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_EXPLOSION);
|
super(value, TranslatableCaption.of("flags.flag_description_explosion"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected ExplosionFlag flagOf(@Nonnull Boolean value) {
|
@Override protected ExplosionFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -35,7 +35,7 @@ public class FarewellFlag extends PlotFlag<String, FarewellFlag> {
|
|||||||
public static final FarewellFlag FAREWELL_FLAG_EMPTY = new FarewellFlag("");
|
public static final FarewellFlag FAREWELL_FLAG_EMPTY = new FarewellFlag("");
|
||||||
|
|
||||||
protected FarewellFlag(@Nonnull String value) {
|
protected FarewellFlag(@Nonnull String value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_STRING, Captions.FLAG_DESCRIPTION_FAREWELL);
|
super(value, TranslatableCaption.of("flags.flag_category_string"), TranslatableCaption.of("flags.flag_description_farewell"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public FarewellFlag parse(@Nonnull String input) {
|
@Override public FarewellFlag parse(@Nonnull String input) {
|
||||||
|
@ -25,9 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
||||||
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ public class FeedFlag extends TimedFlag<Integer, FeedFlag> {
|
|||||||
public static final FeedFlag FEED_NOTHING = new FeedFlag(new Timed<>(0, 0));
|
public static final FeedFlag FEED_NOTHING = new FeedFlag(new Timed<>(0, 0));
|
||||||
|
|
||||||
public FeedFlag(@Nonnull Timed<Integer> value) {
|
public FeedFlag(@Nonnull Timed<Integer> value) {
|
||||||
super(value, 1, Captions.FLAG_DESCRIPTION_FEED);
|
super(value, 1, TranslatableCaption.of("flags.flag_description_feed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected Integer parseValue(String input) throws FlagParseException {
|
@Override protected Integer parseValue(String input) throws FlagParseException {
|
||||||
@ -43,10 +44,10 @@ public class FeedFlag extends TimedFlag<Integer, FeedFlag> {
|
|||||||
try {
|
try {
|
||||||
parsed = Integer.parseInt(input);
|
parsed = Integer.parseInt(input);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
throw new FlagParseException(this, input, Captions.NOT_A_NUMBER, input);
|
throw new FlagParseException(this, input, TranslatableCaption.of("invalid.not_a_number"), Template.of("value", input));
|
||||||
}
|
}
|
||||||
if (parsed < 1) {
|
if (parsed < 1) {
|
||||||
throw new FlagParseException(this, input, Captions.NUMBER_NOT_POSITIVE, parsed);
|
throw new FlagParseException(this, input, TranslatableCaption.of("invalid.number_not_positive"), Template.of("value", String.valueOf(parsed)));
|
||||||
}
|
}
|
||||||
return parsed;
|
return parsed;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -39,7 +39,7 @@ public class FlyFlag extends PlotFlag<FlyFlag.FlyStatus, FlyFlag> {
|
|||||||
public static final FlyFlag FLIGHT_FLAG_DEFAULT = new FlyFlag(FlyStatus.DEFAULT);
|
public static final FlyFlag FLIGHT_FLAG_DEFAULT = new FlyFlag(FlyStatus.DEFAULT);
|
||||||
|
|
||||||
protected FlyFlag(final FlyStatus value) {
|
protected FlyFlag(final FlyStatus value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_BOOLEAN, Captions.FLAG_DESCRIPTION_FLIGHT);
|
super(value, TranslatableCaption.of("flags.flag_category_boolean"), TranslatableCaption.of("flags.flag_description_flight"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public FlyFlag parse(@Nonnull final String input) {
|
@Override public FlyFlag parse(@Nonnull final String input) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class ForcefieldFlag extends BooleanFlag<ForcefieldFlag> {
|
|||||||
public static final ForcefieldFlag FORCEFIELD_FALSE = new ForcefieldFlag(false);
|
public static final ForcefieldFlag FORCEFIELD_FALSE = new ForcefieldFlag(false);
|
||||||
|
|
||||||
private ForcefieldFlag(boolean value) {
|
private ForcefieldFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_FORCEFIELD);
|
super(value, TranslatableCaption.of("flags.flag_description_forcefield"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected ForcefieldFlag flagOf(@Nonnull Boolean value) {
|
@Override protected ForcefieldFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||||
@ -54,7 +54,7 @@ public class GamemodeFlag extends PlotFlag<GameMode, GamemodeFlag> {
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
protected GamemodeFlag(@Nonnull GameMode value) {
|
protected GamemodeFlag(@Nonnull GameMode value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_GAMEMODE, Captions.FLAG_DESCRIPTION_GAMEMODE);
|
super(value, TranslatableCaption.of("flags.flag_category_gamemode"), TranslatableCaption.of("flags.flag_description_gamemode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public GamemodeFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public GamemodeFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class GrassGrowFlag extends BooleanFlag<GrassGrowFlag> {
|
|||||||
public static final GrassGrowFlag GRASS_GROW_FALSE = new GrassGrowFlag(false);
|
public static final GrassGrowFlag GRASS_GROW_FALSE = new GrassGrowFlag(false);
|
||||||
|
|
||||||
private GrassGrowFlag(boolean value) {
|
private GrassGrowFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_GRASS_GROW);
|
super(value, TranslatableCaption.of("flags.flag_description_grass_grow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected GrassGrowFlag flagOf(@Nonnull Boolean value) {
|
@Override protected GrassGrowFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -35,7 +35,7 @@ public class GreetingFlag extends PlotFlag<String, GreetingFlag> {
|
|||||||
public static final GreetingFlag GREETING_FLAG_EMPTY = new GreetingFlag("");
|
public static final GreetingFlag GREETING_FLAG_EMPTY = new GreetingFlag("");
|
||||||
|
|
||||||
protected GreetingFlag(@Nonnull String value) {
|
protected GreetingFlag(@Nonnull String value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_STRING, Captions.FLAG_DESCRIPTION_GREETING);
|
super(value, TranslatableCaption.of("flags.flag_category_string"), TranslatableCaption.of("flags.flag_description_greeting"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public GreetingFlag parse(@Nonnull String input) {
|
@Override public GreetingFlag parse(@Nonnull String input) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||||
@ -52,7 +52,7 @@ public class GuestGamemodeFlag extends PlotFlag<GameMode, GuestGamemodeFlag> {
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
protected GuestGamemodeFlag(@Nonnull GameMode value) {
|
protected GuestGamemodeFlag(@Nonnull GameMode value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_GAMEMODE, Captions.FLAG_DESCRIPTION_GUEST_GAMEMODE);
|
super(value, TranslatableCaption.of("flags.flag_category_gamemode"), TranslatableCaption.of("flags.flag_description_guest_gamemode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public GuestGamemodeFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public GuestGamemodeFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +37,7 @@ public class HangingBreakFlag extends BooleanFlag<HangingBreakFlag> {
|
|||||||
public static final HangingBreakFlag HANGING_BREAK_FALSE = new HangingBreakFlag(false);
|
public static final HangingBreakFlag HANGING_BREAK_FALSE = new HangingBreakFlag(false);
|
||||||
|
|
||||||
private HangingBreakFlag(boolean value) {
|
private HangingBreakFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_HANGING_BREAK);
|
super(value, TranslatableCaption.of("flags.flag_description_hanging_break"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected HangingBreakFlag flagOf(@Nonnull Boolean value) {
|
@Override protected HangingBreakFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class HangingPlaceFlag extends BooleanFlag<HangingPlaceFlag> {
|
|||||||
public static final HangingPlaceFlag HANGING_PLACE_FALSE = new HangingPlaceFlag(false);
|
public static final HangingPlaceFlag HANGING_PLACE_FALSE = new HangingPlaceFlag(false);
|
||||||
|
|
||||||
private HangingPlaceFlag(boolean value) {
|
private HangingPlaceFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_HANGING_PLACE);
|
super(value, TranslatableCaption.of("flags.flag_description_hanging_place"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected HangingPlaceFlag flagOf(@Nonnull Boolean value) {
|
@Override protected HangingPlaceFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
||||||
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@ -35,7 +37,7 @@ public class HealFlag extends TimedFlag<Integer, HealFlag> {
|
|||||||
public static final HealFlag HEAL_NOTHING = new HealFlag(new Timed<>(0, 0));
|
public static final HealFlag HEAL_NOTHING = new HealFlag(new Timed<>(0, 0));
|
||||||
|
|
||||||
protected HealFlag(@Nonnull Timed<Integer> value) {
|
protected HealFlag(@Nonnull Timed<Integer> value) {
|
||||||
super(value, 1, Captions.FLAG_DESCRIPTION_HEAL);
|
super(value, 1, TranslatableCaption.of("flags.flag_description_heal"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected Integer parseValue(String input) throws FlagParseException {
|
@Override protected Integer parseValue(String input) throws FlagParseException {
|
||||||
@ -43,10 +45,10 @@ public class HealFlag extends TimedFlag<Integer, HealFlag> {
|
|||||||
try {
|
try {
|
||||||
parsed = Integer.parseInt(input);
|
parsed = Integer.parseInt(input);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
throw new FlagParseException(this, input, Captions.NOT_A_NUMBER, input);
|
throw new FlagParseException(this, input, TranslatableCaption.of("invalid.not_a_number"), Template.of("value", input));
|
||||||
}
|
}
|
||||||
if (parsed < 1) {
|
if (parsed < 1) {
|
||||||
throw new FlagParseException(this, input, Captions.NUMBER_NOT_POSITIVE, parsed);
|
throw new FlagParseException(this, input, TranslatableCaption.of("invalid.number_not_positive"), Template.of("value", String.valueOf(parsed)));
|
||||||
}
|
}
|
||||||
return parsed;
|
return parsed;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class HideInfoFlag extends BooleanFlag<HideInfoFlag> {
|
|||||||
public static final HideInfoFlag HIDE_INFO_FALSE = new HideInfoFlag(false);
|
public static final HideInfoFlag HIDE_INFO_FALSE = new HideInfoFlag(false);
|
||||||
|
|
||||||
private HideInfoFlag(boolean value) {
|
private HideInfoFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_HIDE_INFO);
|
super(value, TranslatableCaption.of("flags.flag_description_hide_info"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected HideInfoFlag flagOf(@Nonnull Boolean value) {
|
@Override protected HideInfoFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class HostileAttackFlag extends BooleanFlag<HostileAttackFlag> {
|
|||||||
public static final HostileAttackFlag HOSTILE_ATTACK_FALSE = new HostileAttackFlag(false);
|
public static final HostileAttackFlag HOSTILE_ATTACK_FALSE = new HostileAttackFlag(false);
|
||||||
|
|
||||||
private HostileAttackFlag(boolean value) {
|
private HostileAttackFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_ATTACK);
|
super(value, TranslatableCaption.of("flags.flag_description_hostile_attack"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected HostileAttackFlag flagOf(@Nonnull Boolean value) {
|
@Override protected HostileAttackFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -35,7 +35,7 @@ public class HostileCapFlag extends NonNegativeIntegerFlag<HostileCapFlag> {
|
|||||||
new HostileCapFlag(Integer.MAX_VALUE);
|
new HostileCapFlag(Integer.MAX_VALUE);
|
||||||
|
|
||||||
protected HostileCapFlag(int value) {
|
protected HostileCapFlag(int value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_CAP);
|
super(value, TranslatableCaption.of("flags.flag_description_hostile_cap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected HostileCapFlag flagOf(@Nonnull Integer value) {
|
@Override protected HostileCapFlag flagOf(@Nonnull Integer value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class HostileInteractFlag extends BooleanFlag<HostileInteractFlag> {
|
|||||||
public static final HostileInteractFlag HOSTILE_INTERACT_FALSE = new HostileInteractFlag(false);
|
public static final HostileInteractFlag HOSTILE_INTERACT_FALSE = new HostileInteractFlag(false);
|
||||||
|
|
||||||
private HostileInteractFlag(boolean value) {
|
private HostileInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_hostile_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected HostileInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected HostileInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class IceFormFlag extends BooleanFlag<IceFormFlag> {
|
|||||||
public static final IceFormFlag ICE_FORM_FALSE = new IceFormFlag(false);
|
public static final IceFormFlag ICE_FORM_FALSE = new IceFormFlag(false);
|
||||||
|
|
||||||
private IceFormFlag(boolean value) {
|
private IceFormFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ICE_FORM);
|
super(value, TranslatableCaption.of("flags.flag_description_ice_form"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected IceFormFlag flagOf(@Nonnull Boolean value) {
|
@Override protected IceFormFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class IceMeltFlag extends BooleanFlag<IceMeltFlag> {
|
|||||||
public static final IceMeltFlag ICE_MELT_FALSE = new IceMeltFlag(false);
|
public static final IceMeltFlag ICE_MELT_FALSE = new IceMeltFlag(false);
|
||||||
|
|
||||||
private IceMeltFlag(boolean value) {
|
private IceMeltFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ICE_MELT);
|
super(value, TranslatableCaption.of("flags.flag_description_ice_melt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected IceMeltFlag flagOf(@Nonnull Boolean value) {
|
@Override protected IceMeltFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class InstabreakFlag extends BooleanFlag<InstabreakFlag> {
|
|||||||
public static final InstabreakFlag INSTABREAK_FALSE = new InstabreakFlag(false);
|
public static final InstabreakFlag INSTABREAK_FALSE = new InstabreakFlag(false);
|
||||||
|
|
||||||
private InstabreakFlag(boolean value) {
|
private InstabreakFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_INSTABREAK);
|
super(value, TranslatableCaption.of("flags.flag_description_instabreak"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected InstabreakFlag flagOf(@Nonnull Boolean value) {
|
@Override protected InstabreakFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class InvincibleFlag extends BooleanFlag<InvincibleFlag> {
|
|||||||
public static final InvincibleFlag INVINCIBLE_FALSE = new InvincibleFlag(false);
|
public static final InvincibleFlag INVINCIBLE_FALSE = new InvincibleFlag(false);
|
||||||
|
|
||||||
private InvincibleFlag(boolean value) {
|
private InvincibleFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_INVINCIBLE);
|
super(value, TranslatableCaption.of("flags.flag_description_invincible"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected InvincibleFlag flagOf(@Nonnull Boolean value) {
|
@Override protected InvincibleFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class ItemDropFlag extends BooleanFlag<ItemDropFlag> {
|
|||||||
public static final ItemDropFlag ITEM_DROP_FALSE = new ItemDropFlag(false);
|
public static final ItemDropFlag ITEM_DROP_FALSE = new ItemDropFlag(false);
|
||||||
|
|
||||||
private ItemDropFlag(boolean value) {
|
private ItemDropFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_ITEM_DROP);
|
super(value, TranslatableCaption.of("flags.flag_description_item_drop"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected ItemDropFlag flagOf(@Nonnull Boolean value) {
|
@Override protected ItemDropFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
@ -43,14 +43,14 @@ public class KeepFlag extends PlotFlag<Object, KeepFlag> {
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
protected KeepFlag(@Nonnull Object value) {
|
protected KeepFlag(@Nonnull Object value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_MIXED, Captions.FLAG_DESCRIPTION_KEEP);
|
super(value, TranslatableCaption.of("flags.flag_category_mixed"), TranslatableCaption.of("flags.flag_description_keep"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public KeepFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public KeepFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
if (MathMan.isInteger(input)) {
|
if (MathMan.isInteger(input)) {
|
||||||
final long value = Long.parseLong(input);
|
final long value = Long.parseLong(input);
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
throw new FlagParseException(this, input, Captions.FLAG_ERROR_KEEP);
|
throw new FlagParseException(this, input, TranslatableCaption.of("flags.flag_error_keep"));
|
||||||
} else {
|
} else {
|
||||||
return flagOf(value);
|
return flagOf(value);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class KeepInventoryFlag extends BooleanFlag<KeepInventoryFlag> {
|
|||||||
public static final KeepInventoryFlag KEEP_INVENTORY_FALSE = new KeepInventoryFlag(false);
|
public static final KeepInventoryFlag KEEP_INVENTORY_FALSE = new KeepInventoryFlag(false);
|
||||||
|
|
||||||
private KeepInventoryFlag(final boolean value) {
|
private KeepInventoryFlag(final boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_KEEP_INVENTORY);
|
super(value, TranslatableCaption.of("flags.flag_description_keep_inventory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected KeepInventoryFlag flagOf(@Nonnull final Boolean value) {
|
@Override protected KeepInventoryFlag flagOf(@Nonnull final Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class KelpGrowFlag extends BooleanFlag<KelpGrowFlag> {
|
|||||||
public static final KelpGrowFlag KELP_GROW_FALSE = new KelpGrowFlag(false);
|
public static final KelpGrowFlag KELP_GROW_FALSE = new KelpGrowFlag(false);
|
||||||
|
|
||||||
private KelpGrowFlag(boolean value) {
|
private KelpGrowFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_KELP_GROW);
|
super(value, TranslatableCaption.of("flags.flag_description_kelp_grow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected KelpGrowFlag flagOf(@Nonnull Boolean value) {
|
@Override protected KelpGrowFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -40,7 +40,7 @@ public class LiquidFlowFlag extends PlotFlag<LiquidFlowFlag.FlowStatus, LiquidFl
|
|||||||
public static final LiquidFlowFlag LIQUID_FLOW_DEFAULT = new LiquidFlowFlag(FlowStatus.DEFAULT);
|
public static final LiquidFlowFlag LIQUID_FLOW_DEFAULT = new LiquidFlowFlag(FlowStatus.DEFAULT);
|
||||||
|
|
||||||
private LiquidFlowFlag(FlowStatus value) {
|
private LiquidFlowFlag(FlowStatus value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_BOOLEAN, Captions.FLAG_DESCRIPTION_LIQUID_FLOW);
|
super(value, TranslatableCaption.of("flags.flag_category_boolean"), TranslatableCaption.of("flags.flag_description_liquid_flow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public LiquidFlowFlag parse(@Nonnull final String input) {
|
@Override public LiquidFlowFlag parse(@Nonnull final String input) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class MiscBreakFlag extends BooleanFlag<MiscBreakFlag> {
|
|||||||
public static final MiscBreakFlag MISC_BREAK_FALSE = new MiscBreakFlag(false);
|
public static final MiscBreakFlag MISC_BREAK_FALSE = new MiscBreakFlag(false);
|
||||||
|
|
||||||
private MiscBreakFlag(boolean value) {
|
private MiscBreakFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MISC_BREAK);
|
super(value, TranslatableCaption.of("flags.flag_description_misc_break"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MiscBreakFlag flagOf(@Nonnull Boolean value) {
|
@Override protected MiscBreakFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -34,7 +34,7 @@ public class MiscCapFlag extends NonNegativeIntegerFlag<MiscCapFlag> {
|
|||||||
public static final MiscCapFlag MISC_CAP_UNLIMITED = new MiscCapFlag(Integer.MAX_VALUE);
|
public static final MiscCapFlag MISC_CAP_UNLIMITED = new MiscCapFlag(Integer.MAX_VALUE);
|
||||||
|
|
||||||
protected MiscCapFlag(int value) {
|
protected MiscCapFlag(int value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MISC_CAP);
|
super(value, TranslatableCaption.of("flags.flag_description_misc_cap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MiscCapFlag flagOf(@Nonnull Integer value) {
|
@Override protected MiscCapFlag flagOf(@Nonnull Integer value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class MiscInteractFlag extends BooleanFlag<MiscInteractFlag> {
|
|||||||
public static final MiscInteractFlag MISC_INTERACT_FALSE = new MiscInteractFlag(false);
|
public static final MiscInteractFlag MISC_INTERACT_FALSE = new MiscInteractFlag(false);
|
||||||
|
|
||||||
private MiscInteractFlag(boolean value) {
|
private MiscInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MISC_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_misc_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MiscInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected MiscInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class MiscPlaceFlag extends BooleanFlag<MiscPlaceFlag> {
|
|||||||
public static final MiscPlaceFlag MISC_PLACE_FALSE = new MiscPlaceFlag(false);
|
public static final MiscPlaceFlag MISC_PLACE_FALSE = new MiscPlaceFlag(false);
|
||||||
|
|
||||||
private MiscPlaceFlag(boolean value) {
|
private MiscPlaceFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MISC_PLACE);
|
super(value, TranslatableCaption.of("flags.flag_description_misc_place"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MiscPlaceFlag flagOf(@Nonnull Boolean value) {
|
@Override protected MiscPlaceFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class MobBreakFlag extends BooleanFlag<MobBreakFlag> {
|
|||||||
public static final MobBreakFlag MOB_BREAK_FALSE = new MobBreakFlag(false);
|
public static final MobBreakFlag MOB_BREAK_FALSE = new MobBreakFlag(false);
|
||||||
|
|
||||||
private MobBreakFlag(boolean value) {
|
private MobBreakFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MOB_BREAK);
|
super(value, TranslatableCaption.of("flags.flag_description_mob_break"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MobBreakFlag flagOf(@Nonnull Boolean value) {
|
@Override protected MobBreakFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -34,7 +34,7 @@ public class MobCapFlag extends NonNegativeIntegerFlag<MobCapFlag> {
|
|||||||
public static final MobCapFlag MOB_CAP_UNLIMITED = new MobCapFlag(Integer.MAX_VALUE);
|
public static final MobCapFlag MOB_CAP_UNLIMITED = new MobCapFlag(Integer.MAX_VALUE);
|
||||||
|
|
||||||
protected MobCapFlag(int value) {
|
protected MobCapFlag(int value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MOB_CAP);
|
super(value, TranslatableCaption.of("flags.flag_description_mob_cap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MobCapFlag flagOf(@Nonnull Integer value) {
|
@Override protected MobCapFlag flagOf(@Nonnull Integer value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class MobPlaceFlag extends BooleanFlag<MobPlaceFlag> {
|
|||||||
public static final MobPlaceFlag MOB_PLACE_FALSE = new MobPlaceFlag(false);
|
public static final MobPlaceFlag MOB_PLACE_FALSE = new MobPlaceFlag(false);
|
||||||
|
|
||||||
private MobPlaceFlag(boolean value) {
|
private MobPlaceFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MOB_PLACE);
|
super(value, TranslatableCaption.of("flags.flag_description_mob_place"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MobPlaceFlag flagOf(@Nonnull Boolean value) {
|
@Override protected MobPlaceFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.plotsquared.core.util.ItemUtil;
|
import com.plotsquared.core.util.ItemUtil;
|
||||||
@ -44,7 +44,7 @@ public class MusicFlag extends PlotFlag<ItemType, MusicFlag> {
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
protected MusicFlag(ItemType value) {
|
protected MusicFlag(ItemType value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_MUSIC, Captions.FLAG_DESCRIPTION_MUSIC);
|
super(value, TranslatableCaption.of("flags.flag_category_music"), TranslatableCaption.of("flags.flag_description_music"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MusicFlag parse(@Nonnull String input) throws FlagParseException {
|
@Override public MusicFlag parse(@Nonnull String input) throws FlagParseException {
|
||||||
@ -56,7 +56,7 @@ public class MusicFlag extends PlotFlag<ItemType, MusicFlag> {
|
|||||||
.getId().contains("music_disc_"))) {
|
.getId().contains("music_disc_"))) {
|
||||||
return new MusicFlag(ItemUtil.get(input));
|
return new MusicFlag(ItemUtil.get(input));
|
||||||
} else {
|
} else {
|
||||||
throw new FlagParseException(this, input, Captions.FLAG_ERROR_MUSIC);
|
throw new FlagParseException(this, input, TranslatableCaption.of("flags.flag_error_music"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class MycelGrowFlag extends BooleanFlag<MycelGrowFlag> {
|
|||||||
public static final MycelGrowFlag MYCEL_GROW_FALSE = new MycelGrowFlag(false);
|
public static final MycelGrowFlag MYCEL_GROW_FALSE = new MycelGrowFlag(false);
|
||||||
|
|
||||||
private MycelGrowFlag(boolean value) {
|
private MycelGrowFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_MYCEL_GROW);
|
super(value, TranslatableCaption.of("flags.flag_description_mycel_grow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected MycelGrowFlag flagOf(@Nonnull Boolean value) {
|
@Override protected MycelGrowFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class NoWorldeditFlag extends BooleanFlag<NoWorldeditFlag> {
|
|||||||
public static final NoWorldeditFlag NO_WORLDEDIT_FALSE = new NoWorldeditFlag(false);
|
public static final NoWorldeditFlag NO_WORLDEDIT_FALSE = new NoWorldeditFlag(false);
|
||||||
|
|
||||||
private NoWorldeditFlag(boolean value) {
|
private NoWorldeditFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_NO_WORLDEDIT);
|
super(value, TranslatableCaption.of("flags.flag_description_no_worldedit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected NoWorldeditFlag flagOf(@Nonnull Boolean value) {
|
@Override protected NoWorldeditFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class NotifyEnterFlag extends BooleanFlag<NotifyEnterFlag> {
|
|||||||
public static final NotifyEnterFlag NOTIFY_ENTER_FALSE = new NotifyEnterFlag(false);
|
public static final NotifyEnterFlag NOTIFY_ENTER_FALSE = new NotifyEnterFlag(false);
|
||||||
|
|
||||||
private NotifyEnterFlag(boolean value) {
|
private NotifyEnterFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_NOTIFY_ENTER);
|
super(value, TranslatableCaption.of("flags.flag_description_notify_enter"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected NotifyEnterFlag flagOf(@Nonnull Boolean value) {
|
@Override protected NotifyEnterFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class NotifyLeaveFlag extends BooleanFlag<NotifyLeaveFlag> {
|
|||||||
public static final NotifyLeaveFlag NOTIFY_LEAVE_FALSE = new NotifyLeaveFlag(false);
|
public static final NotifyLeaveFlag NOTIFY_LEAVE_FALSE = new NotifyLeaveFlag(false);
|
||||||
|
|
||||||
private NotifyLeaveFlag(boolean value) {
|
private NotifyLeaveFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_NOTIFY_LEAVE);
|
super(value, TranslatableCaption.of("flags.flag_description_notify_leave"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected NotifyLeaveFlag flagOf(@Nonnull Boolean value) {
|
@Override protected NotifyLeaveFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
|
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ public class PlaceFlag extends BlockTypeListFlag<PlaceFlag> {
|
|||||||
public static final PlaceFlag PLACE_NONE = new PlaceFlag(Collections.emptyList());
|
public static final PlaceFlag PLACE_NONE = new PlaceFlag(Collections.emptyList());
|
||||||
|
|
||||||
protected PlaceFlag(List<BlockTypeWrapper> blockTypeList) {
|
protected PlaceFlag(List<BlockTypeWrapper> blockTypeList) {
|
||||||
super(blockTypeList, Captions.FLAG_DESCRIPTION_PLACE);
|
super(blockTypeList, TranslatableCaption.of("flags.flag_description_place"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected PlaceFlag flagOf(@Nonnull List<BlockTypeWrapper> value) {
|
@Override protected PlaceFlag flagOf(@Nonnull List<BlockTypeWrapper> value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class PlayerInteractFlag extends BooleanFlag<PlayerInteractFlag> {
|
|||||||
public static final PlayerInteractFlag PLAYER_INTERACT_FALSE = new PlayerInteractFlag(false);
|
public static final PlayerInteractFlag PLAYER_INTERACT_FALSE = new PlayerInteractFlag(false);
|
||||||
|
|
||||||
private PlayerInteractFlag(boolean value) {
|
private PlayerInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_PLAYER_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_player_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected PlayerInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected PlayerInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -38,7 +38,7 @@ public class PreventCreativeCopyFlag extends BooleanFlag<PreventCreativeCopyFlag
|
|||||||
new PreventCreativeCopyFlag(false);
|
new PreventCreativeCopyFlag(false);
|
||||||
|
|
||||||
private PreventCreativeCopyFlag(@Nonnull final Boolean value) {
|
private PreventCreativeCopyFlag(@Nonnull final Boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_PREVENT_CREATIVE_COPY);
|
super(value, TranslatableCaption.of("flags.flag_description_prevent_creative_copy"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected PreventCreativeCopyFlag flagOf(@Nonnull final Boolean value) {
|
@Override protected PreventCreativeCopyFlag flagOf(@Nonnull final Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.DoubleFlag;
|
import com.plotsquared.core.plot.flag.types.DoubleFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -34,7 +34,7 @@ public class PriceFlag extends DoubleFlag<PriceFlag> {
|
|||||||
public static final PriceFlag PRICE_NOT_BUYABLE = new PriceFlag(0D);
|
public static final PriceFlag PRICE_NOT_BUYABLE = new PriceFlag(0D);
|
||||||
|
|
||||||
protected PriceFlag(@Nonnull Double value) {
|
protected PriceFlag(@Nonnull Double value) {
|
||||||
super(value, Double.MIN_NORMAL, Double.MAX_VALUE, Captions.FLAG_DESCRIPTION_PRICE);
|
super(value, Double.MIN_NORMAL, Double.MAX_VALUE, TranslatableCaption.of("flags.flag_description_price"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected PriceFlag flagOf(@Nonnull Double value) {
|
@Override protected PriceFlag flagOf(@Nonnull Double value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class PveFlag extends BooleanFlag<PveFlag> {
|
|||||||
public static final PveFlag PVE_FALSE = new PveFlag(false);
|
public static final PveFlag PVE_FALSE = new PveFlag(false);
|
||||||
|
|
||||||
private PveFlag(boolean value) {
|
private PveFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_PVE);
|
super(value, TranslatableCaption.of("flags.flag_description_pve"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected PveFlag flagOf(@Nonnull Boolean value) {
|
@Override protected PveFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class PvpFlag extends BooleanFlag<PvpFlag> {
|
|||||||
public static final PvpFlag PVP_FALSE = new PvpFlag(false);
|
public static final PvpFlag PVP_FALSE = new PvpFlag(false);
|
||||||
|
|
||||||
private PvpFlag(boolean value) {
|
private PvpFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_PVP);
|
super(value, TranslatableCaption.of("flags.flag_description_pvp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected PvpFlag flagOf(@Nonnull Boolean value) {
|
@Override protected PvpFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class RedstoneFlag extends BooleanFlag<RedstoneFlag> {
|
|||||||
public static final RedstoneFlag REDSTONE_FALSE = new RedstoneFlag(false);
|
public static final RedstoneFlag REDSTONE_FALSE = new RedstoneFlag(false);
|
||||||
|
|
||||||
private RedstoneFlag(boolean value) {
|
private RedstoneFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_REDSTONE);
|
super(value, TranslatableCaption.of("flags.flag_description_redstone"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected RedstoneFlag flagOf(@Nonnull Boolean value) {
|
@Override protected RedstoneFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class ServerPlotFlag extends BooleanFlag<ServerPlotFlag> {
|
|||||||
public static final ServerPlotFlag SERVER_PLOT_FALSE = new ServerPlotFlag(false);
|
public static final ServerPlotFlag SERVER_PLOT_FALSE = new ServerPlotFlag(false);
|
||||||
|
|
||||||
private ServerPlotFlag(boolean value) {
|
private ServerPlotFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_SERVER_PLOT);
|
super(value, TranslatableCaption.of("flags.flag_description_server_plot"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected ServerPlotFlag flagOf(@Nonnull Boolean value) {
|
@Override protected ServerPlotFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class SnowFormFlag extends BooleanFlag<SnowFormFlag> {
|
|||||||
public static final SnowFormFlag SNOW_FORM_FALSE = new SnowFormFlag(false);
|
public static final SnowFormFlag SNOW_FORM_FALSE = new SnowFormFlag(false);
|
||||||
|
|
||||||
private SnowFormFlag(boolean value) {
|
private SnowFormFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_SNOW_FORM);
|
super(value, TranslatableCaption.of("flags.flag_description_snow_for"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected SnowFormFlag flagOf(@Nonnull Boolean value) {
|
@Override protected SnowFormFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class SnowMeltFlag extends BooleanFlag<SnowMeltFlag> {
|
|||||||
public static final SnowMeltFlag SNOW_MELT_FALSE = new SnowMeltFlag(false);
|
public static final SnowMeltFlag SNOW_MELT_FALSE = new SnowMeltFlag(false);
|
||||||
|
|
||||||
private SnowMeltFlag(boolean value) {
|
private SnowMeltFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_SNOW_MELT);
|
super(value, TranslatableCaption.of("flags.flag_description_snow_melt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected SnowMeltFlag flagOf(@Nonnull Boolean value) {
|
@Override protected SnowMeltFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class SoilDryFlag extends BooleanFlag<SoilDryFlag> {
|
|||||||
public static final SoilDryFlag SOIL_DRY_FALSE = new SoilDryFlag(false);
|
public static final SoilDryFlag SOIL_DRY_FALSE = new SoilDryFlag(false);
|
||||||
|
|
||||||
private SoilDryFlag(boolean value) {
|
private SoilDryFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_SOIL_DRY);
|
super(value, TranslatableCaption.of("flags.flag_description_soil_dry"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected SoilDryFlag flagOf(@Nonnull Boolean value) {
|
@Override protected SoilDryFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class TamedAttackFlag extends BooleanFlag<TamedAttackFlag> {
|
|||||||
public static final TamedAttackFlag TAMED_ATTACK_FALSE = new TamedAttackFlag(false);
|
public static final TamedAttackFlag TAMED_ATTACK_FALSE = new TamedAttackFlag(false);
|
||||||
|
|
||||||
private TamedAttackFlag(boolean value) {
|
private TamedAttackFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_TAMED_ATTACK);
|
super(value, TranslatableCaption.of("flags.flag_description_tamed_attack"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected TamedAttackFlag flagOf(@Nonnull Boolean value) {
|
@Override protected TamedAttackFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class TamedInteractFlag extends BooleanFlag<TamedInteractFlag> {
|
|||||||
public static final TamedInteractFlag TAMED_INTERACT_FALSE = new TamedInteractFlag(false);
|
public static final TamedInteractFlag TAMED_INTERACT_FALSE = new TamedInteractFlag(false);
|
||||||
|
|
||||||
private TamedInteractFlag(boolean value) {
|
private TamedInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_TAMED_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_tamed_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected TamedInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected TamedInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.LongFlag;
|
import com.plotsquared.core.plot.flag.types.LongFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -34,7 +34,7 @@ public class TimeFlag extends LongFlag<TimeFlag> {
|
|||||||
public static final TimeFlag TIME_DISABLED = new TimeFlag(Long.MIN_VALUE);
|
public static final TimeFlag TIME_DISABLED = new TimeFlag(Long.MIN_VALUE);
|
||||||
|
|
||||||
protected TimeFlag(@Nonnull Long value) {
|
protected TimeFlag(@Nonnull Long value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_TIME);
|
super(value, TranslatableCaption.of("flags.flag_description_time"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected TimeFlag flagOf(@Nonnull Long value) {
|
@Override protected TimeFlag flagOf(@Nonnull Long value) {
|
||||||
|
@ -25,9 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -42,14 +43,13 @@ public class TitlesFlag extends PlotFlag<TitlesFlag.TitlesFlagValue, TitlesFlag>
|
|||||||
public static final TitlesFlag TITLES_FALSE = new TitlesFlag(TitlesFlagValue.FALSE);
|
public static final TitlesFlag TITLES_FALSE = new TitlesFlag(TitlesFlagValue.FALSE);
|
||||||
|
|
||||||
private TitlesFlag(final TitlesFlagValue value) {
|
private TitlesFlag(final TitlesFlagValue value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_ENUM, Captions.FLAG_DESCRIPTION_TITLES);
|
super(value, TranslatableCaption.of("flags.flag_category_enum"), TranslatableCaption.of("flags.flag_description_titles"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public TitlesFlag parse(@Nonnull final String input) throws FlagParseException {
|
@Override public TitlesFlag parse(@Nonnull final String input) throws FlagParseException {
|
||||||
final TitlesFlagValue titlesFlagValue = TitlesFlagValue.fromString(input);
|
final TitlesFlagValue titlesFlagValue = TitlesFlagValue.fromString(input);
|
||||||
if (titlesFlagValue == null) {
|
if (titlesFlagValue == null) {
|
||||||
throw new FlagParseException(this, input, Captions.FLAG_ERROR_ENUM,
|
throw new FlagParseException(this, input, TranslatableCaption.of("flags.flag_error_enum"), Template.of("list", "none, true, false"));
|
||||||
Arrays.asList("none", "true", "false"));
|
|
||||||
}
|
}
|
||||||
return flagOf(titlesFlagValue);
|
return flagOf(titlesFlagValue);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -35,7 +35,7 @@ public class UntrustedVisitFlag extends BooleanFlag<UntrustedVisitFlag> {
|
|||||||
public static final UntrustedVisitFlag UNTRUSTED_VISIT_FLAG_TRUE = new UntrustedVisitFlag(true);
|
public static final UntrustedVisitFlag UNTRUSTED_VISIT_FLAG_TRUE = new UntrustedVisitFlag(true);
|
||||||
|
|
||||||
protected UntrustedVisitFlag(boolean value) {
|
protected UntrustedVisitFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_UNTRUSTED);
|
super(value, TranslatableCaption.of("flags.flag_description_untrusted"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected UntrustedVisitFlag flagOf(@Nonnull Boolean value) {
|
@Override protected UntrustedVisitFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
|
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ public class UseFlag extends BlockTypeListFlag<UseFlag> {
|
|||||||
public static final UseFlag USE_NONE = new UseFlag(Collections.emptyList());
|
public static final UseFlag USE_NONE = new UseFlag(Collections.emptyList());
|
||||||
|
|
||||||
protected UseFlag(List<BlockTypeWrapper> blockTypeList) {
|
protected UseFlag(List<BlockTypeWrapper> blockTypeList) {
|
||||||
super(blockTypeList, Captions.FLAG_DESCRIPTION_USE);
|
super(blockTypeList, TranslatableCaption.of("flags.flag_description_use"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected UseFlag flagOf(@Nonnull List<BlockTypeWrapper> value) {
|
@Override protected UseFlag flagOf(@Nonnull List<BlockTypeWrapper> value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class VehicleBreakFlag extends BooleanFlag<VehicleBreakFlag> {
|
|||||||
public static final VehicleBreakFlag VEHICLE_BREAK_FALSE = new VehicleBreakFlag(false);
|
public static final VehicleBreakFlag VEHICLE_BREAK_FALSE = new VehicleBreakFlag(false);
|
||||||
|
|
||||||
private VehicleBreakFlag(boolean value) {
|
private VehicleBreakFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_BREAK);
|
super(value, TranslatableCaption.of("flags.flag_description_vehicle_break"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected VehicleBreakFlag flagOf(@Nonnull Boolean value) {
|
@Override protected VehicleBreakFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -35,7 +35,7 @@ public class VehicleCapFlag extends NonNegativeIntegerFlag<VehicleCapFlag> {
|
|||||||
new VehicleCapFlag(Integer.MAX_VALUE);
|
new VehicleCapFlag(Integer.MAX_VALUE);
|
||||||
|
|
||||||
protected VehicleCapFlag(int value) {
|
protected VehicleCapFlag(int value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_CAP);
|
super(value, TranslatableCaption.of("flags.flag_description_vehicle_cap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected VehicleCapFlag flagOf(@Nonnull Integer value) {
|
@Override protected VehicleCapFlag flagOf(@Nonnull Integer value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class VehiclePlaceFlag extends BooleanFlag<VehiclePlaceFlag> {
|
|||||||
public static final VehiclePlaceFlag VEHICLE_PLACE_FALSE = new VehiclePlaceFlag(false);
|
public static final VehiclePlaceFlag VEHICLE_PLACE_FALSE = new VehiclePlaceFlag(false);
|
||||||
|
|
||||||
private VehiclePlaceFlag(boolean value) {
|
private VehiclePlaceFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_PLACE);
|
super(value, TranslatableCaption.of("flags.flag_description_vehicle_place"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected VehiclePlaceFlag flagOf(@Nonnull Boolean value) {
|
@Override protected VehiclePlaceFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class VehicleUseFlag extends BooleanFlag<VehicleUseFlag> {
|
|||||||
public static final VehicleUseFlag VEHICLE_USE_FALSE = new VehicleUseFlag(false);
|
public static final VehicleUseFlag VEHICLE_USE_FALSE = new VehicleUseFlag(false);
|
||||||
|
|
||||||
private VehicleUseFlag(boolean value) {
|
private VehicleUseFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_VEHICLE_USE);
|
super(value, TranslatableCaption.of("flags.flag_description_vehicle_use"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected VehicleUseFlag flagOf(@Nonnull Boolean value) {
|
@Override protected VehicleUseFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -38,7 +38,7 @@ public class VillagerInteractFlag extends BooleanFlag<VillagerInteractFlag> {
|
|||||||
new VillagerInteractFlag(false);
|
new VillagerInteractFlag(false);
|
||||||
|
|
||||||
private VillagerInteractFlag(boolean value) {
|
private VillagerInteractFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_VILLAGER_INTERACT);
|
super(value, TranslatableCaption.of("flags.flag_description_villager_interact"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected VillagerInteractFlag flagOf(@Nonnull Boolean value) {
|
@Override protected VillagerInteractFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -36,7 +36,7 @@ public class VineGrowFlag extends BooleanFlag<VineGrowFlag> {
|
|||||||
public static final VineGrowFlag VINE_GROW_FALSE = new VineGrowFlag(false);
|
public static final VineGrowFlag VINE_GROW_FALSE = new VineGrowFlag(false);
|
||||||
|
|
||||||
private VineGrowFlag(boolean value) {
|
private VineGrowFlag(boolean value) {
|
||||||
super(value, Captions.FLAG_DESCRIPTION_VINE_GROW);
|
super(value, TranslatableCaption.of("flags.flag_description_vine_grow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected VineGrowFlag flagOf(@Nonnull Boolean value) {
|
@Override protected VineGrowFlag flagOf(@Nonnull Boolean value) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package com.plotsquared.core.plot.flag.implementations;
|
package com.plotsquared.core.plot.flag.implementations;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.PlotWeather;
|
import com.plotsquared.core.plot.PlotWeather;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ public class WeatherFlag extends PlotFlag<PlotWeather, WeatherFlag> {
|
|||||||
* @param value Flag value
|
* @param value Flag value
|
||||||
*/
|
*/
|
||||||
protected WeatherFlag(@Nonnull PlotWeather value) {
|
protected WeatherFlag(@Nonnull PlotWeather value) {
|
||||||
super(value, Captions.FLAG_CATEGORY_WEATHER, Captions.FLAG_DESCRIPTION_WEATHER);
|
super(value, TranslatableCaption.of("flags.flag_category_weather"), TranslatableCaption.of("flags.flag_description_weather"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public WeatherFlag parse(@Nonnull String input) {
|
@Override public WeatherFlag parse(@Nonnull String input) {
|
||||||
|
@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.types;
|
|||||||
|
|
||||||
import com.plotsquared.core.configuration.caption.Caption;
|
import com.plotsquared.core.configuration.caption.Caption;
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.plot.flag.FlagParseException;
|
import com.plotsquared.core.plot.flag.FlagParseException;
|
||||||
import com.plotsquared.core.util.BlockUtil;
|
import com.plotsquared.core.util.BlockUtil;
|
||||||
import com.sk89q.worldedit.world.block.BlockCategory;
|
import com.sk89q.worldedit.world.block.BlockCategory;
|
||||||
@ -87,7 +88,7 @@ public abstract class BlockTypeListFlag<F extends ListFlag<BlockTypeWrapper, F>>
|
|||||||
|
|
||||||
private BlockTypeWrapper getCategory(final String blockString) throws FlagParseException {
|
private BlockTypeWrapper getCategory(final String blockString) throws FlagParseException {
|
||||||
if (!blockString.startsWith("#")) {
|
if (!blockString.startsWith("#")) {
|
||||||
throw new FlagParseException(this, blockString, Captions.FLAG_ERROR_INVALID_BLOCK);
|
throw new FlagParseException(this, blockString, TranslatableCaption.of("flags.flag_error_invalid_block"));
|
||||||
}
|
}
|
||||||
String categoryId = blockString.substring(1);
|
String categoryId = blockString.substring(1);
|
||||||
BlockTypeWrapper blockTypeWrapper;
|
BlockTypeWrapper blockTypeWrapper;
|
||||||
@ -96,7 +97,7 @@ public abstract class BlockTypeListFlag<F extends ListFlag<BlockTypeWrapper, F>>
|
|||||||
} else {
|
} else {
|
||||||
BlockCategory blockCategory = BlockCategory.REGISTRY.get(categoryId);
|
BlockCategory blockCategory = BlockCategory.REGISTRY.get(categoryId);
|
||||||
if (blockCategory == null) {
|
if (blockCategory == null) {
|
||||||
throw new FlagParseException(this, blockString, Captions.FLAG_ERROR_INVALID_BLOCK);
|
throw new FlagParseException(this, blockString, TranslatableCaption.of("flags.flag_error_invalid_block"));
|
||||||
}
|
}
|
||||||
blockTypeWrapper = BlockTypeWrapper.get(blockCategory);
|
blockTypeWrapper = BlockTypeWrapper.get(blockCategory);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user