diff --git a/src/main/java/org/mvplugins/multiverse/core/command/MVCommandContexts.java b/src/main/java/org/mvplugins/multiverse/core/command/MVCommandContexts.java index 616f1d613..4564f4849 100644 --- a/src/main/java/org/mvplugins/multiverse/core/command/MVCommandContexts.java +++ b/src/main/java/org/mvplugins/multiverse/core/command/MVCommandContexts.java @@ -39,7 +39,9 @@ import org.mvplugins.multiverse.core.display.filters.DefaultContentFilter; import org.mvplugins.multiverse.core.display.filters.RegexContentFilter; import org.mvplugins.multiverse.core.exceptions.command.MVInvalidCommandArgument; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.locale.message.Message; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement.Replace; import org.mvplugins.multiverse.core.utils.PlayerFinder; import org.mvplugins.multiverse.core.utils.REPatterns; import org.mvplugins.multiverse.core.utils.tick.TickDuration; @@ -168,15 +170,67 @@ private GeneratorPlugin parseGeneratorPlugin(BukkitCommandExecutionContext conte return generatorPlugin; } + private Message loadedMultiverseWorldPlayerOnlyMessage() { + return Message.of(MVCorei18n.COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_PLAYERSONLY); + } + + private Message loadedMultiverseWorldIssuerMessage() { + return Message.of(MVCorei18n.COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_ISSUER); + } + + private Message loadedMultiverseWorldInputConsoleMessage(String worldName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_INPUTCONSOLE, + Replace.WORLD.with(worldName)); + } + + private Message loadedMultiverseWorldInputMessage(String worldName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_INPUT, Replace.WORLD.with(worldName)); + } + + private Message multiverseWorldPlayerOnlyMessage() { + return Message.of(MVCorei18n.COMMANDS_ERROR_MULTIVERSEWORLD_PLAYERSONLY); + } + + private Message multiverseWorldIssuerMessage() { + return Message.of(MVCorei18n.COMMANDS_ERROR_MULTIVERSEWORLD_ISSUER); + } + + private Message multiverseWorldInputConsoleMessage(String worldName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_MULTIVERSEWORLD_INPUTCONSOLE, Replace.WORLD.with(worldName)); + } + + private Message multiverseWorldInputMessage(String worldName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_MULTIVERSEWORLD_INPUT, Replace.WORLD.with(worldName)); + } + + private Message playerOnlyMessage() { + return Message.of(MVCorei18n.COMMANDS_ERROR_PLAYERSONLY); + } + + private Message playerInputIssuerMessage(String playerName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_PLAYER_ISSUERINPUT, Replace.PLAYER.with(playerName)); + } + + private Message playerInputMessage(String playerName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_PLAYER_INPUT, Replace.PLAYER.with(playerName)); + } + + private Message playerSelectorMessage(String selector) { + return Message.of(MVCorei18n.COMMANDS_ERROR_PLAYER_SELECTOR, Replace.PLAYER.with(selector)); + } + + private Message playersInputMessage(String playerName) { + return Message.of(MVCorei18n.COMMANDS_ERROR_PLAYERS_INPUT, Replace.PLAYER.with(playerName)); + } private IssuerAwareContextBuilder loadedMultiverseWorldContextBuilder() { return new IssuerAwareContextBuilder() .fromPlayer((context, player) -> worldManager.getLoadedWorld(player.getWorld()).getOrNull()) .fromInput((context, input) -> getLoadedMultiverseWorld(input)) - .issuerOnlyFailMessage((context) -> Message.of("This command can only be used by a player in a loaded Multiverse World.")) - .issuerAwarePlayerFailMessage((context, player) -> Message.of("You are not in a loaded multiverse world. Either specify a multiverse world name or use this command in a loaded multiverse world.")) - .issuerAwareInputFailMessage((context, input) -> Message.of("World '" + input + "' is not a loaded multiverse world. Remember to specify the world name when using this command in console.")) - .inputOnlyFailMessage((context, input) -> Message.of("World " + input + " is not a loaded multiverse world.")); + .issuerOnlyFailMessage((context) -> loadedMultiverseWorldPlayerOnlyMessage()) + .issuerAwarePlayerFailMessage((context, player) -> loadedMultiverseWorldIssuerMessage()) + .issuerAwareInputFailMessage((context, input) -> loadedMultiverseWorldInputConsoleMessage(input)) + .inputOnlyFailMessage((context, input) -> loadedMultiverseWorldInputMessage(input)); } private IssuerAwareContextBuilder loadedMultiverseWorldArrayContextBuilder() { @@ -194,16 +248,17 @@ private IssuerAwareContextBuilder loadedMultiverseWorld } LoadedMultiverseWorld world = getLoadedMultiverseWorld(worldName); if (world == null) { - throw new InvalidCommandArgument("World " + worldName + " is not a loaded multiverse world."); + throw new InvalidCommandArgument( + loadedMultiverseWorldInputMessage(worldName).formatted(context.getIssuer())); } worlds.add(world); } return worlds.isEmpty() ? null : worlds.toArray(new LoadedMultiverseWorld[0]); }) - .issuerOnlyFailMessage((context) -> Message.of("This command can only be used by a player in a loaded Multiverse World.")) - .issuerAwarePlayerFailMessage((context, player) -> Message.of("You are not in a loaded multiverse world. Either specify a multiverse world name or use this command in a loaded multiverse world.")) - .issuerAwareInputFailMessage((context, input) -> Message.of("World '" + input + "' is not a loaded multiverse world. Remember to specify the world name when using this command in console.")) - .inputOnlyFailMessage((context, input) -> Message.of("World " + input + " is not a loaded multiverse world.")); + .issuerOnlyFailMessage((context) -> loadedMultiverseWorldPlayerOnlyMessage()) + .issuerAwarePlayerFailMessage((context, player) -> loadedMultiverseWorldIssuerMessage()) + .issuerAwareInputFailMessage((context, input) -> loadedMultiverseWorldInputConsoleMessage(input)) + .inputOnlyFailMessage((context, input) -> loadedMultiverseWorldInputMessage(input)); } @Nullable @@ -217,10 +272,10 @@ private IssuerAwareContextBuilder multiverseWorldContextBuilder return new IssuerAwareContextBuilder() .fromPlayer((context, player) -> worldManager.getWorld(player.getWorld()).getOrNull()) .fromInput((context, input) -> getMultiverseWorld(input)) - .issuerOnlyFailMessage((context) -> Message.of("This command can only be used by a player in a Multiverse World.")) - .issuerAwarePlayerFailMessage((context, player) -> Message.of("You are not in a multiverse world. Either specify a multiverse world name or use this command in a multiverse world.")) - .issuerAwareInputFailMessage((context, input) -> Message.of("World '" + input + "' is not a multiverse world. Remember to specify the world name when using this command in console.")) - .inputOnlyFailMessage((context, input) -> Message.of("World " + input + " is not a multiverse world.")); + .issuerOnlyFailMessage((context) -> multiverseWorldPlayerOnlyMessage()) + .issuerAwarePlayerFailMessage((context, player) -> multiverseWorldIssuerMessage()) + .issuerAwareInputFailMessage((context, input) -> multiverseWorldInputConsoleMessage(input)) + .inputOnlyFailMessage((context, input) -> multiverseWorldInputMessage(input)); } private IssuerAwareContextBuilder multiverseWorldArrayContextBuilder() { @@ -238,16 +293,17 @@ private IssuerAwareContextBuilder multiverseWorldArrayContext } MultiverseWorld world = getMultiverseWorld(worldName); if (world == null) { - throw new InvalidCommandArgument("World " + worldName + " is not a multiverse world."); + throw new InvalidCommandArgument( + multiverseWorldInputMessage(worldName).formatted(context.getIssuer())); } worlds.add(world); } return worlds.isEmpty() ? null : worlds.toArray(new MultiverseWorld[0]); }) - .issuerOnlyFailMessage((context) -> Message.of("This command can only be used by a player in a Multiverse World.")) - .issuerAwarePlayerFailMessage((context, player) -> Message.of("You are not in a multiverse world. Either specify a multiverse world name or use this command in a multiverse world.")) - .issuerAwareInputFailMessage((context, input) -> Message.of("World '" + input + "' is not a multiverse world. Remember to specify the world name when using this command in console.")) - .inputOnlyFailMessage((context, input) -> Message.of("World " + input + " is not a multiverse world.")); + .issuerOnlyFailMessage((context) -> multiverseWorldPlayerOnlyMessage()) + .issuerAwarePlayerFailMessage((context, player) -> multiverseWorldIssuerMessage()) + .issuerAwareInputFailMessage((context, input) -> multiverseWorldInputConsoleMessage(input)) + .inputOnlyFailMessage((context, input) -> multiverseWorldInputMessage(input)); } @Nullable @@ -267,9 +323,9 @@ private IssuerAwareContextBuilder playerContextBuilder() { return new IssuerAwareContextBuilder() .fromPlayer((context, player) -> player) .fromInput((context, input) -> PlayerFinder.get(input, context.getSender())) - .issuerOnlyFailMessage((context) -> Message.of("This command can only be used by a player.")) - .issuerAwareInputFailMessage((context, input) -> Message.of("Invalid player: " + input + ". Either specify an online player or use this command as a player.")) - .inputOnlyFailMessage((context, input) -> Message.of("Player " + input + " not found.")); + .issuerOnlyFailMessage((context) -> playerOnlyMessage()) + .issuerAwareInputFailMessage((context, input) -> playerInputIssuerMessage(input)) + .inputOnlyFailMessage((context, input) -> playerInputMessage(input)); } private IssuerAwareContextBuilder playerArrayContextBuilder() { @@ -286,13 +342,13 @@ private IssuerAwareContextBuilder playerArrayContextBuilder() { throw new InvalidCommandArgument(failure.getLocalizedMessage() + " " + Option.of(failure.getCause()).map(Throwable::getLocalizedMessage).getOrElse("")); })) - .issuerOnlyFailMessage((context) -> Message.of("This command can only be used by a player.")) - .issuerAwareInputFailMessage((context, input) -> Message.of("Invalid player: " + input + ". Either specify an online player or use this command as a player.")) + .issuerOnlyFailMessage((context) -> playerOnlyMessage()) + .issuerAwareInputFailMessage((context, input) -> playerInputIssuerMessage(input)) .inputOnlyFailMessage((context, input) -> { if (PlayerFinder.isSelector(input)) { - return Message.of("No player(s) matched selector: " + input + "."); + return playerSelectorMessage(input); } - return Message.of("Player(s) " + input + " not found."); + return playersInputMessage(input); }); } diff --git a/src/main/java/org/mvplugins/multiverse/core/command/context/issueraware/IssuerAwareContextBuilder.java b/src/main/java/org/mvplugins/multiverse/core/command/context/issueraware/IssuerAwareContextBuilder.java index 49421c52f..d9a7cc0f8 100644 --- a/src/main/java/org/mvplugins/multiverse/core/command/context/issueraware/IssuerAwareContextBuilder.java +++ b/src/main/java/org/mvplugins/multiverse/core/command/context/issueraware/IssuerAwareContextBuilder.java @@ -6,12 +6,16 @@ import co.aikar.commands.contexts.IssuerAwareContextResolver; import org.bukkit.entity.Player; import org.jetbrains.annotations.ApiStatus; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.locale.message.Message; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement.Replace; import java.util.Objects; import java.util.function.BiFunction; import java.util.function.Function; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + /** * Reusable logic of issuer only and issuer aware context resolvers * @@ -22,10 +26,17 @@ public final class IssuerAwareContextBuilder { private BiFunction fromPlayer; private BiFunction fromInput; - private Function issuerOnlyFailMessage = context -> Message.of("This command can only be used by a player."); - private BiFunction issuerAwarePlayerFailMessage = (context, player) -> Message.of("Unable to resolve context for player '" + player.getName() + "'."); - private BiFunction issuerAwareInputFailMessage = (context, input) -> Message.of("Unable to resolve context for input '" + input + "'."); - private BiFunction inputOnlyFailMessage = (context, input) -> Message.of("Unable to resolve context for input '" + input + "'."); + private Function issuerOnlyFailMessage = + context -> Message.of(MVCorei18n.COMMANDS_ERROR_PLAYERSONLY); + private BiFunction issuerAwarePlayerFailMessage = + (context, player) -> Message.of(MVCorei18n.COMMANDS_ERROR_RESOLVE_PLAYER, + Replace.PLAYER.with(player.getName())); + private BiFunction issuerAwareInputFailMessage = + (context, input) -> Message.of(MVCorei18n.COMMANDS_ERROR_RESOLVE_INPUT, + replace("{input}").with(input)); + private BiFunction inputOnlyFailMessage = + (context, input) -> Message.of(MVCorei18n.COMMANDS_ERROR_RESOLVE_INPUT, + replace("{input}").with(input)); public IssuerAwareContextBuilder() { } diff --git a/src/main/java/org/mvplugins/multiverse/core/command/flags/RemovePlayerDestinationFlags.java b/src/main/java/org/mvplugins/multiverse/core/command/flags/RemovePlayerDestinationFlags.java index a2f7fb875..b10096be3 100644 --- a/src/main/java/org/mvplugins/multiverse/core/command/flags/RemovePlayerDestinationFlags.java +++ b/src/main/java/org/mvplugins/multiverse/core/command/flags/RemovePlayerDestinationFlags.java @@ -1,6 +1,5 @@ package org.mvplugins.multiverse.core.command.flags; -import co.aikar.commands.InvalidCommandArgument; import jakarta.inject.Inject; import org.bukkit.Bukkit; import org.jetbrains.annotations.ApiStatus; @@ -13,6 +12,8 @@ import org.mvplugins.multiverse.core.destination.DestinationsProvider; import org.mvplugins.multiverse.core.destination.core.WorldDestination; import org.mvplugins.multiverse.core.exceptions.command.MVInvalidCommandArgument; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.world.WorldManager; @ApiStatus.AvailableSince("5.7") @@ -55,7 +56,8 @@ private RemovePlayerDestinationFlags( .addAlias("-r") .defaultValue(() -> worldManager.getDefaultWorld() .map(defaultWorld -> worldDestination.fromWorld(defaultWorld)) - .getOrElseThrow(() -> new InvalidCommandArgument("No default world found, so the --remove-players flag requires a destination argument."))) //TODO: locale + .getOrElseThrow(() -> MVInvalidCommandArgument.of( + Message.of(MVCorei18n.COMMANDS_ERROR_REMOVEPLAYERS_NODEFAULT)))) .completion(input -> destinationsProvider.suggestDestinationStrings(Bukkit.getConsoleSender(), input)) .context(input -> destinationsProvider.parseDestination(input) .getOrThrow(failure -> diff --git a/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueueManager.java b/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueueManager.java index c9bc14a12..abdbd6b14 100644 --- a/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueueManager.java +++ b/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueueManager.java @@ -15,7 +15,6 @@ import io.vavr.control.Option; import jakarta.inject.Inject; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.block.data.type.CommandBlock; import org.bukkit.command.BlockCommandSender; import org.bukkit.command.CommandSender; @@ -28,6 +27,7 @@ import org.mvplugins.multiverse.core.MultiverseCore; import org.mvplugins.multiverse.core.command.MVCommandIssuer; import org.mvplugins.multiverse.core.config.CoreConfig; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.utils.result.Attempt; import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.*; @@ -79,8 +79,9 @@ public void addToQueue(CommandQueuePayload payload) { if (config.getUseConfirmOtp()) { confirmCommand += " " + payload.otp(); } - payload.issuer().sendMessage(String.format("Run %s%s %sto continue. This will expire in %s seconds.", - ChatColor.GREEN, confirmCommand, ChatColor.WHITE, config.getConfirmTimeout())); + payload.issuer().sendMessage(MVCorei18n.QUEUECOMMAND_PROMPT, + replace("{command}").with(confirmCommand), + replace("{timeout}").with(config.getConfirmTimeout())); } /** @@ -127,7 +128,7 @@ private Runnable expireRunnable(@NotNull String senderName) { // Payload already removed return; } - payload.issuer().sendMessage("Your queued command has expired."); + payload.issuer().sendMessage(MVCorei18n.QUEUECOMMAND_EXPIRED); }; } diff --git a/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueuePayload.java b/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueuePayload.java index e3c638e76..a876ee62d 100644 --- a/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueuePayload.java +++ b/src/main/java/org/mvplugins/multiverse/core/command/queue/CommandQueuePayload.java @@ -5,6 +5,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.locale.message.Message; /** @@ -23,12 +24,10 @@ public static CommandQueuePayload issuer(@NotNull MVCommandIssuer issuer) { return new CommandQueuePayload(issuer); } - private static final String DEFAULT_PROMPT_MESSAGE = "The command you are trying to run is deemed dangerous."; // todo: localize - private final MVCommandIssuer issuer; private String otp; private Runnable action = () -> {}; - private Message prompt = Message.of(DEFAULT_PROMPT_MESSAGE); + private Message prompt = Message.of(MVCorei18n.QUEUECOMMAND_DEFAULTPROMPT); private BukkitTask expireTask; protected CommandQueuePayload(@NotNull MVCommandIssuer issuer) { diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/AnchorDeleteCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/AnchorDeleteCommand.java index d296b222d..6199820f3 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/AnchorDeleteCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/AnchorDeleteCommand.java @@ -12,6 +12,9 @@ import org.mvplugins.multiverse.core.anchor.AnchorManager; import org.mvplugins.multiverse.core.anchor.MultiverseAnchor; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.MVCorei18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service final class AnchorDeleteCommand extends CoreCommand { @@ -35,9 +38,9 @@ void onAnchorDeleteCommand( @Description("") MultiverseAnchor anchor) { if (anchorManager.deleteAnchor(anchor).isSuccess()) { - issuer.sendMessage("&aAnchor &f" + anchor.getName() + "&a deleted."); + issuer.sendMessage(MVCorei18n.ANCHOR_DELETE_SUCCESS, replace("{anchor}").with(anchor.getName())); } else { - issuer.sendMessage("&cFailed to delete anchor."); + issuer.sendError(MVCorei18n.ANCHOR_DELETE_FAILURE); } } } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/AnchorListCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/AnchorListCommand.java index f21952019..35121945e 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/AnchorListCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/AnchorListCommand.java @@ -15,15 +15,18 @@ import org.mvplugins.multiverse.core.anchor.AnchorManager; import org.mvplugins.multiverse.core.command.MVCommandIssuer; -import org.mvplugins.multiverse.core.command.MVCommandManager; import org.mvplugins.multiverse.core.command.flag.ParsedCommandFlags; import org.mvplugins.multiverse.core.command.flags.PageFilterFlags; import org.mvplugins.multiverse.core.display.ContentDisplay; import org.mvplugins.multiverse.core.display.filters.DefaultContentFilter; import org.mvplugins.multiverse.core.display.handlers.PagedSendHandler; import org.mvplugins.multiverse.core.display.parsers.ListContentProvider; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.teleportation.LocationManipulation; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class AnchorListCommand extends CoreCommand { @@ -58,18 +61,19 @@ void onAnchorListCommand( ContentDisplay.create() .addContent(ListContentProvider.forContent(getAnchors(issuer.getPlayer()))) .withSendHandler(PagedSendHandler.create() - .withHeader("&3==== [ Multiverse Anchors ] ====") + .withHeader(Message.of(MVCorei18n.ANCHOR_LIST_HEADER)) .doPagination(true) .withTargetPage(parsedFlags.flagValue(flags.page, 1)) .withFilter(parsedFlags.flagValue(flags.filter, DefaultContentFilter.get()))) .send(issuer); } - private List getAnchors(Player player) { + private List getAnchors(Player player) { return anchorManager.getAnchors(player).stream() .map(anchor -> - "&a%s&7 - &f%s".formatted( - anchor.getName(), locationManipulation.locationToString(anchor.getLocation()))) + Message.of(MVCorei18n.ANCHOR_LIST_ENTRY, + replace("{anchor}").with(anchor.getName()), + replace("{location}").with(locationManipulation.locationToString(anchor.getLocation())))) .toList(); } } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/AnchorSetCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/AnchorSetCommand.java index 83f7a0723..2a7e95610 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/AnchorSetCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/AnchorSetCommand.java @@ -15,8 +15,11 @@ import org.mvplugins.multiverse.core.anchor.AnchorManager; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.teleportation.LocationManipulation; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class AnchorSetCommand extends CoreCommand { @@ -80,10 +83,12 @@ void onAnchorSetCommand( } private void sendAnchorSetSuccessMessage(MVCommandIssuer issuer, String anchorName, String locationString) { - issuer.sendMessage("&aAnchor &f" + anchorName + "&a set to &f" + locationString); + issuer.sendMessage(MVCorei18n.ANCHOR_SET_SUCCESS, + replace("{anchor}").with(anchorName), + replace("{location}").with(locationString)); } private void sendAnchorSetFailedMessage(MVCommandIssuer issuer, String anchorName) { - issuer.sendMessage("&cFailed to set anchor &f" + anchorName + "."); + issuer.sendMessage(MVCorei18n.ANCHOR_SET_FAILURE, replace("{anchor}").with(anchorName)); } } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java index c5119e535..059086407 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java @@ -94,7 +94,7 @@ private void runDeleteCommand(MVCommandIssuer issuer, MultiverseWorld world, Par : AsyncAttemptsAggregate.emptySuccess(); future.onSuccess(() -> worldTickDeferrer.deferWorldTick(() -> doWorldDeleting(issuer, world))) - .onFailure(() -> issuer.sendError("Failed to teleport one or more players out of the world!")); + .onFailure(() -> issuer.sendError(MVCorei18n.GENERIC_TELEPORTPLAYERS_FAILED)); } private void doWorldDeleting(MVCommandIssuer issuer, MultiverseWorld world) { diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/EntitySpawnConfigCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/EntitySpawnConfigCommand.java index d373fa091..3feaaba26 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/EntitySpawnConfigCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/EntitySpawnConfigCommand.java @@ -21,7 +21,9 @@ import org.mvplugins.multiverse.core.display.filters.DefaultContentFilter; import org.mvplugins.multiverse.core.display.handlers.PagedSendHandler; import org.mvplugins.multiverse.core.display.parsers.ListContentProvider; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.locale.message.Message; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement.Replace; import org.mvplugins.multiverse.core.utils.StringFormatter; import org.mvplugins.multiverse.core.world.MultiverseWorld; import org.mvplugins.multiverse.core.world.WorldManager; @@ -31,6 +33,8 @@ import java.util.Arrays; import java.util.List; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service @Subcommand("entity-spawn-config") final class EntitySpawnConfigCommand extends CoreCommand { @@ -64,21 +68,26 @@ void onInfoCommand( ContentDisplay.create() .addContent(ListContentProvider.forContent(getEntitySpawnConfigList(world))) .withSendHandler(PagedSendHandler.create() - .withHeader(Message.of("==== [ Entity Spawn Config '" + world.getName() + "' ] ====")) + .withHeader(Message.of(MVCorei18n.ENTITYSPAWNCONFIG_INFO_HEADER, + Replace.WORLD.with(world.getName()))) .withLinesPerPage(8) .withTargetPage(parsedFlags.flagValue(flags.page, 1)) .withFilter(parsedFlags.flagValue(flags.filter, DefaultContentFilter.get()))) .send(issuer); } - private List getEntitySpawnConfigList(MultiverseWorld world) { - List list = new ArrayList<>(); + private List getEntitySpawnConfigList(MultiverseWorld world) { + List list = new ArrayList<>(); Arrays.stream(SpawnCategory.values()).forEach(spawnCategory -> { - list.add(spawnCategory.name() + ": "); + list.add(Message.of(MVCorei18n.ENTITYSPAWNCONFIG_INFO_CATEGORY, + replace("{category}").with(spawnCategory.name()))); SpawnCategoryConfig spawnCategoryConfig = world.getEntitySpawnConfig().getSpawnCategoryConfig(spawnCategory); - list.add(" spawn: " + spawnCategoryConfig.isSpawn()); - list.add(" tick-rate: " + spawnCategoryConfig.getTickRate()); - list.add(" exceptions: " + StringFormatter.join(spawnCategoryConfig.getExceptions(), ", ")); + list.add(Message.of(MVCorei18n.ENTITYSPAWNCONFIG_INFO_SPAWN, + replace("{spawn}").with(spawnCategoryConfig.isSpawn()))); + list.add(Message.of(MVCorei18n.ENTITYSPAWNCONFIG_INFO_TICKRATE, + replace("{tickRate}").with(spawnCategoryConfig.getTickRate()))); + list.add(Message.of(MVCorei18n.ENTITYSPAWNCONFIG_INFO_EXCEPTIONS, + replace("{exceptions}").with(StringFormatter.join(spawnCategoryConfig.getExceptions(), ", ")))); }); return list; } @@ -114,9 +123,16 @@ void onModifyCommand( .getStringPropertyHandle() .modifyPropertyString(property, value, action) .andThenTry(worldManager::saveWorldsConfig) - .onSuccess(ignore -> issuer.sendInfo("Successfully set " + property + " to " + value - + " for " + spawnCategory.name() + " in " + world.getName())) - .onFailure(e -> issuer.sendError("Unable to set " + property + " to " + value - + " for " + spawnCategory.name() + " in " + world.getName() + ": " + e.getMessage())); + .onSuccess(ignore -> issuer.sendInfo(MVCorei18n.ENTITYSPAWNCONFIG_MODIFY_SUCCESS, + replace("{property}").with(property), + Replace.VALUE.with(value), + replace("{category}").with(spawnCategory.name()), + Replace.WORLD.with(world.getName()))) + .onFailure(e -> issuer.sendError(MVCorei18n.ENTITYSPAWNCONFIG_MODIFY_FAILURE, + replace("{property}").with(property), + Replace.VALUE.with(value), + replace("{category}").with(spawnCategory.name()), + Replace.WORLD.with(world.getName()), + Replace.ERROR.with(e))); } } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/GeneratorsCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/GeneratorsCommand.java index f4421bf99..8082e9b2a 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/GeneratorsCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/GeneratorsCommand.java @@ -10,7 +10,6 @@ import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import jakarta.inject.Inject; -import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; @@ -23,10 +22,13 @@ import org.mvplugins.multiverse.core.display.handlers.PagedSendHandler; import org.mvplugins.multiverse.core.display.parsers.ListContentProvider; import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.utils.StringFormatter; import org.mvplugins.multiverse.core.world.generators.GeneratorPlugin; import org.mvplugins.multiverse.core.world.generators.GeneratorProvider; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + /** * List all gamerules in your current or specified world. */ @@ -68,7 +70,7 @@ void onGeneratorsListCommand( ContentDisplay.create() .addContent(ListContentProvider.forContent(generators)) .withSendHandler(PagedSendHandler.create() - .withHeader("%s====[ Multiverse Generator List ]====", ChatColor.AQUA) + .withHeader(Message.of(MVCorei18n.GENERATORS_HEADER)) .doPagination(true) .withTargetPage(parsedFlags.flagValue(flags.page, 1)) .withFilter(parsedFlags.flagValue(flags.filter, DefaultContentFilter.get()))) @@ -85,10 +87,13 @@ void onGeneratorsInfoCommand( @Syntax("") GeneratorPlugin generatorPlugin ) { - issuer.sendMessage(ChatColor.RESET + "Generator Plugin: " + generatorPlugin.getPluginName()); - issuer.sendMessage(ChatColor.RESET + "Example usages: "); - issuer.sendMessage(ChatColor.RESET + StringFormatter.join(generatorPlugin.getExampleUsages(), "\n")); - issuer.sendMessage(ChatColor.RESET + "Link to more info: " + generatorPlugin.getInfoLink()); + issuer.sendMessage(MVCorei18n.GENERATORS_INFO_PLUGIN, + replace("{plugin}").with(generatorPlugin.getPluginName())); + issuer.sendMessage(MVCorei18n.GENERATORS_INFO_EXAMPLEUSAGES); + issuer.sendMessage(MVCorei18n.GENERATORS_INFO_USAGES, + replace("{usages}").with(StringFormatter.join(generatorPlugin.getExampleUsages(), "\n"))); + issuer.sendMessage(MVCorei18n.GENERATORS_INFO_INFOLINK, + replace("{link}").with(generatorPlugin.getInfoLink())); } @Service diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java index f82522f1c..08c3e40a7 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java @@ -107,14 +107,14 @@ void onModifyCommand(// SUPPRESS CHECKSTYLE: ParameterNumber replace("{action}").with(action.name().toLowerCase()), replace("{property}").with(propertyName), Replace.WORLD.with(world.getName()), - Replace.ERROR.with(exception.getMessage())); + Replace.ERROR.with(exception)); } else { issuer.sendMessage(MVCorei18n.MODIFY_FAILURE, replace("{action}").with(action.name().toLowerCase()), replace("{property}").with(propertyName), Replace.VALUE.with(propertyValue), Replace.WORLD.with(world.getName()), - Replace.ERROR.with(exception.getMessage())); + Replace.ERROR.with(exception)); } }); } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/PurgeAllEntitiesCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/PurgeAllEntitiesCommand.java index ea3e6335e..90885ae61 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/PurgeAllEntitiesCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/PurgeAllEntitiesCommand.java @@ -10,12 +10,16 @@ import org.bukkit.entity.SpawnCategory; import org.jvnet.hk2.annotations.Service; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement.Replace; import org.mvplugins.multiverse.core.utils.StringFormatter; import org.mvplugins.multiverse.core.world.LoadedMultiverseWorld; import org.mvplugins.multiverse.core.world.entity.EntityPurger; import java.util.List; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class PurgeAllEntitiesCommand extends CoreCommand { @@ -43,12 +47,16 @@ void onPurgeAllEntitiesCommand( ) { if (spawnCategories == null || spawnCategories.length == 0) { int purgeCount = entityPurger.purgeAllEntities(world); - issuer.sendMessage("Successfully purged " + purgeCount + " entities in world " + world.getName() + "."); + issuer.sendMessage(MVCorei18n.PURGEALLENTITIES_SUCCESS, + Replace.COUNT.with(purgeCount), + Replace.WORLD.with(world.getName())); return; } int purgeCount = entityPurger.purgeEntities(world, spawnCategories); - issuer.sendMessage("Successfully purged " + purgeCount + " entities in world " + world.getName() + - " for spawn categories " + StringFormatter.join(List.of(spawnCategories), ", ") + "."); + issuer.sendMessage(MVCorei18n.PURGEALLENTITIES_SUCCESS_CATEGORIES, + Replace.COUNT.with(purgeCount), + Replace.WORLD.with(world.getName()), + replace("{categories}").with(StringFormatter.join(List.of(spawnCategories), ", "))); } } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/PurgeEntitiesCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/PurgeEntitiesCommand.java index a1a10ddd5..737e6839a 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/PurgeEntitiesCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/PurgeEntitiesCommand.java @@ -8,6 +8,8 @@ import jakarta.inject.Inject; import org.jvnet.hk2.annotations.Service; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement.Replace; import org.mvplugins.multiverse.core.world.LoadedMultiverseWorld; import org.mvplugins.multiverse.core.world.entity.EntityPurger; @@ -33,6 +35,8 @@ void onPurgeEntityCommand( LoadedMultiverseWorld world ) { int purgeCount = entityPurger.purgeEntities(world); - issuer.sendMessage("Successfully purged " + purgeCount + " entities in world " + world.getName() + "."); + issuer.sendMessage(MVCorei18n.PURGEENTITIES_SUCCESS, + Replace.COUNT.with(purgeCount), + Replace.WORLD.with(world.getName())); } } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java index 971aa197c..b4cdd84ed 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java @@ -105,7 +105,7 @@ private void runRegenCommand(MVCommandIssuer issuer, LoadedMultiverseWorld world // todo: using future will hide stacktrace future.onSuccess(() -> worldTickDeferrer .deferWorldTick(() -> doWorldRegening(issuer, world, parsedFlags, worldPlayers))) - .onFailure(() -> issuer.sendError("Failed to teleport one or more players out of the world!")); + .onFailure(() -> issuer.sendError(MVCorei18n.GENERIC_TELEPORTPLAYERS_FAILED)); } private void doWorldRegening( diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java index 22d4be28b..69330c5b4 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java @@ -75,7 +75,7 @@ void onRemoveCommand( : AsyncAttemptsAggregate.emptySuccess(); future.onSuccess(() -> doWorldRemoving(issuer, world, parsedFlags)) - .onFailure(() -> issuer.sendError("Failed to teleport one or more players out of the world!")); + .onFailure(() -> issuer.sendError(MVCorei18n.GENERIC_TELEPORTPLAYERS_FAILED)); } private void doWorldRemoving(MVCommandIssuer issuer, MultiverseWorld world, ParsedCommandFlags parsedFlags) { diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java index 4d8b11b92..451b76dc1 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java @@ -88,11 +88,11 @@ private void teleportPlayersToSpawn(MVCommandIssuer issuer, World world, List entities, boolean checkSafety) { LoadedMultiverseWorld mvWorld = worldManager.getLoadedWorld(world).getOrNull(); if (mvWorld == null) { - issuer.sendMessage("The world '" + world.getName() + "' is not a multiverse world!"); + issuer.sendMessage(MVCorei18n.SPAWN_NOTMVWORLD, Replace.WORLD.with(world.getName())); return; } if (!permissionsChecker.checkSpawnPermission(issuer.getIssuer(), entities, mvWorld)) { - issuer.sendMessage("You do not have permission to use this command in this world!"); + issuer.sendMessage(MVCorei18n.SPAWN_NOPERMISSION); return; } @@ -129,16 +129,18 @@ private void handleMultiTeleport(MVCommandIssuer issuer, LoadedMultiverseWorld m .checkSafety(checkSafety) .teleport(entities) .onSuccessCount(successCount -> issuer.sendMessage(MVCorei18n.SPAWN_SUCCESS, - Replace.PLAYER.with(successCount + " players"), //todo: replace this with localised "{count} players" + Replace.PLAYER.with(Message.of(MVCorei18n.GENERIC_PLAYERCOUNT, + Replace.COUNT.with(successCount))), Replace.WORLD.with(mvWorld.getName()))) .onFailureCount(reasonsCountMap -> { for (var entry : reasonsCountMap.entrySet()) { Logging.finer("Failed to teleport %s players to %s: %s", entry.getValue(), mvWorld.getName(), entry.getKey()); issuer.sendError(MVCorei18n.SPAWN_FAILED, - Replace.PLAYER.with(entry.getValue() + " players"), + Replace.PLAYER.with(Message.of(MVCorei18n.GENERIC_PLAYERCOUNT, + Replace.COUNT.with(entry.getValue()))), Replace.WORLD.with(mvWorld.getName()), - Replace.REASON.with(entry.getKey().getMessageKey())); + Replace.REASON.with(Message.of(entry.getKey()))); } }); } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/TeleportCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/TeleportCommand.java index 94a97c467..464d8935d 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/TeleportCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/TeleportCommand.java @@ -94,10 +94,9 @@ private void teleportSinglePlayer(MVCommandIssuer issuer, Player player, DestinationInstance destination, ParsedCommandFlags parsedFlags) { if (!permissionsChecker.checkTeleportPermission(issuer.getIssuer(), player, destination)) { - // TODO localize issuer.sendError(player == issuer.getPlayer() - ? "You do not have permission to teleport yourself!" - : "You do not have permission to teleport other players!"); + ? MVCorei18n.TELEPORT_NOPERMISSION_SELF + : MVCorei18n.TELEPORT_NOPERMISSION_OTHER); return; } @@ -134,8 +133,7 @@ private void teleportMultiplePlayers(MVCommandIssuer issuer, Player[] players, DestinationInstance destination, ParsedCommandFlags parsedFlags) { if (!permissionsChecker.checkTeleportPermission(issuer.getIssuer(), Arrays.asList(players), destination)) { - // TODO localize - issuer.sendError("You do not have permission to teleport all these players!"); + issuer.sendError(MVCorei18n.TELEPORT_NOPERMISSION_ALL); return; } @@ -149,7 +147,8 @@ private void teleportMultiplePlayers(MVCommandIssuer issuer, Player[] players, return; } issuer.sendInfo(MVCorei18n.TELEPORT_SUCCESS, - Replace.PLAYER.with(successCount + " players"), + Replace.PLAYER.with(Message.of(MVCorei18n.GENERIC_PLAYERCOUNT, + Replace.COUNT.with(successCount))), Replace.DESTINATION.with(destination.getDisplayMessage())); }) .onFailureCount(reasonsCountMap -> { @@ -157,7 +156,8 @@ private void teleportMultiplePlayers(MVCommandIssuer issuer, Player[] players, Logging.finer("Failed to teleport %s players to %s: %s", entry.getValue(), destination, entry.getKey()); issuer.sendError(MVCorei18n.TELEPORT_FAILED, - Replace.PLAYER.with(entry.getValue() + " players"), + Replace.PLAYER.with(Message.of(MVCorei18n.GENERIC_PLAYERCOUNT, + Replace.COUNT.with(entry.getValue()))), Replace.DESTINATION.with(destination.getDisplayMessage()), Replace.REASON.with(Message.of(entry.getKey()))); } diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java index 403d2b58c..631e63a27 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java @@ -75,7 +75,7 @@ void onUnloadCommand( : AsyncAttemptsAggregate.emptySuccess(); future.onSuccess(() -> doWorldUnloading(issuer, world, parsedFlags)) - .onFailure(() -> issuer.sendError("Failed to teleport one or more players out of the world!")); + .onFailure(() -> issuer.sendError(MVCorei18n.GENERIC_TELEPORTPLAYERS_FAILED)); } private void doWorldUnloading(MVCommandIssuer issuer, LoadedMultiverseWorld world, ParsedCommandFlags parsedFlags) { diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/WorldBorderCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/WorldBorderCommand.java index 06bf70850..44f0245ef 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/WorldBorderCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/WorldBorderCommand.java @@ -236,6 +236,6 @@ private void setRoundOffError(MVCommandIssuer issuer, TickDuration duration) { private void worldBorderAction(MVCommandIssuer issuer, LoadedMultiverseWorld world, Consumer worldBorderAction) { Try.run(() -> world.getWorldBorder().peek(worldBorderAction)) - .onFailure(error -> issuer.sendError(error.getLocalizedMessage())); + .onFailure(error -> issuer.sendError(MVCorei18n.GENERIC_ERROR_DETAILS, Replace.ERROR.with(error))); } } diff --git a/src/main/java/org/mvplugins/multiverse/core/config/CoreConfigNodes.java b/src/main/java/org/mvplugins/multiverse/core/config/CoreConfigNodes.java index 4b8e615ee..7a6b5ed5f 100644 --- a/src/main/java/org/mvplugins/multiverse/core/config/CoreConfigNodes.java +++ b/src/main/java/org/mvplugins/multiverse/core/config/CoreConfigNodes.java @@ -25,6 +25,8 @@ import org.mvplugins.multiverse.core.dynamiclistener.EventPriorityMapper; import org.mvplugins.multiverse.core.event.MVDebugModeEvent; import org.mvplugins.multiverse.core.exceptions.MultiverseException; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.permissions.PermissionUtils; import org.mvplugins.multiverse.core.teleportation.PassengerModes; import org.mvplugins.multiverse.core.world.helpers.DimensionFinder.DimensionFormat; @@ -371,7 +373,8 @@ private N node(N node) { .defaultValue(128) .name("custom-portal-search-radius") .validator(value -> value < 0 - ? Try.failure(new MultiverseException("The value must be greater than or equal to 0.", null)) + ? Try.failure(new MultiverseException( + Message.of(MVCorei18n.CORE_CONFIG_CUSTOMPORTALSEARCHRADIUS_NONNEGATIVE), null)) : Try.success(null)) .build()); @@ -487,7 +490,8 @@ private N node(N node) { .defaultValue(30) .name("confirm-timeout") .validator(value -> (value <= 0) - ? Try.failure(new MultiverseException("Confirm timeout must be a positive number!")) + ? Try.failure(new MultiverseException( + Message.of(MVCorei18n.CORE_CONFIG_CONFIRMTIMEOUT_POSITIVE))) : Try.success(null)) .build()); @@ -618,7 +622,8 @@ private N node(N node) { .name("global-debug") .suggester(input -> List.of("0", "1", "2", "3")) .validator(value -> (value < 0 || value > 3) - ? Try.failure(new MultiverseException("Debug level must be between 0 and 3.")) + ? Try.failure(new MultiverseException( + Message.of(MVCorei18n.CORE_CONFIG_DEBUGLEVEL_RANGE))) : Try.success(null)) .onLoadAndChange((oldValue, newValue) -> { if (newValue != Logging.getDebugLevel()) { diff --git a/src/main/java/org/mvplugins/multiverse/core/config/node/MapConfigNode.java b/src/main/java/org/mvplugins/multiverse/core/config/node/MapConfigNode.java index 88c7e0b18..5f17dda70 100644 --- a/src/main/java/org/mvplugins/multiverse/core/config/node/MapConfigNode.java +++ b/src/main/java/org/mvplugins/multiverse/core/config/node/MapConfigNode.java @@ -18,6 +18,8 @@ import org.mvplugins.multiverse.core.config.node.serializer.DefaultSerializerProvider; import org.mvplugins.multiverse.core.config.node.serializer.NodeSerializer; import org.mvplugins.multiverse.core.exceptions.MultiverseException; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.utils.REPatterns; import java.util.Collection; @@ -28,6 +30,8 @@ import java.util.function.Function; import java.util.function.Supplier; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + /** * A config node that contains key-value mappings. * @@ -127,8 +131,8 @@ protected MapConfigNode( private Function> defaultYamlKeyValidator() { return key -> Try.of(() -> { if (!REPatterns.YAML_KEY.matcher(String.valueOf(serializeKey(key))).matches()) { - throw new MultiverseException("Invalid yaml key: '" + key + "'. Keys can only " + - "contain alphanumeric characters, underscores and hyphens."); + throw new MultiverseException(Message.of(MVCorei18n.CONFIG_NODE_INVALIDYAMLKEY, + replace("{key}").with(key))); } return null; }); diff --git a/src/main/java/org/mvplugins/multiverse/core/config/node/functions/DefaultStringParserProvider.java b/src/main/java/org/mvplugins/multiverse/core/config/node/functions/DefaultStringParserProvider.java index c237c6971..4551afdc0 100644 --- a/src/main/java/org/mvplugins/multiverse/core/config/node/functions/DefaultStringParserProvider.java +++ b/src/main/java/org/mvplugins/multiverse/core/config/node/functions/DefaultStringParserProvider.java @@ -8,6 +8,10 @@ import io.vavr.control.Option; import io.vavr.control.Try; import org.mvplugins.multiverse.core.exceptions.MultiverseException; +import org.mvplugins.multiverse.core.locale.MVCorei18n; +import org.mvplugins.multiverse.core.locale.message.Message; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; /** * Provides default string parsers for common types. @@ -51,24 +55,33 @@ public static NodeStringParser getDefaultStringParser(Class clazz) { () -> switch (String.valueOf(input).toLowerCase(Locale.ENGLISH)) { case "t", "true", "on", "y", "yes", "1", "allow" -> true; case "f", "false", "off", "n", "no", "0", "deny" -> false; - default -> throw new MultiverseException("Unable to convert '" + input + "' to boolean. Please use 'true' or 'false'"); + default -> throw new MultiverseException(Message.of(MVCorei18n.CONFIG_STRING_PARSER_INVALIDBOOLEAN, + replace("{input}").with(input))); }); private static final NodeStringParser INTEGER_STRING_PARSER = (input, type) -> Try.of( () -> ACFUtil.parseInt(input)) - .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException("Unable to convert '" + input + "' to number. (integer)"))); + .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException(Message.of( + MVCorei18n.CONFIG_STRING_PARSER_INVALIDINTEGER, + replace("{input}").with(input))))); private static final NodeStringParser DOUBLE_STRING_PARSER = (input, type) -> Try.of( () -> ACFUtil.parseDouble(input)) - .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException("Unable to convert '" + input + "' to number. (double)"))); + .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException(Message.of( + MVCorei18n.CONFIG_STRING_PARSER_INVALIDDOUBLE, + replace("{input}").with(input))))); private static final NodeStringParser FLOAT_STRING_PARSER = (input, type) -> Try.of( () -> ACFUtil.parseFloat(input)) - .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException("Unable to convert '" + input + "' to number. (float)"))); + .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException(Message.of( + MVCorei18n.CONFIG_STRING_PARSER_INVALIDFLOAT, + replace("{input}").with(input))))); private static final NodeStringParser LONG_STRING_PARSER = (input, type) -> Try.of( () -> ACFUtil.parseLong(input)) - .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException("Unable to convert '" + input + "' to number. (long)"))); + .flatMap(number -> Option.of(number).toTry(() -> new MultiverseException(Message.of( + MVCorei18n.CONFIG_STRING_PARSER_INVALIDLONG, + replace("{input}").with(input))))); static { addDefaultStringParser(String.class, STRING_STRING_PARSER); diff --git a/src/main/java/org/mvplugins/multiverse/core/destination/core/AnchorDestinationInstance.java b/src/main/java/org/mvplugins/multiverse/core/destination/core/AnchorDestinationInstance.java index 806f2020c..704c16287 100644 --- a/src/main/java/org/mvplugins/multiverse/core/destination/core/AnchorDestinationInstance.java +++ b/src/main/java/org/mvplugins/multiverse/core/destination/core/AnchorDestinationInstance.java @@ -7,8 +7,11 @@ import org.jetbrains.annotations.NotNull; import org.mvplugins.multiverse.core.destination.DestinationInstance; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.locale.message.Message; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + /** * Destination instance implementation for the {@link AnchorDestination}. */ @@ -69,8 +72,7 @@ public boolean checkTeleportSafety() { */ @Override public @NotNull Message getDisplayMessage() { - //TODO Localize - return Message.of("anchor '" + anchorName + "'"); + return Message.of(MVCorei18n.DESTINATION_ANCHOR_DISPLAY, replace("{anchor}").with(anchorName)); } /** diff --git a/src/main/java/org/mvplugins/multiverse/core/destination/core/BedDestinationInstance.java b/src/main/java/org/mvplugins/multiverse/core/destination/core/BedDestinationInstance.java index 5144c9245..c507bcd49 100644 --- a/src/main/java/org/mvplugins/multiverse/core/destination/core/BedDestinationInstance.java +++ b/src/main/java/org/mvplugins/multiverse/core/destination/core/BedDestinationInstance.java @@ -9,7 +9,9 @@ import org.jetbrains.annotations.Nullable; import org.mvplugins.multiverse.core.destination.DestinationInstance; +import org.mvplugins.multiverse.core.locale.MVCorei18n; import org.mvplugins.multiverse.core.locale.message.Message; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement.Replace; /** * Destination instance implementation for the {@link BedDestination}. @@ -70,8 +72,9 @@ public boolean checkTeleportSafety() { */ @Override public @NotNull Message getDisplayMessage() { - //TODO Localize - return Message.of(player == null ? "your bed/respawn point" : player.getName() + "'s bed/respawn point"); + return player == null + ? Message.of(MVCorei18n.DESTINATION_BED_DISPLAY_OWN) + : Message.of(MVCorei18n.DESTINATION_BED_DISPLAY_OTHER, Replace.PLAYER.with(player.getName())); } /** diff --git a/src/main/java/org/mvplugins/multiverse/core/display/handlers/PagedSendHandler.java b/src/main/java/org/mvplugins/multiverse/core/display/handlers/PagedSendHandler.java index 545d010be..f03982c1e 100644 --- a/src/main/java/org/mvplugins/multiverse/core/display/handlers/PagedSendHandler.java +++ b/src/main/java/org/mvplugins/multiverse/core/display/handlers/PagedSendHandler.java @@ -2,8 +2,6 @@ import java.util.List; -import co.aikar.commands.BukkitCommandIssuer; -import org.bukkit.ChatColor; import org.bukkit.command.ConsoleCommandSender; import org.jetbrains.annotations.NotNull; import org.mvplugins.multiverse.core.command.MVCommandIssuer; @@ -69,12 +67,12 @@ private void sendNormal(@NotNull MVCommandIssuer issuer, @NotNull List c private void sendPaged(@NotNull MVCommandIssuer issuer, @NotNull List content) { int totalPages = (content.size() + linesPerPage - 1) / linesPerPage; // Basically just divide round up if (targetPage < 1 || targetPage > totalPages) { - issuer.sendMessage(String.format("%sInvalid page number. Please enter a page number between 1 and %s", ChatColor.RED, totalPages)); + issuer.sendMessage(MVCorei18n.CONTENTDISPLAY_INVALIDPAGE, replace("{total}").with(totalPages)); return; } if (filter.needToFilter()) { - issuer.sendMessage("{page} {filter}", + issuer.sendMessage(MVCorei18n.CONTENTDISPLAY_PAGEFILTER, replace("{page}").with(Message.of(MVCorei18n.CONTENTDISPLAY_PAGE, replace("{current}").with(targetPage), replace("{total}").with(totalPages))), diff --git a/src/main/java/org/mvplugins/multiverse/core/locale/MVCorei18n.java b/src/main/java/org/mvplugins/multiverse/core/locale/MVCorei18n.java index 21ce4e56e..dee0575db 100644 --- a/src/main/java/org/mvplugins/multiverse/core/locale/MVCorei18n.java +++ b/src/main/java/org/mvplugins/multiverse/core/locale/MVCorei18n.java @@ -20,6 +20,25 @@ public enum MVCorei18n implements MessageKeyProvider { // configuration CONFIG_SAVE_FAILED, CONFIG_NODE_NOTFOUND, + CONFIG_NODE_INVALIDYAMLKEY, + CONFIG_STRING_PARSER_INVALIDBOOLEAN, + CONFIG_STRING_PARSER_INVALIDINTEGER, + CONFIG_STRING_PARSER_INVALIDDOUBLE, + CONFIG_STRING_PARSER_INVALIDFLOAT, + CONFIG_STRING_PARSER_INVALIDLONG, + + // core config + CORE_CONFIG_CUSTOMPORTALSEARCHRADIUS_NONNEGATIVE, + CORE_CONFIG_CONFIRMTIMEOUT_POSITIVE, + CORE_CONFIG_DEBUGLEVEL_RANGE, + + // /mv anchor + ANCHOR_DELETE_SUCCESS, + ANCHOR_DELETE_FAILURE, + ANCHOR_LIST_HEADER, + ANCHOR_LIST_ENTRY, + ANCHOR_SET_SUCCESS, + ANCHOR_SET_FAILURE, // /mv check CHECK_DESCRIPTION, @@ -94,6 +113,15 @@ public enum MVCorei18n implements MessageKeyProvider { DUMPS_STARTING, DUMPS_URL_LIST, + // /mv entity-spawn-config + ENTITYSPAWNCONFIG_INFO_HEADER, + ENTITYSPAWNCONFIG_INFO_CATEGORY, + ENTITYSPAWNCONFIG_INFO_SPAWN, + ENTITYSPAWNCONFIG_INFO_TICKRATE, + ENTITYSPAWNCONFIG_INFO_EXCEPTIONS, + ENTITYSPAWNCONFIG_MODIFY_SUCCESS, + ENTITYSPAWNCONFIG_MODIFY_FAILURE, + // /mv gamerule set GAMERULE_SET_DESCRIPTION, GAMERULE_SET_GAMERULE_DESCRIPTION, @@ -120,7 +148,12 @@ public enum MVCorei18n implements MessageKeyProvider { // /mv generators GENERATORS_DESCRIPTION, GENERATORS_DESCRIPTION_FLAGS, + GENERATORS_HEADER, GENERATORS_EMPTY, + GENERATORS_INFO_PLUGIN, + GENERATORS_INFO_EXAMPLEUSAGES, + GENERATORS_INFO_USAGES, + GENERATORS_INFO_INFOLINK, // /mv import IMPORT_DESCRIPTION, @@ -172,6 +205,13 @@ public enum MVCorei18n implements MessageKeyProvider { MODIFY_FAILURE, MODIFY_FAILURE_NOVALUE, + // /mv purge-all-entities + PURGEALLENTITIES_SUCCESS, + PURGEALLENTITIES_SUCCESS_CATEGORIES, + + // /mv purge-entities + PURGEENTITIES_SUCCESS, + // /mv regen REGEN_DESCRIPTION, REGEN_WORLD_DESCRIPTION, @@ -206,6 +246,8 @@ public enum MVCorei18n implements MessageKeyProvider { // /mv spawn SPAWN_DESCRIPTION, SPAWN_PLAYER_DESCRIPTION, + SPAWN_NOTMVWORLD, + SPAWN_NOPERMISSION, SPAWN_SUCCESS, SPAWN_FAILED, @@ -214,6 +256,9 @@ public enum MVCorei18n implements MessageKeyProvider { TELEPORT_PLAYER_DESCRIPTION, TELEPORT_DESTINATION_DESCRIPTION, TELEPORT_TOOMANYPLAYERS, + TELEPORT_NOPERMISSION_SELF, + TELEPORT_NOPERMISSION_OTHER, + TELEPORT_NOPERMISSION_ALL, TELEPORT_SUCCESS, TELEPORT_FAILED, @@ -269,6 +314,21 @@ public enum MVCorei18n implements MessageKeyProvider { // commands error COMMANDS_ERROR_PLAYERSONLY, COMMANDS_ERROR_MULTIVERSEWORLDONLY, + COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_PLAYERSONLY, + COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_ISSUER, + COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_INPUTCONSOLE, + COMMANDS_ERROR_LOADEDMULTIVERSEWORLD_INPUT, + COMMANDS_ERROR_MULTIVERSEWORLD_PLAYERSONLY, + COMMANDS_ERROR_MULTIVERSEWORLD_ISSUER, + COMMANDS_ERROR_MULTIVERSEWORLD_INPUTCONSOLE, + COMMANDS_ERROR_MULTIVERSEWORLD_INPUT, + COMMANDS_ERROR_PLAYER_ISSUERINPUT, + COMMANDS_ERROR_PLAYER_INPUT, + COMMANDS_ERROR_PLAYER_SELECTOR, + COMMANDS_ERROR_PLAYERS_INPUT, + COMMANDS_ERROR_RESOLVE_PLAYER, + COMMANDS_ERROR_RESOLVE_INPUT, + COMMANDS_ERROR_REMOVEPLAYERS_NODEFAULT, // entry check ENTRYCHECK_BLACKLISTED, @@ -285,7 +345,10 @@ public enum MVCorei18n implements MessageKeyProvider { // multiverse parse destination failure reason DESTINATION_ANCHOR_FAILUREREASON_ANCHORNOTFOUND, + DESTINATION_ANCHOR_DISPLAY, DESTINATION_BED_FAILUREREASON_PLAYERNOTFOUND, + DESTINATION_BED_DISPLAY_OWN, + DESTINATION_BED_DISPLAY_OTHER, DESTINATION_CANNON_FAILUREREASON_INVALIDFORMAT, DESTINATION_EXACT_FAILUREREASON_INVALIDFORMAT, DESTINATION_PLAYER_FAILUREREASON_PLAYERNOTFOUND, @@ -351,6 +414,9 @@ public enum MVCorei18n implements MessageKeyProvider { WORLDCREATOR_BUKKITCREATIONFAILED, // queue command result + QUEUECOMMAND_DEFAULTPROMPT, + QUEUECOMMAND_PROMPT, + QUEUECOMMAND_EXPIRED, QUEUECOMMAND_NOCOMMANDINQUEUE, QUEUECOMMAND_INVALIDOTP, QUEUECOMMAND_COMMANDEXECUTIONERROR, @@ -359,6 +425,7 @@ public enum MVCorei18n implements MessageKeyProvider { CONTENTDISPLAY_NOCONTENT, CONTENTDISPLAY_FILTER, CONTENTDISPLAY_PAGE, + CONTENTDISPLAY_PAGEFILTER, CONTENTDISPLAY_INVALIDPAGE, CONTENTDISPLAY_NULL, CONTENTDISPLAY_EMPTY, @@ -384,8 +451,11 @@ public enum MVCorei18n implements MessageKeyProvider { GENERIC_SUCCESS, GENERIC_FAILURE, GENERIC_ERROR, + GENERIC_ERROR_DETAILS, GENERIC_NULL, GENERIC_YOU, + GENERIC_PLAYERCOUNT, + GENERIC_TELEPORTPLAYERS_FAILED, ; // END CHECKSTYLE-SUPPRESSION: Javadoc diff --git a/src/main/java/org/mvplugins/multiverse/core/world/WorldManager.java b/src/main/java/org/mvplugins/multiverse/core/world/WorldManager.java index 7f3101b91..0c61f1a8f 100644 --- a/src/main/java/org/mvplugins/multiverse/core/world/WorldManager.java +++ b/src/main/java/org/mvplugins/multiverse/core/world/WorldManager.java @@ -186,7 +186,7 @@ private void loadNewWorldConfigs(Collection newWorldConfigs) { private void removeWorldsNotInConfigs(Collection removedWorlds) { removedWorlds.forEach(keyOrName -> getWorld(keyOrName.usableName()) .map(world -> removeWorld(RemoveWorldOptions.world(world))) - .getOrElse(() -> worldActionResult(RemoveFailureReason.WORLD_NON_EXISTENT, keyOrName.toString())) + .getOrElse(() -> worldActionResult(RemoveFailureReason.WORLD_NON_EXISTENT, keyOrName)) .onFailure(failure -> Logging.severe("Failed to unload world %s: %s", keyOrName, failure)) .onSuccess(success -> diff --git a/src/main/resources/multiverse-core_en.properties b/src/main/resources/multiverse-core_en.properties index 9341ec86d..2a8b1f454 100644 --- a/src/main/resources/multiverse-core_en.properties +++ b/src/main/resources/multiverse-core_en.properties @@ -1,6 +1,25 @@ # configuration mv-core.config.save.failed=Unable to save Multiverse-Core config.yml. Your changes will be temporary! mv-core.config.node.notfound=Node not found in config: {node} +mv-core.config.node.invalidyamlkey=Invalid yaml key: '{key}'. Keys can only contain alphanumeric characters, underscores and hyphens. +mv-core.config.string.parser.invalidboolean=Unable to convert '{input}' to boolean. Please use 'true' or 'false' +mv-core.config.string.parser.invalidinteger=Unable to convert '{input}' to number. (integer) +mv-core.config.string.parser.invaliddouble=Unable to convert '{input}' to number. (double) +mv-core.config.string.parser.invalidfloat=Unable to convert '{input}' to number. (float) +mv-core.config.string.parser.invalidlong=Unable to convert '{input}' to number. (long) + +# core config +mv-core.core.config.customportalsearchradius.nonnegative=The value must be greater than or equal to 0. +mv-core.core.config.confirmtimeout.positive=Confirm timeout must be a positive number! +mv-core.core.config.debuglevel.range=Debug level must be between 0 and 3. + +# /mv anchor +mv-core.anchor.delete.success=&aAnchor &f{anchor}&a deleted. +mv-core.anchor.delete.failure=&cFailed to delete anchor. +mv-core.anchor.list.header=&3==== [ Multiverse Anchors ] ==== +mv-core.anchor.list.entry=&a{anchor}&7 - &f{location} +mv-core.anchor.set.success=&aAnchor &f{anchor}&a set to &f{location} +mv-core.anchor.set.failure=&cFailed to set anchor &f{anchor}. # /mv check mv-core.check.description=Checks if a player can teleport themselves to a destination. @@ -75,6 +94,15 @@ mv-core.dumps.description=Dumps version info to the console or paste services mv-core.dumps.starting=Gathering logs and debug info... mv-core.dumps.url.list=&aUploaded with {service} backend: &6{link} +# /mv entity-spawn-config +mv-core.entityspawnconfig.info.header===== [ Entity Spawn Config '{world}' ] ==== +mv-core.entityspawnconfig.info.category={category}:\u0020 +mv-core.entityspawnconfig.info.spawn=\ \ spawn: {spawn} +mv-core.entityspawnconfig.info.tickrate=\ \ tick-rate: {tickRate} +mv-core.entityspawnconfig.info.exceptions=\ \ exceptions: {exceptions} +mv-core.entityspawnconfig.modify.success=Successfully set {property} to {value} for {category} in {world} +mv-core.entityspawnconfig.modify.failure=Unable to set {property} to {value} for {category} in {world}: {error} + # /mv gamerule set mv-core.gamerule.set.description=Changes a gamerule in one or more worlds. mv-core.gamerule.set.gamerule.description=Gamerule to set. @@ -101,7 +129,12 @@ mv-core.gamerule.list.title= --- Gamerules for {world} --- # /mv generators mv-core.generators.description=Lists generators known to Multiverse mv-core.generators.description.flags=Filter - only shows entries matching this. Page - the page to show +mv-core.generators.header=&b====[ Multiverse Generator List ]==== mv-core.generators.empty=&cNo Generator Plugins found. +mv-core.generators.info.plugin=&rGenerator Plugin: {plugin} +mv-core.generators.info.exampleusages=&rExample usages:\u0020 +mv-core.generators.info.usages=&r{usages} +mv-core.generators.info.infolink=&rLink to more info: {link} # /mv import mv-core.import.description=Imports an existing world folder. @@ -158,6 +191,13 @@ mv-core.modify.success=&aSuccessfully {action} '&9{property}&a' to '&9{value}&a' mv-core.modify.failure=&cFailed to {action} '&9{property}&c' to '&9{value}&c' in world &9{world}&c.\n&c{error} mv-core.modify.failure.novalue=&cFailed to {action} '&9{property}&c' in world &9{world}&c.\n&c{error} +# /mv purge-all-entities +mv-core.purgeallentities.success=Successfully purged {count} entities in world {world}. +mv-core.purgeallentities.success.categories=Successfully purged {count} entities in world {world} for spawn categories {categories}. + +# /mv purge-entities +mv-core.purgeentities.success=Successfully purged {count} entities in world {world}. + # /mv regen mv-core.regen.description=Regenerates a world on your server. The previous state will be lost PERMANENTLY. mv-core.regen.world.description=World that you want to regen. @@ -192,6 +232,8 @@ mv-core.setspawn.notmvworld=&cUnable to set spawn for &c{world} as it is not a M # /mv spawn mv-core.spawn.description=Teleports the specified player to the spawn of the world they are in mv-core.spawn.player.description=The player +mv-core.spawn.notmvworld=&cThe world '{world}' is not a multiverse world! +mv-core.spawn.nopermission=&cYou do not have permission to use this command in this world! mv-core.spawn.success=Teleported {player} to '{world}' spawn! mv-core.spawn.failed=Failed to teleport {player} to '{world}' spawn. {reason} @@ -200,6 +242,9 @@ mv-core.teleport.description=Allows you to teleport to a location on your server mv-core.teleport.player.description=Target player to teleport. mv-core.teleport.destination.description=Location, can be a world name. mv-core.teleport.toomanyplayers=&cYou cannot teleport more than {count} players at once. +mv-core.teleport.nopermission.self=&cYou do not have permission to teleport yourself! +mv-core.teleport.nopermission.other=&cYou do not have permission to teleport other players! +mv-core.teleport.nopermission.all=&cYou do not have permission to teleport all these players! mv-core.teleport.success=Teleported {player} to {destination}. mv-core.teleport.failed=Failed to teleport {player} to {destination}. {reason} @@ -255,6 +300,21 @@ mv-core.worldborder.roundoff.warning=&cYour server version does not support sett # commands error mv-core.commands.error.playersonly=&cThis command can only be used by players mv-core.commands.error.multiverseworldonly=&cThis can only be used in multiverse worlds +mv-core.commands.error.loadedmultiverseworld.playersonly=This command can only be used by a player in a loaded Multiverse World. +mv-core.commands.error.loadedmultiverseworld.issuer=You are not in a loaded multiverse world. Either specify a multiverse world name or use this command in a loaded multiverse world. +mv-core.commands.error.loadedmultiverseworld.inputconsole=World '{world}' is not a loaded multiverse world. Remember to specify the world name when using this command in console. +mv-core.commands.error.loadedmultiverseworld.input=World {world} is not a loaded multiverse world. +mv-core.commands.error.multiverseworld.playersonly=This command can only be used by a player in a Multiverse World. +mv-core.commands.error.multiverseworld.issuer=You are not in a multiverse world. Either specify a multiverse world name or use this command in a multiverse world. +mv-core.commands.error.multiverseworld.inputconsole=World '{world}' is not a multiverse world. Remember to specify the world name when using this command in console. +mv-core.commands.error.multiverseworld.input=World {world} is not a multiverse world. +mv-core.commands.error.player.issuerinput=Invalid player: {player}. Either specify an online player or use this command as a player. +mv-core.commands.error.player.input=Player {player} not found. +mv-core.commands.error.player.selector=No player(s) matched selector: {player}. +mv-core.commands.error.players.input=Player(s) {player} not found. +mv-core.commands.error.resolve.player=Unable to resolve context for player '{player}'. +mv-core.commands.error.resolve.input=Unable to resolve context for input '{input}'. +mv-core.commands.error.removeplayers.nodefault=No default world found, so the --remove-players flag requires a destination argument. # entry check mv-core.entrycheck.blacklisted=The world '{world}' is blacklisted. @@ -271,7 +331,10 @@ mv-core.economy.vault.withdraw=&fYou have been charged &2{price}. # multiverse parse destination failure reason mv-core.destination.anchor.failurereason.anchornotfound=&cAnchor '&6{anchor}&c' does not exist! +mv-core.destination.anchor.display=anchor '{anchor}' mv-core.destination.bed.failurereason.playernotfound=&cPlayer '&6{player}&c' does not exist or is not online! To teleport to own's bed, use 'playerbed'. +mv-core.destination.bed.display.own=your bed/respawn point +mv-core.destination.bed.display.other={player}'s bed/respawn point mv-core.destination.cannon.failurereason.invalidformat=&cCannon destination format is: &6ca:worldname:x,y,z:pitch:yaw:speed mv-core.destination.exact.failurereason.invalidformat=&cExact destination format is: &6e:worldname:x,y,z:pitch:yaw mv-core.destination.player.failurereason.playernotfound=&cPlayer '&6{player}&c' does not exist or is not online! @@ -337,6 +400,9 @@ mv-core.worldcreator.invalidchunkgenerator=&cInvalid chunk generator '&6{generat mv-core.worldcreator.bukkitcreationfailed=&cBukkit failed to create world '{world}': {error}\n&cSee console for more details. # queue command result +mv-core.queuecommand.defaultprompt=The command you are trying to run is deemed dangerous. +mv-core.queuecommand.prompt=Run &a{command} &fto continue. This will expire in {timeout} seconds. +mv-core.queuecommand.expired=Your queued command has expired. mv-core.queuecommand.nocommandinqueue=&cYou do not have any commands in queue. mv-core.queuecommand.invalidotp=&cInvalid OTP number '&6{otp}&c'. Please try again... mv-core.queuecommand.commandexecutionerror=&cError executing queued command: {error}\n&fSee console for more details. @@ -345,6 +411,7 @@ mv-core.queuecommand.commandexecutionerror=&cError executing queued command: {er mv-core.contentdisplay.nocontent=&cThere is no content to display. mv-core.contentdisplay.filter=&7[Filter '{filter}'] mv-core.contentdisplay.page=&7[Page {current} of {total}] +mv-core.contentdisplay.pagefilter={page} {filter} mv-core.contentdisplay.invalidpage=&cInvalid page number. Please enter a page number between &31&c and &3{total}&c. mv-core.contentdisplay.empty=&7&oempty mv-core.contentdisplay.null=&7&onull @@ -370,5 +437,8 @@ mv-core.worldkeyparse.namespacedkeyunsupported=&cYour server software does not s mv-core.generic.success=Success! mv-core.generic.failure=Failed! mv-core.generic.error=Error! +mv-core.generic.error.details=Error: {error} mv-core.generic.null=Null! mv-core.generic.you=you +mv-core.generic.playercount={count} players +mv-core.generic.teleportplayers.failed=Failed to teleport one or more players out of the world! diff --git a/src/main/resources/multiverse-core_es.properties b/src/main/resources/multiverse-core_es.properties index 8764440af..df8be2fa5 100644 --- a/src/main/resources/multiverse-core_es.properties +++ b/src/main/resources/multiverse-core_es.properties @@ -1,6 +1,25 @@ # configuration mv-core.config.save.failed=No se han podido guardar los cambios que se han hecho al archivo config.yml de Multiverse-Core. ¡Estos camios serán temporales! mv-core.config.node.notfound=Nodo no encontrado en la configuración: {node} +mv-core.config.node.invalidyamlkey=Clave yaml inválida: '{key}'. Las claves solo pueden contener caracteres alfanuméricos, guiones bajos y guiones. +mv-core.config.string.parser.invalidboolean=No se ha podido convertir '{input}' a booleano. Usa 'true' o 'false' +mv-core.config.string.parser.invalidinteger=No se ha podido convertir '{input}' a número. (entero) +mv-core.config.string.parser.invaliddouble=No se ha podido convertir '{input}' a número. (double) +mv-core.config.string.parser.invalidfloat=No se ha podido convertir '{input}' a número. (float) +mv-core.config.string.parser.invalidlong=No se ha podido convertir '{input}' a número. (long) + +# core config +mv-core.core.config.customportalsearchradius.nonnegative=El valor debe ser mayor o igual a 0. +mv-core.core.config.confirmtimeout.positive=¡El tiempo de espera de confirmación debe ser un número positivo! +mv-core.core.config.debuglevel.range=El nivel de depuración debe estar entre 0 y 3. + +# /mv anchor +mv-core.anchor.delete.success=&aAnclaje &f{anchor}&a eliminado. +mv-core.anchor.delete.failure=&cNo se ha podido eliminar el anclaje. +mv-core.anchor.list.header=&3==== [ Anclajes de Multiverse ] ==== +mv-core.anchor.list.entry=&a{anchor}&7 - &f{location} +mv-core.anchor.set.success=&aAnclaje &f{anchor}&a establecido en &f{location} +mv-core.anchor.set.failure=&cNo se ha podido establecer el anclaje &f{anchor}. # /mv check mv-core.check.description=Comprueba si un jugador puede teletransportarse a algún sitio. @@ -74,6 +93,15 @@ mv-core.delete.success=&a¡Se ha eliminado el mundo '{world}'! mv-core.dumps.description=Vuelca la información de la versión a la consola o a servicios de copiado y pegado («paste services» en inglés). mv-core.dumps.url.list={service} : {link} +# /mv entity-spawn-config +mv-core.entityspawnconfig.info.header===== [ Configuración de aparición de entidades '{world}' ] ==== +mv-core.entityspawnconfig.info.category={category}:\u0020 +mv-core.entityspawnconfig.info.spawn=\ \ spawn: {spawn} +mv-core.entityspawnconfig.info.tickrate=\ \ tick-rate: {tickRate} +mv-core.entityspawnconfig.info.exceptions=\ \ excepciones: {exceptions} +mv-core.entityspawnconfig.modify.success=Se ha establecido {property} a {value} para {category} en {world} +mv-core.entityspawnconfig.modify.failure=No se ha podido establecer {property} a {value} para {category} en {world}: {error} + # /mv gamerule set mv-core.gamerule.set.description=Cambia una «regla de juego» (gamerule) en uno o más mundos. mv-core.gamerule.set.gamerule.description=Gamerule que se desea cambiar. @@ -100,7 +128,12 @@ mv-core.gamerule.list.title= --- Valor de las gamerules de {world} --- # /mv generators mv-core.generators.description=Muestra los generadores conocidos por Multiverse mv-core.generators.description.flags=Filtro - solo muestra las entradas que coincidan. Página - la página a mostrar. +mv-core.generators.header=&b====[ Lista de generadores de Multiverse ]==== mv-core.generators.empty=&cNo se ha encontrado ningún Plugin de Generación. +mv-core.generators.info.plugin=&rPlugin generador: {plugin} +mv-core.generators.info.exampleusages=&rUsos de ejemplo:\u0020 +mv-core.generators.info.usages=&r{usages} +mv-core.generators.info.infolink=&rEnlace para más información: {link} # /mv import mv-core.import.description=Importa la carpeta de un mundo ya existente. @@ -138,6 +171,13 @@ mv-core.modify.success=&aSe ha {action} '&9{property}&a' a '&9{value}&a' en el m mv-core.modify.failure=&cNo se ha podido {action} '&9{property}&c' a '&9{value}&c' en el mundo &9{world}&c.\n&c{error} mv-core.modify.failure.novalue=&cNo se ha podido {action} '&9{property}&c' en el mundo &9{world}&c.\n&c{error} +# /mv purge-all-entities +mv-core.purgeallentities.success=Se han purgado correctamente {count} entidades en el mundo {world}. +mv-core.purgeallentities.success.categories=Se han purgado correctamente {count} entidades en el mundo {world} para las categorías de aparición {categories}. + +# /mv purge-entities +mv-core.purgeentities.success=Se han purgado correctamente {count} entidades en el mundo {world}. + # /mv regen mv-core.regen.description=Regenera un mundo en tu servidor. El estado previo se perderá PERMANENTEMENTE. mv-core.regen.world.description=Mundo que quieres regenerar. @@ -172,6 +212,8 @@ mv-core.setspawn.notmvworld=&cNo se ha podido establecer el punto de aparición # /mv spawn mv-core.spawn.description=Teletransporta el jugador especificado al punto de aparición del mundo en el que están. mv-core.spawn.player.description=El jugador +mv-core.spawn.notmvworld=&c¡El mundo '{world}' no es un mundo Multiverse! +mv-core.spawn.nopermission=&c¡No tienes permiso para usar este comando en este mundo! mv-core.spawn.success=¡Se ha teletransportado a {player} al punto de aparición de '{world}'! mv-core.spawn.failed=No se ha podido teletransportar a {player} al punto de aparición de '{world}'. {reason} @@ -180,6 +222,9 @@ mv-core.teleport.description=¡Te permite teletransportarte a un lugar en concre mv-core.teleport.player.description=Jugador sobre el que se va a ejecutar la teletransportación. mv-core.teleport.destination.description=Localización, puede ser el nombre de un mundo. mv-core.teleport.toomanyplayers=&cNo puedes teletransportar más de {count} jugador al mismo tiempo. +mv-core.teleport.nopermission.self=&c¡No tienes permiso para teletransportarte! +mv-core.teleport.nopermission.other=&c¡No tienes permiso para teletransportar a otros jugadores! +mv-core.teleport.nopermission.all=&c¡No tienes permiso para teletransportar a todos estos jugadores! mv-core.teleport.success=Se ha teletransportado a {player} a {destination}. mv-core.teleport.failed=No se ha podido teletransportar a {player} a {destination}. {reason} @@ -233,6 +278,21 @@ mv-core.worldborder.warningtime.success=&rSe ha establecido el tiempo de duraci # commands error mv-core.commands.error.playersonly=&cEste comando solo puede ser usado por jugadores. mv-core.commands.error.multiverseworldonly=&cEsto solo puede ser usado en mundos Multiverse. +mv-core.commands.error.loadedmultiverseworld.playersonly=Este comando solo puede ser usado por un jugador en un mundo Multiverse cargado. +mv-core.commands.error.loadedmultiverseworld.issuer=No estás en un mundo Multiverse cargado. Especifica el nombre de un mundo Multiverse o usa este comando en un mundo Multiverse cargado. +mv-core.commands.error.loadedmultiverseworld.inputconsole=El mundo '{world}' no es un mundo Multiverse cargado. Recuerda especificar el nombre del mundo al usar este comando desde la consola. +mv-core.commands.error.loadedmultiverseworld.input=El mundo {world} no es un mundo Multiverse cargado. +mv-core.commands.error.multiverseworld.playersonly=Este comando solo puede ser usado por un jugador en un mundo Multiverse. +mv-core.commands.error.multiverseworld.issuer=No estás en un mundo Multiverse. Especifica el nombre de un mundo Multiverse o usa este comando en un mundo Multiverse. +mv-core.commands.error.multiverseworld.inputconsole=El mundo '{world}' no es un mundo Multiverse. Recuerda especificar el nombre del mundo al usar este comando desde la consola. +mv-core.commands.error.multiverseworld.input=El mundo {world} no es un mundo Multiverse. +mv-core.commands.error.player.issuerinput=Jugador inválido: {player}. Especifica un jugador en línea o usa este comando como jugador. +mv-core.commands.error.player.input=Jugador {player} no encontrado. +mv-core.commands.error.player.selector=Ningún jugador coincide con el selector: {player}. +mv-core.commands.error.players.input=Jugador(es) {player} no encontrados. +mv-core.commands.error.resolve.player=No se ha podido resolver el contexto para el jugador '{player}'. +mv-core.commands.error.resolve.input=No se ha podido resolver el contexto para la entrada '{input}'. +mv-core.commands.error.removeplayers.nodefault=No se ha encontrado un mundo predeterminado, por lo que el ajuste --remove-players requiere un argumento de destino. # entry check mv-core.entrycheck.blacklisted=El mundo '{world}' está en la lista negra («blacklist» en inglés). @@ -249,7 +309,10 @@ mv-core.economy.vault.withdraw=&fSe te ha cobrado &2{price}. # multiverse parse destination failure reason mv-core.destination.anchor.failurereason.anchornotfound=&c¡El anclaje '&6{anchor}&c' no existe! +mv-core.destination.anchor.display=anclaje '{anchor}' mv-core.destination.bed.failurereason.playernotfound=&c¡El jugador '&6{player}&c' no existe o no está en línea! Para teletransportarte a su cama, usa 'playerbed'. +mv-core.destination.bed.display.own=tu cama/punto de reaparición +mv-core.destination.bed.display.other=cama/punto de reaparición de {player} mv-core.destination.cannon.failurereason.invalidformat=&cEl formato canon del destino es: &6ca:nombredelmundo:x,y,z:inclinación:aceleración:velocidad mv-core.destination.exact.failurereason.invalidformat=&cEl formato de destino exacto es: &6e:nombredelmundo:x,y,z:inclinación:aceleración mv-core.destination.player.failurereason.playernotfound=&c¡El jugador '&6{player}&c' no existe o no está en línea! @@ -306,6 +369,9 @@ mv-core.worldcreator.invalidchunkgenerator=&c¡Generador de chunks inválido '&6 mv-core.worldcreator.bukkitcreationfailed=&cBukkit ha fallado al crear el mundo '{world}': {error}\n&cSMira la consola para ver los detalles. # queue command result +mv-core.queuecommand.defaultprompt=El comando que intentas ejecutar se considera peligroso. +mv-core.queuecommand.prompt=Ejecuta &a{command} &fpara continuar. Esto expirará en {timeout} segundos. +mv-core.queuecommand.expired=Tu comando en cola ha expirado. mv-core.queuecommand.nocommandinqueue=&cNo tienes ningún comando en la cola. mv-core.queuecommand.invalidotp=&cNúmero OTP inválido '&6{otp}&c'. Por favor, inténtalo de nuevo... mv-core.queuecommand.commandexecutionerror=&cError ejecutando el comando en la cola: {error}\n&fMira la consola para ver los detalles. @@ -314,6 +380,7 @@ mv-core.queuecommand.commandexecutionerror=&cError ejecutando el comando en la c mv-core.contentdisplay.nocontent=&cNo hay ningún contenido para mostrar. mv-core.contentdisplay.filter=&7[Filtro '{filter}'] mv-core.contentdisplay.page=&7[Página {current} de {total}] +mv-core.contentdisplay.pagefilter={page} {filter} mv-core.contentdisplay.invalidpage=&cNúmero de página inválido. Por favor, introduce el número de una página que esté entre &31&c y &3{total}&c. mv-core.contentdisplay.empty=&7&ovacío mv-core.contentdisplay.null=&7&onull @@ -324,9 +391,17 @@ mv-core.exception.multiverseworld.unloaddefaultworld=&c¡No puedes descargar (en mv-core.exception.multiverseworld.unloadplayersinworld=&c¡Aún hay &6{count}&c jugador(es) en el mundo! Usa el ajuste («flag») '&6--remove-players&c' al ejecutar el comando para teletransportar a todos los jugadores fuera del mundo. mv-core.exception.multiverseworld.unloaderror=&cUn error desconocido ha ocurrido cuando se estaba descargando el mundo: &6{world}&c.\n&cMira la consola para ver los detalles. +# multiverse position parse exception +mv-core.exception.positionparse.invaliddirection=&cFormato de dirección inválido: {format}. Formato esperado: : +mv-core.exception.positionparse.invalidcoordinates=&cFormato de coordenadas inválido: {format}. Formato esperado: ,, +mv-core.exception.positionparse.invalidnumber=&cFormato de número inválido: {number}. Se espera un valor numérico. + # generic mv-core.generic.success=¡Correctamente! mv-core.generic.failure=¡Fallido! mv-core.generic.error=¡Error! +mv-core.generic.error.details=Error: {error} mv-core.generic.null=¡Null! mv-core.generic.you=tú +mv-core.generic.playercount={count} jugadores +mv-core.generic.teleportplayers.failed=¡No se ha podido teletransportar a uno o más jugadores fuera del mundo! diff --git a/src/main/resources/multiverse-core_ru.properties b/src/main/resources/multiverse-core_ru.properties index 8fe80f385..1d63e66dc 100644 --- a/src/main/resources/multiverse-core_ru.properties +++ b/src/main/resources/multiverse-core_ru.properties @@ -1,6 +1,25 @@ # configuration mv-core.config.save.failed=Не удалось сохранить файл config.yml Multiverse-Core. Ваши изменения будут временными! mv-core.config.node.notfound=Узел не найден в конфигурации: {node} +mv-core.config.node.invalidyamlkey=Недопустимый ключ yaml: '{key}'. Ключи могут содержать только буквы, цифры, подчеркивания и дефисы. +mv-core.config.string.parser.invalidboolean=Не удалось преобразовать '{input}' в логическое значение. Используйте 'true' или 'false' +mv-core.config.string.parser.invalidinteger=Не удалось преобразовать '{input}' в число. (целое число) +mv-core.config.string.parser.invaliddouble=Не удалось преобразовать '{input}' в число. (double) +mv-core.config.string.parser.invalidfloat=Не удалось преобразовать '{input}' в число. (float) +mv-core.config.string.parser.invalidlong=Не удалось преобразовать '{input}' в число. (long) + +# core config +mv-core.core.config.customportalsearchradius.nonnegative=Значение должно быть больше или равно 0. +mv-core.core.config.confirmtimeout.positive=Время подтверждения должно быть положительным числом! +mv-core.core.config.debuglevel.range=Уровень отладки должен быть от 0 до 3. + +# /mv anchor +mv-core.anchor.delete.success=&aЯкорь &f{anchor}&a удален. +mv-core.anchor.delete.failure=&cНе удалось удалить якорь. +mv-core.anchor.list.header=&3==== [ Якоря Multiverse ] ==== +mv-core.anchor.list.entry=&a{anchor}&7 - &f{location} +mv-core.anchor.set.success=&aЯкорь &f{anchor}&a установлен на &f{location} +mv-core.anchor.set.failure=&cНе удалось установить якорь &f{anchor}. # /mv check mv-core.check.description=Проверяет, может ли игрок телепортироваться в указанное место. @@ -73,6 +92,15 @@ mv-core.delete.success=&aМир '{world}' удален! mv-core.dumps.description=Выводит информацию о версии в консоль или заливает в paste-сервисы mv-core.dumps.url.list={service} : {link} +# /mv entity-spawn-config +mv-core.entityspawnconfig.info.header===== [ Настройка спавна сущностей '{world}' ] ==== +mv-core.entityspawnconfig.info.category={category}:\u0020 +mv-core.entityspawnconfig.info.spawn=\ \ spawn: {spawn} +mv-core.entityspawnconfig.info.tickrate=\ \ tick-rate: {tickRate} +mv-core.entityspawnconfig.info.exceptions=\ \ исключения: {exceptions} +mv-core.entityspawnconfig.modify.success=Успешно установлено {property} на {value} для {category} в {world} +mv-core.entityspawnconfig.modify.failure=Не удалось установить {property} на {value} для {category} в {world}: {error} + # /mv gamerule set mv-core.gamerule.set.description=Изменяет игровое правило в одном или нескольких мирах. mv-core.gamerule.set.gamerule.description=Игровое правило для установки. @@ -99,7 +127,12 @@ mv-core.gamerule.list.title= --- Игровые правила для {world} -- # /mv generators mv-core.generators.description=Выводит список генераторов, известных Multiverse mv-core.generators.description.flags=Фильтр - показывает только соответствующие записи. Страница - страница для показа +mv-core.generators.header=&b====[ Список генераторов Multiverse ]==== mv-core.generators.empty=&cПлагины-генераторы не найдены. +mv-core.generators.info.plugin=&rПлагин генератора: {plugin} +mv-core.generators.info.exampleusages=&rПримеры использования:\u0020 +mv-core.generators.info.usages=&r{usages} +mv-core.generators.info.infolink=&rСсылка на подробности: {link} # /mv import mv-core.import.description=Импортирует существующую папку мира. @@ -137,6 +170,13 @@ mv-core.modify.success=&aУспешно {action} '&9{property}&a' на '&9{value mv-core.modify.failure=&cНе удалось {action} '&9{property}&c' на '&9{value}&c' в мире &9{world}&c.\n&c{error} mv-core.modify.failure.novalue=&cНе удалось {action} '&9{property}&c' в мире &9{world}&c.\n&c{error} +# /mv purge-all-entities +mv-core.purgeallentities.success=Успешно удалено {count} сущностей в мире {world}. +mv-core.purgeallentities.success.categories=Успешно удалено {count} сущностей в мире {world} для категорий спавна {categories}. + +# /mv purge-entities +mv-core.purgeentities.success=Успешно удалено {count} сущностей в мире {world}. + # /mv regen mv-core.regen.description=Регенерирует мир на вашем сервере. Предыдущее состояние будет потеряно НАВСЕГДА. mv-core.regen.world.description=Мир, который вы хотите регенерировать. @@ -167,6 +207,8 @@ mv-core.setspawn.world.description=Целевой мир для установк # /mv spawn mv-core.spawn.description=Телепортирует указанного игрока на спавн мира, в котором он находится mv-core.spawn.player.description=Игрок +mv-core.spawn.notmvworld=&cМир '{world}' не является миром Multiverse! +mv-core.spawn.nopermission=&cУ вас нет прав использовать эту команду в этом мире! mv-core.spawn.success=Телепортирован {player} на спавн '{world}'! mv-core.spawn.failed=Не удалось телепортировать {player} на спавн '{world}'. {reason} @@ -175,6 +217,9 @@ mv-core.teleport.description=Позволяет телепортироватьс mv-core.teleport.player.description=Целевой игрок для телепортации. mv-core.teleport.destination.description=Местоположение, может быть название мира. mv-core.teleport.toomanyplayers=&cВы не можете телепортировать более {count} игроков одновременно. +mv-core.teleport.nopermission.self=&cУ вас нет прав телепортировать себя! +mv-core.teleport.nopermission.other=&cУ вас нет прав телепортировать других игроков! +mv-core.teleport.nopermission.all=&cУ вас нет прав телепортировать всех этих игроков! mv-core.teleport.success=Телепортирован {player} в {destination}. mv-core.teleport.failed=Не удалось телепортировать {player} в {destination}. {reason} @@ -228,6 +273,21 @@ mv-core.worldborder.warningtime.success=&rУстановлено время пр # commands error mv-core.commands.error.playersonly=&cЭта команда может использоваться только игроками mv-core.commands.error.multiverseworldonly=&cЭто может использоваться только в мирах multiverse +mv-core.commands.error.loadedmultiverseworld.playersonly=Эта команда может использоваться только игроком в загруженном мире Multiverse. +mv-core.commands.error.loadedmultiverseworld.issuer=Вы не находитесь в загруженном мире Multiverse. Укажите имя мира Multiverse или используйте эту команду в загруженном мире Multiverse. +mv-core.commands.error.loadedmultiverseworld.inputconsole=Мир '{world}' не является загруженным миром Multiverse. Не забудьте указать имя мира при использовании команды из консоли. +mv-core.commands.error.loadedmultiverseworld.input=Мир {world} не является загруженным миром Multiverse. +mv-core.commands.error.multiverseworld.playersonly=Эта команда может использоваться только игроком в мире Multiverse. +mv-core.commands.error.multiverseworld.issuer=Вы не находитесь в мире Multiverse. Укажите имя мира Multiverse или используйте эту команду в мире Multiverse. +mv-core.commands.error.multiverseworld.inputconsole=Мир '{world}' не является миром Multiverse. Не забудьте указать имя мира при использовании команды из консоли. +mv-core.commands.error.multiverseworld.input=Мир {world} не является миром Multiverse. +mv-core.commands.error.player.issuerinput=Недопустимый игрок: {player}. Укажите игрока онлайн или используйте эту команду как игрок. +mv-core.commands.error.player.input=Игрок {player} не найден. +mv-core.commands.error.player.selector=Ни один игрок не соответствует селектору: {player}. +mv-core.commands.error.players.input=Игрок(и) {player} не найдены. +mv-core.commands.error.resolve.player=Не удалось определить контекст для игрока '{player}'. +mv-core.commands.error.resolve.input=Не удалось определить контекст для ввода '{input}'. +mv-core.commands.error.removeplayers.nodefault=Основной мир не найден, поэтому флаг --remove-players требует аргумент назначения. # entry check mv-core.entrycheck.blacklisted=Мир '{world}' в черном списке. @@ -244,7 +304,10 @@ mv-core.economy.vault.withdraw=&fС вас снято &2{price}. # multiverse parse destination failure reason mv-core.destination.anchor.failurereason.anchornotfound=&cЯкорь '&6{anchor}&c' не существует! +mv-core.destination.anchor.display=якорь '{anchor}' mv-core.destination.bed.failurereason.playernotfound=&cИгрок '&6{player}&c' не существует или не в сети! Для телепортации к собственной кровати используйте 'playerbed'. +mv-core.destination.bed.display.own=ваша кровать/точка возрождения +mv-core.destination.bed.display.other=кровать/точка возрождения игрока {player} mv-core.destination.cannon.failurereason.invalidformat=&cФормат пушки назначения: &6ca:worldname:x,y,z:pitch:yaw:speed mv-core.destination.exact.failurereason.invalidformat=&cТочный формат назначения: &6e:worldname:x,y,z:pitch:yaw mv-core.destination.player.failurereason.playernotfound=&cИгрок '&6{player}&c' не существует или не в сети! @@ -301,6 +364,9 @@ mv-core.worldcreator.invalidchunkgenerator=&cНедопустимый генер mv-core.worldcreator.bukkitcreationfailed=&cBukkit не удалось создать мир '{world}': {error}\n&cСм. консоль для подробностей. # queue command result +mv-core.queuecommand.defaultprompt=Команда, которую вы пытаетесь выполнить, считается опасной. +mv-core.queuecommand.prompt=Выполните &a{command} &fдля продолжения. Команда истечет через {timeout} секунд. +mv-core.queuecommand.expired=Ваша команда в очереди истекла. mv-core.queuecommand.nocommandinqueue=&cУ вас нет команд в очереди. mv-core.queuecommand.invalidotp=&cНеверный OTP номер '&6{otp}&c'. Пожалуйста, попробуйте снова... mv-core.queuecommand.commandexecutionerror=&cОшибка выполнения команды из очереди: {error}\n&fСм. консоль для подробностей. @@ -309,6 +375,7 @@ mv-core.queuecommand.commandexecutionerror=&cОшибка выполнения mv-core.contentdisplay.nocontent=&cНет содержимого для отображения. mv-core.contentdisplay.filter=&7[Фильтр '{filter}'] mv-core.contentdisplay.page=&7[Страница {current} из {total}] +mv-core.contentdisplay.pagefilter={page} {filter} mv-core.contentdisplay.invalidpage=&cНеверный номер страницы. Пожалуйста, введите номер страницы между &31&c и &3{total}&c. mv-core.contentdisplay.empty=&7&oпусто mv-core.contentdisplay.null=&7&onull @@ -319,9 +386,17 @@ mv-core.exception.multiverseworld.unloaddefaultworld=&cВы не можете в mv-core.exception.multiverseworld.unloadplayersinworld=&cВ мире все еще находится &6{count}&c игрок(ов)! Используйте флаг '&6--remove-players&c' в вашей команде, чтобы телепортировать всех игроков из мира. mv-core.exception.multiverseworld.unloaderror=&cПроизошла неизвестная ошибка при выгрузке мира: &6{world}&c.\n&cСм. консоль для подробностей. +# multiverse position parse exception +mv-core.exception.positionparse.invaliddirection=&cНеверный формат направления: {format}. Ожидаемый формат: : +mv-core.exception.positionparse.invalidcoordinates=&cНеверный формат координат: {format}. Ожидаемый формат: ,, +mv-core.exception.positionparse.invalidnumber=&cНеверный формат числа: {number}. Ожидается числовое значение. + # generic mv-core.generic.success=Успешно! mv-core.generic.failure=Неудача! mv-core.generic.error=Ошибка! +mv-core.generic.error.details=Ошибка: {error} mv-core.generic.null=Null! mv-core.generic.you=вы +mv-core.generic.playercount={count} игроков +mv-core.generic.teleportplayers.failed=Не удалось телепортировать одного или нескольких игроков из мира! diff --git a/src/main/resources/multiverse-core_zh.properties b/src/main/resources/multiverse-core_zh.properties index fda67171e..c2297cc80 100644 --- a/src/main/resources/multiverse-core_zh.properties +++ b/src/main/resources/multiverse-core_zh.properties @@ -1,6 +1,25 @@ # configuration mv-core.config.save.failed=保存 Multiverse-Core 的 config.yml 文件失败,所有修改都将是临时的! mv-core.config.node.notfound=在配置文件中无法找到节点: {node} +mv-core.config.node.invalidyamlkey=无效的 yaml 键:'{key}'。键只能包含字母、数字、下划线和连字符。 +mv-core.config.string.parser.invalidboolean=无法将 '{input}' 转换为布尔值。请使用 'true' 或 'false' +mv-core.config.string.parser.invalidinteger=无法将 '{input}' 转换为数字。(整数) +mv-core.config.string.parser.invaliddouble=无法将 '{input}' 转换为数字。(double) +mv-core.config.string.parser.invalidfloat=无法将 '{input}' 转换为数字。(float) +mv-core.config.string.parser.invalidlong=无法将 '{input}' 转换为数字。(long) + +# core config +mv-core.core.config.customportalsearchradius.nonnegative=值必须大于或等于 0。 +mv-core.core.config.confirmtimeout.positive=确认超时时间必须是正数! +mv-core.core.config.debuglevel.range=调试等级必须在 0 到 3 之间。 + +# /mv anchor +mv-core.anchor.delete.success=&a锚点 &f{anchor}&a 已删除。 +mv-core.anchor.delete.failure=&c删除锚点失败。 +mv-core.anchor.list.header=&3==== [ Multiverse 锚点 ] ==== +mv-core.anchor.list.entry=&a{anchor}&7 - &f{location} +mv-core.anchor.set.success=&a锚点 &f{anchor}&a 已设置到 &f{location} +mv-core.anchor.set.failure=&c设置锚点 &f{anchor} 失败。 # /mv check mv-core.check.description=检查某位玩家是否可以将自己传送至某个地方。 @@ -74,6 +93,15 @@ mv-core.delete.success=&a世界 '{world}' 已经删除! mv-core.dumps.description=导出版本信息到控制台或者粘贴服务。 mv-core.dumps.url.list={service}:{link} +# /mv entity-spawn-config +mv-core.entityspawnconfig.info.header===== [ 实体生成配置 '{world}' ] ==== +mv-core.entityspawnconfig.info.category={category}:\u0020 +mv-core.entityspawnconfig.info.spawn=\ \ spawn: {spawn} +mv-core.entityspawnconfig.info.tickrate=\ \ tick-rate: {tickRate} +mv-core.entityspawnconfig.info.exceptions=\ \ 例外: {exceptions} +mv-core.entityspawnconfig.modify.success=成功在 {world} 中将 {category} 的 {property} 设置为 {value} +mv-core.entityspawnconfig.modify.failure=在 {world} 中将 {category} 的 {property} 设置为 {value} 失败: {error} + # /mv gamerule set mv-core.gamerule.set.description=修改某个世界或某些世界的游戏规则。 mv-core.gamerule.set.gamerule.description=需要设置的游戏规则。 @@ -100,7 +128,12 @@ mv-core.gamerule.list.title= --- {world} 的游戏规则 --- # /mv generators mv-core.generators.description=列出 Multiverse 已知的生成器。 mv-core.generators.description.flags=筛选 - 仅显示匹配的条目。页码 - 查看的页面序号。 +mv-core.generators.header=&b====[ Multiverse 生成器列表 ]==== mv-core.generators.empty=&c未找到生成器插件。 +mv-core.generators.info.plugin=&r生成器插件: {plugin} +mv-core.generators.info.exampleusages=&r示例用法:\u0020 +mv-core.generators.info.usages=&r{usages} +mv-core.generators.info.infolink=&r更多信息链接: {link} # /mv import mv-core.import.description=导入一个已经存在的世界文件夹。 @@ -139,6 +172,13 @@ mv-core.modify.success=&a成功在世界 &9{world}&a 中 {action} '&9{property}& mv-core.modify.failure=&c在世界 &9{world}&c 中 {action} '&9{property}&c' 为 '&9{value}&c' 失败。\n&c{error} mv-core.modify.failure.novalue=&c在世界 &9{world}&c 中 {action} '&9{property}&c' 失败。\n&c{error} +# /mv purge-all-entities +mv-core.purgeallentities.success=成功清除了世界 {world} 中的 {count} 个实体。 +mv-core.purgeallentities.success.categories=成功清除了世界 {world} 中生成类别 {categories} 的 {count} 个实体。 + +# /mv purge-entities +mv-core.purgeentities.success=成功清除了世界 {world} 中的 {count} 个实体。 + # /mv regen mv-core.regen.description=在你的服务器上重新生成一个世界。之前的状态将会“永久”丢失。 mv-core.regen.world.description=你想要重新生成的世界。 @@ -173,6 +213,8 @@ mv-core.setspawn.notmvworld=&c无法为 &c{world} 设置出生点,因为它不 # /mv spawn mv-core.spawn.description=传送某个特定的玩家到他们所在世界的出生点。 mv-core.spawn.player.description=玩家 +mv-core.spawn.notmvworld=&c世界 '{world}' 不是 Multiverse 世界! +mv-core.spawn.nopermission=&c你没有权限在这个世界中使用此命令! mv-core.spawn.success=已传送 {player} 到 '{world}' 的出生点! mv-core.spawn.failed=传送 {player} 到 '{world}' 的出生点失败。{reason} @@ -181,6 +223,9 @@ mv-core.teleport.description=允许你传送到服务器上的某个位置! mv-core.teleport.player.description=传送的玩家。 mv-core.teleport.destination.description=位置,可以是一个世界的名字。 mv-core.teleport.toomanyplayers=&c你一次不能传送超过 {count} 个玩家。 +mv-core.teleport.nopermission.self=&c你没有权限传送自己! +mv-core.teleport.nopermission.other=&c你没有权限传送其他玩家! +mv-core.teleport.nopermission.all=&c你没有权限传送所有这些玩家! mv-core.teleport.success=已传送 {player} 到 {destination}。 mv-core.teleport.failed=传送 {player} 到 {destination}失败。{reason} @@ -234,6 +279,21 @@ mv-core.worldborder.warningtime.success=&r已设置世界 '&6{world}&r' 的边 # commands error mv-core.commands.error.playersonly=&c该指令仅玩家可以使用。 mv-core.commands.error.multiverseworldonly=&c该指令仅可以在Multiverse世界中使用。 +mv-core.commands.error.loadedmultiverseworld.playersonly=该指令仅可由已加载 Multiverse 世界中的玩家使用。 +mv-core.commands.error.loadedmultiverseworld.issuer=你不在已加载的 Multiverse 世界中。请指定一个 Multiverse 世界名称,或在已加载的 Multiverse 世界中使用此命令。 +mv-core.commands.error.loadedmultiverseworld.inputconsole=世界 '{world}' 不是已加载的 Multiverse 世界。从控制台使用此命令时,请记得指定世界名称。 +mv-core.commands.error.loadedmultiverseworld.input=世界 {world} 不是已加载的 Multiverse 世界。 +mv-core.commands.error.multiverseworld.playersonly=该指令仅可由 Multiverse 世界中的玩家使用。 +mv-core.commands.error.multiverseworld.issuer=你不在 Multiverse 世界中。请指定一个 Multiverse 世界名称,或在 Multiverse 世界中使用此命令。 +mv-core.commands.error.multiverseworld.inputconsole=世界 '{world}' 不是 Multiverse 世界。从控制台使用此命令时,请记得指定世界名称。 +mv-core.commands.error.multiverseworld.input=世界 {world} 不是 Multiverse 世界。 +mv-core.commands.error.player.issuerinput=无效玩家: {player}。请指定在线玩家,或作为玩家使用此命令。 +mv-core.commands.error.player.input=找不到玩家 {player}。 +mv-core.commands.error.player.selector=没有玩家匹配选择器: {player}。 +mv-core.commands.error.players.input=找不到玩家 {player}。 +mv-core.commands.error.resolve.player=无法为玩家 '{player}' 解析上下文。 +mv-core.commands.error.resolve.input=无法为输入 '{input}' 解析上下文。 +mv-core.commands.error.removeplayers.nodefault=未找到默认世界,因此 --remove-players 标志需要一个目标参数。 # entry check mv-core.entrycheck.blacklisted='{world}' 在黑名单中。 @@ -250,7 +310,10 @@ mv-core.economy.vault.withdraw=&f你已被收取 &2{price}。 # multiverse parse destination failure reason mv-core.destination.anchor.failurereason.anchornotfound=&c锚点 '&6{anchor}&c' 不存在! +mv-core.destination.anchor.display=锚点 '{anchor}' mv-core.destination.bed.failurereason.playernotfound=&玩家 '&6{player}&c' 不存在或不在线!如果想传送到自己的床,使用 'playerbed'。 +mv-core.destination.bed.display.own=你的床/重生点 +mv-core.destination.bed.display.other={player} 的床/重生点 mv-core.destination.cannon.failurereason.invalidformat=&c大炮目标格式是: &6ca:worldname:x,y,z:pitch:yaw:speed mv-core.destination.exact.failurereason.invalidformat=&c精确目标格式是: &6e:worldname:x,y,z:pitch:yaw mv-core.destination.player.failurereason.playernotfound=&c玩家 '&6{player}&c' 不存在或不在线! @@ -310,6 +373,9 @@ mv-core.worldcreator.invalidchunkgenerator=&c无效的区块生成器 '&6{genera mv-core.worldcreator.bukkitcreationfailed=&cBukkit 创建世界 '{world}' 失败: {error}\n&c查看控制台获取更多信息。 # queue command result +mv-core.queuecommand.defaultprompt=你尝试运行的指令被认为是危险的。 +mv-core.queuecommand.prompt=执行 &a{command} &f以继续。它将在 {timeout} 秒后过期。 +mv-core.queuecommand.expired=你列队中的指令已过期。 mv-core.queuecommand.nocommandinqueue=&c你没有任何指令在列队中。 mv-core.queuecommand.invalidotp=&c无效的 OTP 数字 '&6{otp}&c'。请重试…… mv-core.queuecommand.commandexecutionerror=&c在处理列队中命令时发生了错误: {error}\n&f查看控制台获取更多信息。 @@ -318,6 +384,7 @@ mv-core.queuecommand.commandexecutionerror=&c在处理列队中命令时发生 mv-core.contentdisplay.nocontent=&c没有可显示的内容 mv-core.contentdisplay.filter=&7[筛选 '{filter}'] mv-core.contentdisplay.page=&7[第 {current} 页,共 {total} 页] +mv-core.contentdisplay.pagefilter={page} {filter} mv-core.contentdisplay.invalidpage=&c无效的页码。请输入一个在 &31&c 到 &3{total}&c 之间的页码。 mv-core.contentdisplay.empty=&7&o空 mv-core.contentdisplay.null=&7&o错误 @@ -337,5 +404,8 @@ mv-core.exception.positionparse.invalidnumber=&c无效的数字格式: {number mv-core.generic.success=成功! mv-core.generic.failure=失败! mv-core.generic.error=错误! +mv-core.generic.error.details=错误: {error} mv-core.generic.null=无效! mv-core.generic.you=你 +mv-core.generic.playercount={count} 个玩家 +mv-core.generic.teleportplayers.failed=无法将一个或多个玩家传送出该世界!