From bc0d1a2720c49c42bbd1801f2c2291c6eb0c1f31 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Sun, 21 Jun 2026 15:19:09 +0800 Subject: [PATCH] Refactor all remaining issuer raw string messages to use localized strings --- .../inventories/commands/CacheCommand.java | 23 +++--- .../inventories/commands/ConfigCommand.java | 24 ++++--- .../inventories/commands/GiveCommand.java | 27 ++++--- .../commands/InventoryModifyCommand.java | 32 +++++++-- .../commands/InventoryViewCommand.java | 24 +++++-- .../inventories/commands/MigrateCommand.java | 9 ++- .../commands/PlayerDataImportCommand.java | 12 +++- .../inventories/commands/ToggleCommand.java | 13 ++-- .../commands/bulkedit/BulkEditCommand.java | 28 +++++--- .../bulkedit/globalprofile/ClearCommand.java | 3 +- .../bulkedit/globalprofile/ModifyCommand.java | 19 ++++- .../bulkedit/playerprofile/ClearCommand.java | 3 +- .../playerprofile/ClonePlayerCommand.java | 11 ++- .../playerprofile/CloneWorldGroupCommand.java | 13 ++-- .../bulkedit/playerprofile/DeleteCommand.java | 6 +- .../MigrateInventorySerializationCommand.java | 18 +++-- .../MigratePlayerNameCommand.java | 12 +++- .../profile/FlatFileProfileDataSource.java | 8 ++- .../profile/group/GroupingConflictResult.java | 2 +- .../inventories/util/MVInvi18n.java | 62 ++++++++++++++++ .../inventories/view/InventoryStatus.java | 39 ++++++++--- .../multiverse-inventories_en.properties | 70 ++++++++++++++++++- .../multiverse-inventories_zh.properties | 68 ++++++++++++++++++ 23 files changed, 431 insertions(+), 95 deletions(-) diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/CacheCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/CacheCommand.java index f63bd0ed..5908d807 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/CacheCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/CacheCommand.java @@ -12,9 +12,12 @@ import org.mvplugins.multiverse.external.jakarta.inject.Inject; import org.mvplugins.multiverse.external.jetbrains.annotations.NotNull; import org.mvplugins.multiverse.inventories.profile.ProfileCacheManager; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import java.util.Map; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class CacheCommand extends InventoriesCommand { @@ -30,15 +33,17 @@ final class CacheCommand extends InventoriesCommand { void onCacheStatsCommand(MVCommandIssuer issuer) { Map stats = this.ProfileCacheManager.getCacheStats(); for (Map.Entry entry : stats.entrySet()) { - issuer.sendMessage("Cache: " + entry.getKey()); - issuer.sendMessage(" hits count: " + entry.getValue().hitCount()); - issuer.sendMessage(" misses count: " + entry.getValue().missCount()); - issuer.sendMessage(" loads count: " + entry.getValue().loadCount()); - issuer.sendMessage(" evictions: " + entry.getValue().evictionCount()); - issuer.sendMessage(" hit rate: " + entry.getValue().hitRate() * 100 + "%"); - issuer.sendMessage(" miss rate: " + entry.getValue().missRate() * 100 + "%"); - issuer.sendMessage(" avg load penalty: " + entry.getValue().averageLoadPenalty() / 1000000 + "ms"); - issuer.sendMessage("--------"); + CacheStats cacheStats = entry.getValue(); + issuer.sendMessage(MVInvi18n.CACHE_ENTRY, replace("{cache}").with(entry.getKey())); + issuer.sendMessage(MVInvi18n.CACHE_HITSCOUNT, replace("{count}").with(cacheStats.hitCount())); + issuer.sendMessage(MVInvi18n.CACHE_MISSESCOUNT, replace("{count}").with(cacheStats.missCount())); + issuer.sendMessage(MVInvi18n.CACHE_LOADSCOUNT, replace("{count}").with(cacheStats.loadCount())); + issuer.sendMessage(MVInvi18n.CACHE_EVICTIONS, replace("{count}").with(cacheStats.evictionCount())); + issuer.sendMessage(MVInvi18n.CACHE_HITRATE, replace("{rate}").with(cacheStats.hitRate() * 100)); + issuer.sendMessage(MVInvi18n.CACHE_MISSRATE, replace("{rate}").with(cacheStats.missRate() * 100)); + issuer.sendMessage(MVInvi18n.CACHE_AVGLOADPENALTY, + replace("{milliseconds}").with(cacheStats.averageLoadPenalty() / 1000000)); + issuer.sendMessage(MVInvi18n.CACHE_SEPARATOR); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/ConfigCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/ConfigCommand.java index 998df4b6..3e57ea44 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/ConfigCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/ConfigCommand.java @@ -3,9 +3,6 @@ import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; import org.mvplugins.multiverse.core.command.MVCommandIssuer; -import org.mvplugins.multiverse.core.command.MVCommandManager; -import org.mvplugins.multiverse.core.exceptions.MultiverseException; -import org.mvplugins.multiverse.external.acf.commands.annotation.CommandAlias; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandCompletion; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandPermission; import org.mvplugins.multiverse.external.acf.commands.annotation.Description; @@ -13,8 +10,10 @@ import org.mvplugins.multiverse.external.acf.commands.annotation.Subcommand; import org.mvplugins.multiverse.external.acf.commands.annotation.Syntax; import org.mvplugins.multiverse.external.jakarta.inject.Inject; -import org.mvplugins.multiverse.external.vavr.control.Option; import org.mvplugins.multiverse.inventories.config.InventoriesConfig; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service final class ConfigCommand extends InventoriesCommand { @@ -51,18 +50,23 @@ void onConfigCommand( private void showConfigValue(MVCommandIssuer issuer, String name) { config.getStringPropertyHandle().getProperty(name) - .onSuccess(value -> issuer.sendMessage(name + "is currently set to " + value)) - .onFailure(e -> issuer.sendMessage(e.getMessage())); + .onSuccess(value -> issuer.sendMessage(MVInvi18n.CONFIG_CURRENTVALUE, + replace("{name}").with(name), + replace("{value}").with(value))) + .onFailure(e -> issuer.sendError(MVInvi18n.CONFIG_SHOWFAILED, replace("{error}").with(e))); } private void updateConfigValue(MVCommandIssuer issuer, String name, String value) { - // TODO: Update with localization config.getStringPropertyHandle().setPropertyString(name, value) .onSuccess(ignore -> { config.save(); - issuer.sendMessage("Successfully set " + name + " to " + value); + issuer.sendMessage(MVInvi18n.CONFIG_SET, + replace("{name}").with(name), + replace("{value}").with(value)); }) - .onFailure(ignore -> issuer.sendMessage("Unable to set " + name + " to " + value + ".")) - .onFailure(MultiverseException.class, e -> Option.of(e.getLocalizableMessage()).peek(issuer::sendError)); + .onFailure(e -> issuer.sendError(MVInvi18n.CONFIG_SETFAILED, + replace("{name}").with(name), + replace("{value}").with(value), + replace("{error}").with(e))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/GiveCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/GiveCommand.java index 9556d071..9bbf9378 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/GiveCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/GiveCommand.java @@ -27,11 +27,14 @@ import org.mvplugins.multiverse.inventories.profile.key.ProfileType; import org.mvplugins.multiverse.inventories.profile.key.ProfileTypes; import org.mvplugins.multiverse.inventories.share.Sharables; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import org.mvplugins.multiverse.inventories.util.PlayerStats; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicBoolean; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class GiveCommand extends InventoriesCommand { @@ -85,8 +88,11 @@ void onGiveCommand( && world.getName().equals(onlinePlayer.getWorld().getName()) && ProfileTypes.forPlayer(onlinePlayer).equals(profileType)) { onlinePlayer.getInventory().addItem(itemStack); - issuer.sendInfo("Gave player %s %s %s in world %s." - .formatted(player.getName(), itemStack.getAmount(), itemStack, world.getName())); + issuer.sendInfo(MVInvi18n.GIVE_SUCCESS, + replace("{player}").with(player.getName()), + replace("{amount}").with(itemStack.getAmount()), + replace("{item}").with(itemStack), + replace("{world}").with(world.getName())); return; } @@ -94,7 +100,7 @@ void onGiveCommand( .read() .thenCompose(inventory -> updatePlayerInventory(issuer, player, world, profileType, inventory, itemStack)) .exceptionally(throwable -> { - issuer.sendError(throwable.getMessage()); + issuer.sendError(MVInvi18n.GIVE_FAILED, replace("{error}").with(throwable)); return null; }); } @@ -111,11 +117,11 @@ void onGiveCommand( .getOrElse(1); } if (amount < 1) { - issuer.sendError("You have to give at least 1 item."); + issuer.sendError(MVInvi18n.GIVE_INVALIDAMOUNT); return null; } if (amount > 6400) { - issuer.sendError("Cannot give more than 6400 items at once."); + issuer.sendError(MVInvi18n.GIVE_AMOUNTTOOLARGE, replace("{amount}").with(6400)); return null; } // Remove amount string from item @@ -128,7 +134,7 @@ void onGiveCommand( String itemName = split[0]; Material material = Material.matchMaterial(itemName); if (material == null) { - issuer.sendError("Invalid Material: " + split[0]); + issuer.sendError(MVInvi18n.GIVE_INVALIDMATERIAL, replace("{material}").with(split[0])); return null; } @@ -139,7 +145,7 @@ void onGiveCommand( } String additionalData = split[1]; return Try.of(() -> Bukkit.getUnsafe().modifyItemStack(itemStack, itemStack.getType().getKey() + "[" + additionalData)) - .onFailure(throwable -> issuer.sendError(throwable.getMessage())) + .onFailure(throwable -> issuer.sendError(MVInvi18n.GIVE_FAILED, replace("{error}").with(throwable))) .getOrNull(); } @@ -157,8 +163,11 @@ private CompletableFuture updatePlayerInventory( .thenCompose(ignore -> player.isOnline() ? CompletableFuture.completedFuture(null) : profileDataSource.modifyGlobalProfile(GlobalProfileKey.of(player), profile -> profile.setLoadOnLogin(true))) - .thenRun(() -> issuer.sendInfo("Gave player %s %s %s in world %s." - .formatted(player.getName(), itemStack.getAmount(), itemStack.getI18NDisplayName(), world.getName()))); + .thenRun(() -> issuer.sendInfo(MVInvi18n.GIVE_SUCCESS, + replace("{player}").with(player.getName()), + replace("{amount}").with(itemStack.getAmount()), + replace("{item}").with(itemStack.getI18NDisplayName()), + replace("{world}").with(world.getName()))); } private void putItemInInventory(@Nullable ItemStack[] inventory, @NotNull ItemStack itemStack) { diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryModifyCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryModifyCommand.java index 33003fa3..3869639b 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryModifyCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryModifyCommand.java @@ -2,12 +2,12 @@ import com.dumptruckman.minecraft.util.Logging; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.jvnet.hk2.annotations.Service; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.world.MultiverseWorld; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandCompletion; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandPermission; @@ -20,8 +20,12 @@ import org.mvplugins.multiverse.inventories.MultiverseInventories; import org.mvplugins.multiverse.inventories.view.InventoryDataProvider; import org.mvplugins.multiverse.inventories.view.InventoryGUIHelper; +import org.mvplugins.multiverse.inventories.view.InventoryStatus; import org.mvplugins.multiverse.inventories.view.ModifiableInventoryHolder; import org.mvplugins.multiverse.inventories.view.PlayerInventoryData; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service final class InventoryModifyCommand extends InventoriesCommand { @@ -63,7 +67,7 @@ void onInventoryModifyCommand( MultiverseWorld world ) { String worldName = world.getName(); - issuer.sendInfo(ChatColor.YELLOW + "Loading inventory data for " + targetPlayer.getName() + "..."); + issuer.sendInfo(MVInvi18n.INVENTORY_LOADING, replace("{player}").with(targetPlayer.getName())); handleInventoryLoadAndDisplay(issuer, player, targetPlayer, worldName); } @@ -89,7 +93,7 @@ private void handleInventoryLoadAndDisplay( // If the player tries to modify their own live inventory, stop if (player.getUniqueId().equals(targetPlayer.getUniqueId()) && player.getWorld().getName().equalsIgnoreCase(worldName)) { - issuer.sendError(ChatColor.RED + "You cannot modify your own live inventory using this command. Use your regular inventory."); + issuer.sendError(MVInvi18n.INVENTORY_MODIFYLIVESELF); return; // Stop here if it's a live self-inventory } createAndOpenGUI(issuer, player, targetPlayer, worldName, playerInventoryData); @@ -99,11 +103,13 @@ private void handleInventoryLoadAndDisplay( .exceptionally(throwable -> { // This block runs if an exception occurs during data loading - String errorMessage = throwable.getMessage(); + String errorMessage = throwable.getLocalizedMessage(); if (errorMessage == null || errorMessage.isEmpty()) { - errorMessage = "An unknown error occurred while loading inventory data."; + issuer.sendError(MVInvi18n.INVENTORY_LOADFAILED, + replace("{error}").with(Message.of(MVInvi18n.INVENTORY_UNKNOWNLOADERROR))); + } else { + issuer.sendError(MVInvi18n.INVENTORY_LOADFAILED, replace("{error}").with(throwable)); } - issuer.sendError(ChatColor.RED + errorMessage); Logging.fine("Error loading inventory for " + targetPlayer.getName() + ": " + throwable.getMessage()); throwable.printStackTrace(); return null; @@ -141,6 +147,18 @@ private void createAndOpenGUI( // Call the helper method to populate the GUI inventoryGUIHelper.populateInventoryGUI(inv, playerInventoryData, true); player.openInventory(inv); - issuer.sendInfo(ChatColor.GREEN + playerInventoryData.status.getFormattedMessage(targetPlayer.getName(), worldName) + ". Changes will save on close."); + issuer.sendInfo(MVInvi18n.INVENTORY_OPENED, + replace("{status}").with(getStatusMessage(playerInventoryData.status, targetPlayer.getName(), worldName))); + } + + private Message getStatusMessage(InventoryStatus status, String playerName, String worldName) { + MVInvi18n messageKey = switch (status) { + case LIVE_INVENTORY -> MVInvi18n.INVENTORY_LIVEINVENTORY; + case STORED_INVENTORY -> MVInvi18n.INVENTORY_STOREDINVENTORY; + case NO_DATA_FOUND -> MVInvi18n.INVENTORY_NODATAFOUND; + }; + return Message.of(messageKey, + replace("{player}").with(playerName), + replace("{world}").with(worldName)); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryViewCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryViewCommand.java index 27cc2a6e..012471a9 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryViewCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/InventoryViewCommand.java @@ -2,12 +2,12 @@ import com.dumptruckman.minecraft.util.Logging; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.jvnet.hk2.annotations.Service; import org.mvplugins.multiverse.core.command.MVCommandIssuer; +import org.mvplugins.multiverse.core.locale.message.Message; import org.mvplugins.multiverse.core.world.MultiverseWorld; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandCompletion; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandPermission; @@ -22,6 +22,10 @@ import org.mvplugins.multiverse.inventories.view.PlayerInventoryData; import org.mvplugins.multiverse.inventories.view.ReadOnlyInventoryHolder; import org.mvplugins.multiverse.inventories.view.InventoryDataProvider; +import org.mvplugins.multiverse.inventories.view.InventoryStatus; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service final class InventoryViewCommand extends InventoriesCommand { @@ -64,7 +68,7 @@ void onInventoryViewCommand( String worldName = world.getName(); // Asynchronously load data using InventoryDataProvider - issuer.sendInfo(ChatColor.YELLOW + "Loading inventory data for " + targetPlayer.getName() + "..."); + issuer.sendInfo(MVInvi18n.INVENTORY_LOADING, replace("{player}").with(targetPlayer.getName())); handleInventoryLoadAndDisplay(issuer, player, targetPlayer, worldName); } @@ -90,7 +94,7 @@ private void handleInventoryLoadAndDisplay( }) .exceptionally(throwable -> { // This block runs if an exception occurs during data loading - issuer.sendError(ChatColor.RED + "Failed to load inventory data: " + throwable.getMessage()); + issuer.sendError(MVInvi18n.INVENTORY_LOADFAILED, replace("{error}").with(throwable)); Logging.severe("Error loading inventory for " + targetPlayer.getName() + ": " + throwable.getMessage()); throwable.printStackTrace(); return null; // Must return null for CompletableFuture in exceptionally @@ -123,6 +127,18 @@ private void createAndOpenGUI( // Call the helper method to populate the GUI inventoryGUIHelper.populateInventoryGUI(inv, playerInventoryData, false); player.openInventory(inv); - issuer.sendInfo(ChatColor.GREEN + playerInventoryData.status.getFormattedMessage(targetPlayer.getName(), worldName) + ". Changes will save on close."); + issuer.sendInfo(MVInvi18n.INVENTORY_OPENED, + replace("{status}").with(getStatusMessage(playerInventoryData.status, targetPlayer.getName(), worldName))); + } + + private Message getStatusMessage(InventoryStatus status, String playerName, String worldName) { + MVInvi18n messageKey = switch (status) { + case LIVE_INVENTORY -> MVInvi18n.INVENTORY_LIVEINVENTORY; + case STORED_INVENTORY -> MVInvi18n.INVENTORY_STOREDINVENTORY; + case NO_DATA_FOUND -> MVInvi18n.INVENTORY_NODATAFOUND; + }; + return Message.of(messageKey, + replace("{player}").with(playerName), + replace("{world}").with(worldName)); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/MigrateCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/MigrateCommand.java index 3a6cb7dd..d2f9a59c 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/MigrateCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/MigrateCommand.java @@ -23,6 +23,9 @@ @Service final class MigrateCommand extends InventoriesCommand { + private static final String IMPORTER_DOWNLOAD_URL = "https://modrinth.com/project/multiverse-inventoriesimporter/"; + private static final String IMPORTER_LEARN_MORE_URL = "https://mvplugins.org/inventories/how-to/import-playerdata/"; + private final DataImportManager dataImportManager; private final CommandQueueManager commandQueueManager; @@ -48,9 +51,9 @@ void onMigrateCommand( String pluginName) { if (dataImportManager.getEnabledImporterNames().isEmpty()) { - issuer.sendError("Please install Multiverse-InventoriesImporter plugin to use this command."); - issuer.sendInfo("Download Link: https://modrinth.com/project/multiverse-inventoriesimporter/"); - issuer.sendInfo("Learn More: https://mvplugins.org/inventories/how-to/import-playerdata/"); + issuer.sendError(MVInvi18n.MIGRATE_IMPORTERNOTINSTALLED); + issuer.sendInfo(MVInvi18n.MIGRATE_DOWNLOADLINK, replace("{url}").with(IMPORTER_DOWNLOAD_URL)); + issuer.sendInfo(MVInvi18n.MIGRATE_LEARNMORE, replace("{url}").with(IMPORTER_LEARN_MORE_URL)); return; } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/PlayerDataImportCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/PlayerDataImportCommand.java index 0a0fe19a..03aadd3c 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/PlayerDataImportCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/PlayerDataImportCommand.java @@ -8,18 +8,24 @@ import org.mvplugins.multiverse.external.acf.commands.annotation.Description; import org.mvplugins.multiverse.external.acf.commands.annotation.Subcommand; import org.mvplugins.multiverse.external.acf.commands.annotation.Syntax; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service final class PlayerDataImportCommand extends InventoriesCommand { + private static final String IMPORTER_DOWNLOAD_URL = "https://modrinth.com/project/multiverse-inventoriesimporter/"; + private static final String IMPORTER_LEARN_MORE_URL = "https://mvplugins.org/inventories/how-to/import-playerdata/"; + @Subcommand("playerdata import") @Syntax("") @CommandPermission("multiverse.inventories.importplayerdata") @CommandCompletion("@worldwithplayerdata") @Description("Import player data from the world's playerdata folder.") void onCommand(MVCommandIssuer issuer, World world) { - issuer.sendError("Please install Multiverse-InventoriesImporter plugin to use this command."); - issuer.sendInfo("Download Link: https://modrinth.com/project/multiverse-inventoriesimporter/"); - issuer.sendInfo("Learn More: https://mvplugins.org/inventories/how-to/import-playerdata/"); + issuer.sendError(MVInvi18n.PLAYERDATAIMPORT_IMPORTERNOTINSTALLED); + issuer.sendInfo(MVInvi18n.PLAYERDATAIMPORT_DOWNLOADLINK, replace("{url}").with(IMPORTER_DOWNLOAD_URL)); + issuer.sendInfo(MVInvi18n.PLAYERDATAIMPORT_LEARNMORE, replace("{url}").with(IMPORTER_LEARN_MORE_URL)); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/ToggleCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/ToggleCommand.java index 9519550c..d9c5b889 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/ToggleCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/ToggleCommand.java @@ -6,7 +6,6 @@ import org.mvplugins.multiverse.inventories.share.Sharable; import org.mvplugins.multiverse.inventories.share.Sharables; import org.mvplugins.multiverse.inventories.share.Shares; -import org.mvplugins.multiverse.core.command.MVCommandManager; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandAlias; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandCompletion; import org.mvplugins.multiverse.external.acf.commands.annotation.CommandPermission; @@ -24,6 +23,9 @@ @Service class ToggleCommand extends InventoriesCommand { + private static final String LAST_LOCATION_CONFIG_URL = + "https://mvplugins.org/inventories/how-to/configure-last-location/"; + private final InventoriesConfig inventoriesConfig; @Inject @@ -46,21 +48,20 @@ void onToggleCommand( ) { Shares optionalShares = inventoriesConfig.getActiveOptionalShares(); if (!sharable.isOptional()) { - issuer.sendError(MVInvi18n.TOGGLE_NOOPTIONALSHARES, replace("{share}").with(sharable.toString())); + issuer.sendError(MVInvi18n.TOGGLE_NOOPTIONALSHARES, replace("{share}").with(sharable)); return; } if (optionalShares.contains(sharable)) { optionalShares.remove(sharable); - issuer.sendInfo(MVInvi18n.TOGGLE_NOWNOTUSINGOPTIONAL, replace("{share}").with(sharable.getNames()[0])); + issuer.sendInfo(MVInvi18n.TOGGLE_NOWNOTUSINGOPTIONAL, replace("{share}").with(sharable)); } else { optionalShares.add(sharable); - issuer.sendInfo(MVInvi18n.TOGGLE_NOWUSINGOPTIONAL, replace("{share}").with(sharable.getNames()[0])); + issuer.sendInfo(MVInvi18n.TOGGLE_NOWUSINGOPTIONAL, replace("{share}").with(sharable)); // special tip to our wiki page, hopefully this reduces the number of people asking the // same old questions about last location config options on discord. if (sharable == Sharables.LAST_LOCATION) { - issuer.sendInfo("For more information on configuring last location, please see: " + - "https://mvplugins.org/inventories/how-to/configure-last-location/"); + issuer.sendInfo(MVInvi18n.TOGGLE_LASTLOCATIONINFO, replace("{url}").with(LAST_LOCATION_CONFIG_URL)); } } inventoriesConfig.setActiveOptionalShares(optionalShares); diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/BulkEditCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/BulkEditCommand.java index d6e5c3d0..7f508e38 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/BulkEditCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/BulkEditCommand.java @@ -10,6 +10,9 @@ import org.mvplugins.multiverse.inventories.profile.bulkedit.BulkEditAction; import org.mvplugins.multiverse.inventories.profile.bulkedit.BulkEditCreator; import org.mvplugins.multiverse.inventories.profile.bulkedit.BulkEditResult; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Contract @ApiStatus.Internal @@ -23,25 +26,32 @@ protected BulkEditCommand(BulkEditCreator bulkEditCreator) { } protected void outputActionSummary(MVCommandIssuer issuer, BulkEditAction bulkEditAction) { - issuer.sendMessage("Summary of affected profiles:"); - bulkEditAction.getActionSummary().forEach((key, value) -> - issuer.sendMessage(" %s: %s".formatted(key, value.size() > 10 - ? value.size() - : StringFormatter.join(value, ", ")))); + issuer.sendMessage(MVInvi18n.BULKEDIT_SUMMARY); + bulkEditAction.getActionSummary().forEach((key, value) -> { + Object valueSummary = value.size() > 10 + ? value.size() + : StringFormatter.join(value, ", "); + issuer.sendMessage(MVInvi18n.BULKEDIT_SUMMARYENTRY, + replace("{key}").with(key), + replace("{value}").with(valueSummary)); + }); } protected void runBulkEditAction(MVCommandIssuer issuer, BulkEditAction bulkEditAction) { - issuer.sendMessage("Starting bulk edit action..."); + issuer.sendMessage(MVInvi18n.BULKEDIT_STARTING); bulkEditAction.execute() .thenAccept(result -> outputResult(issuer, result)); } protected void outputResult(MVCommandIssuer issuer, BulkEditResult bulkEditResult) { - issuer.sendMessage("Successfully processed %d profiles!".formatted(bulkEditResult.getSuccessCount())); + issuer.sendMessage(MVInvi18n.BULKEDIT_SUCCESSCOUNT, + replace("{count}").with(bulkEditResult.getSuccessCount())); if (bulkEditResult.getFailureCount() > 0) { - issuer.sendError("Failed to process %d profiles! See log for details.".formatted(bulkEditResult.getFailureCount())); + issuer.sendError(MVInvi18n.BULKEDIT_FAILURECOUNT, + replace("{count}").with(bulkEditResult.getFailureCount())); } - issuer.sendMessage("Bulk edit action completed in %.4f ms.".formatted(bulkEditResult.getTimeTaken())); + issuer.sendMessage(MVInvi18n.BULKEDIT_COMPLETEDTIME, + replace("{milliseconds}").with("%.4f".formatted(bulkEditResult.getTimeTaken()))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ClearCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ClearCommand.java index 7be2c960..fbd4e9ec 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ClearCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ClearCommand.java @@ -21,6 +21,7 @@ import org.mvplugins.multiverse.inventories.profile.bulkedit.BulkEditAction; import org.mvplugins.multiverse.inventories.profile.bulkedit.BulkEditCreator; import org.mvplugins.multiverse.inventories.profile.key.GlobalProfileKey; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import java.util.Arrays; import java.util.concurrent.CompletableFuture; @@ -65,7 +66,7 @@ void onCommand( outputActionSummary(issuer, bulkEditAction); commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to clear the selected global profiles?")) + .prompt(Message.of(MVInvi18n.BULKEDIT_GLOBALPROFILE_CLEAR_CONFIRMPROMPT)) .action(() -> runBulkEditAction(issuer, bulkEditAction))); } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ModifyCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ModifyCommand.java index bd419200..06269be1 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ModifyCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/globalprofile/ModifyCommand.java @@ -14,11 +14,14 @@ import org.mvplugins.multiverse.inventories.commands.InventoriesCommand; import org.mvplugins.multiverse.inventories.profile.ProfileDataSource; import org.mvplugins.multiverse.inventories.profile.key.GlobalProfileKey; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import java.util.Arrays; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class ModifyCommand extends InventoriesCommand { @@ -48,7 +51,10 @@ void onCommand( GlobalProfileKey[] profileKeys ) { commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to modify %s to %s for %d players?".formatted(property, value, profileKeys.length))) + .prompt(Message.of(MVInvi18n.BULKEDIT_GLOBALPROFILE_MODIFY_CONFIRMPROMPT, + replace("{property}").with(property), + replace("{value}").with(value), + replace("{count}").with(profileKeys.length))) .action(() -> doModify(issuer, property, value, profileKeys))); } @@ -60,10 +66,17 @@ private void doModify(MVCommandIssuer issuer, String property, String value, Glo globalProfile.getStringPropertyHandle() .modifyPropertyString(property, value, PropertyModifyAction.SET) .onSuccess(ignore -> counter.incrementAndGet()) - .onFailure(throwable -> issuer.sendError("Failed to modify %s for %s. %s".formatted(property, profileKey, throwable.getMessage()))))) + .onFailure(throwable -> issuer.sendError( + MVInvi18n.BULKEDIT_GLOBALPROFILE_MODIFY_FAILED, + replace("{property}").with(property), + replace("{profile}").with(profileKey), + replace("{error}").with(throwable))))) .toArray(CompletableFuture[]::new); CompletableFuture.allOf(futures) - .thenRun(() -> issuer.sendMessage("Successfully modified %s to %s for %d players.".formatted(property, value, counter.get()))); + .thenRun(() -> issuer.sendMessage(MVInvi18n.BULKEDIT_GLOBALPROFILE_MODIFY_SUCCESS, + replace("{property}").with(property), + replace("{value}").with(value), + replace("{count}").with(counter.get()))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClearCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClearCommand.java index 2301d2ba..07f85bcf 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClearCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClearCommand.java @@ -19,6 +19,7 @@ import org.mvplugins.multiverse.inventories.profile.key.ContainerKey; import org.mvplugins.multiverse.inventories.profile.key.GlobalProfileKey; import org.mvplugins.multiverse.inventories.profile.key.ProfileType; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; @Service final class ClearCommand extends BulkEditCommand { @@ -70,7 +71,7 @@ void onCommand( outputActionSummary(issuer, bulkEditAction); commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to clear the selected profiles?")) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_CLEAR_CONFIRMPROMPT)) .action(() -> runBulkEditAction(issuer, bulkEditAction))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClonePlayerCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClonePlayerCommand.java index b5c945c0..398a94d5 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClonePlayerCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/ClonePlayerCommand.java @@ -19,6 +19,9 @@ import org.mvplugins.multiverse.inventories.profile.key.ContainerKey; import org.mvplugins.multiverse.inventories.profile.key.GlobalProfileKey; import org.mvplugins.multiverse.inventories.profile.key.ProfileType; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service public class ClonePlayerCommand extends BulkEditCommand { @@ -74,9 +77,11 @@ void onCommand( outputActionSummary(issuer, bulkEditAction); commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to clone profiles from %s to %s for the selected groups/worlds?" - .formatted(fromPlayer.getPlayerName(), - toPlayers.length == 1 ? toPlayers[0].getPlayerName() : toPlayers.length + " players"))) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_CLONEPLAYER_CONFIRMPROMPT, + replace("{fromplayer}").with(fromPlayer.getPlayerName()), + replace("{toplayers}").with(toPlayers.length == 1 + ? toPlayers[0].getPlayerName() + : toPlayers.length + " players"))) .action(() -> runBulkEditAction(issuer, bulkEditAction))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/CloneWorldGroupCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/CloneWorldGroupCommand.java index 2295f5d2..2e90e2a2 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/CloneWorldGroupCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/CloneWorldGroupCommand.java @@ -20,9 +20,12 @@ import org.mvplugins.multiverse.inventories.profile.key.ContainerKey; import org.mvplugins.multiverse.inventories.profile.key.GlobalProfileKey; import org.mvplugins.multiverse.inventories.profile.key.ProfileType; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import java.util.Objects; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service public class CloneWorldGroupCommand extends BulkEditCommand { @@ -64,8 +67,9 @@ void onCommand( ) { if (Array.of(toContainerKeys) .find(toKey -> Objects.equals(fromContainerKey, toKey)) - .peek(toKey -> issuer.sendError("Cannot copy profiles to the same " - + toKey.getContainerType() + ": " + toKey.getDataName())) + .peek(toKey -> issuer.sendError(MVInvi18n.BULKEDIT_PLAYERPROFILE_CLONEWORLDGROUP_SAMECONTAINER, + replace("{containertype}").with(toKey.getContainerType()), + replace("{container}").with(toKey.getDataName()))) .isDefined()) { return; } @@ -85,8 +89,9 @@ void onCommand( outputActionSummary(issuer, bulkEditAction); commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to clone profiles from %s %s to the selected groups/worlds?" - .formatted(fromContainerKey.getContainerType(), fromContainerKey.getDataName()))) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_CLONEWORLDGROUP_CONFIRMPROMPT, + replace("{containertype}").with(fromContainerKey.getContainerType()), + replace("{container}").with(fromContainerKey.getDataName()))) .action(() -> runBulkEditAction(issuer, bulkEditAction))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/DeleteCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/DeleteCommand.java index 0f111ff9..aa5e7745 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/DeleteCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/DeleteCommand.java @@ -20,6 +20,9 @@ import org.mvplugins.multiverse.inventories.profile.key.GlobalProfileKey; import org.mvplugins.multiverse.inventories.profile.key.ProfileType; import org.mvplugins.multiverse.inventories.share.Sharable; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; @Service final class DeleteCommand extends BulkEditCommand { @@ -75,7 +78,8 @@ void onCommand( outputActionSummary(issuer, bulkEditAction); commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to delete %s from the selected profiles?".formatted(sharable.getNames()[0]))) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_DELETE_CONFIRMPROMPT, + replace("{share}").with(sharable))) .action(() -> runBulkEditAction(issuer, bulkEditAction))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigrateInventorySerializationCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigrateInventorySerializationCommand.java index 593695ad..46f1e7f4 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigrateInventorySerializationCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigrateInventorySerializationCommand.java @@ -17,11 +17,14 @@ import org.mvplugins.multiverse.inventories.profile.key.ProfileKey; import org.mvplugins.multiverse.inventories.profile.key.ProfileTypes; import org.mvplugins.multiverse.inventories.profile.key.ContainerType; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import java.util.Arrays; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicLong; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class MigrateInventorySerializationCommand extends InventoriesCommand { @@ -44,7 +47,7 @@ final class MigrateInventorySerializationCommand extends InventoriesCommand { @CommandPermission("multiverse.inventories.bulkedit") void onNbtCommand(MVCommandIssuer issuer) { commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to migrate all player data to NBT?")) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_NBT_CONFIRMPROMPT)) .action(() -> doMigration(issuer, true))); } @@ -52,7 +55,7 @@ void onNbtCommand(MVCommandIssuer issuer) { @CommandPermission("multiverse.inventories.bulkedit") void onBukkitCommand(MVCommandIssuer issuer) { commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to migrate all player data to old Bukkit serialization?")) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_BUKKIT_CONFIRMPROMPT)) .action(() -> doMigration(issuer, false))); } @@ -67,14 +70,19 @@ private void doMigration(MVCommandIssuer issuer, boolean useByteSerialization) { .map(playerUUID -> profileDataSource.getGlobalProfile(GlobalProfileKey.of(playerUUID, "")) .thenCompose(profile -> run(profile, profileCounter)) .exceptionally(throwable -> { - issuer.sendMessage("Error updating player " + playerUUID + ": " + throwable.getMessage()); + issuer.sendMessage( + MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_PLAYERERROR, + replace("{player}").with(playerUUID), + replace("{error}").with(throwable)); return null; })) .toArray(CompletableFuture[]::new)) .thenRun(() -> { long timeDuration = (System.nanoTime() - startTime) / 1000000; - issuer.sendMessage("Updated " + profileCounter.get() + " player profiles."); - issuer.sendMessage("Bulk edit completed in " + timeDuration + " ms."); + issuer.sendMessage(MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_UPDATED, + replace("{count}").with(profileCounter.get())); + issuer.sendMessage(MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_COMPLETED, + replace("{milliseconds}").with(timeDuration)); }); } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigratePlayerNameCommand.java b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigratePlayerNameCommand.java index e4aec8ad..228645a8 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigratePlayerNameCommand.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/commands/bulkedit/playerprofile/MigratePlayerNameCommand.java @@ -12,6 +12,9 @@ import org.mvplugins.multiverse.external.vavr.control.Try; import org.mvplugins.multiverse.inventories.commands.InventoriesCommand; import org.mvplugins.multiverse.inventories.profile.ProfileDataSource; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; final class MigratePlayerNameCommand extends InventoriesCommand { @@ -35,13 +38,16 @@ void onCommand( String newName ) { commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer) - .prompt(Message.of("Are you sure you want to migrate all player data for %s to %s? This action cannot be undone." - .formatted(oldName, newName))) + .prompt(Message.of(MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEPLAYERNAME_CONFIRMPROMPT, + replace("{oldname}").with(oldName), + replace("{newname}").with(newName))) .action(() -> doMigration(issuer, oldName, newName))); } private void doMigration(MVCommandIssuer issuer, String oldName, String newName) { Try.run(() -> profileDataSource.migratePlayerProfileName(oldName, newName)) - .onFailure(e -> issuer.sendMessage("Failed to migrate player data for " + oldName + ". " + e.getMessage())); + .onFailure(e -> issuer.sendMessage(MVInvi18n.BULKEDIT_PLAYERPROFILE_MIGRATEPLAYERNAME_FAILED, + replace("{player}").with(oldName), + replace("{error}").with(e))); } } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/profile/FlatFileProfileDataSource.java b/src/main/java/org/mvplugins/multiverse/inventories/profile/FlatFileProfileDataSource.java index ea17a4c1..035121c4 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/profile/FlatFileProfileDataSource.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/profile/FlatFileProfileDataSource.java @@ -16,6 +16,7 @@ import org.mvplugins.multiverse.inventories.profile.key.ProfileType; import org.mvplugins.multiverse.inventories.profile.key.ProfileTypes; import org.mvplugins.multiverse.inventories.profile.key.ContainerType; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; @@ -34,6 +35,8 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; + @Service final class FlatFileProfileDataSource implements ProfileDataSource { @@ -420,7 +423,10 @@ public CompletableFuture deleteGlobalProfile(GlobalProfileKey key, boolean return getExistingGlobalProfile(key) .thenCompose(globalProfile -> { if (globalProfile.isEmpty()) { - return CompletableFuture.failedFuture(new MultiverseException("Invalid global profile for player: " + key)); + return CompletableFuture.failedFuture(new MultiverseException( + MVInvi18n.ERROR_INVALIDGLOBALPROFILE.bundle( + "Invalid global profile for player: {player}", + replace("{player}").with(key)))); } return deleteGlobalProfileFromDisk(globalProfile.get()); }) diff --git a/src/main/java/org/mvplugins/multiverse/inventories/profile/group/GroupingConflictResult.java b/src/main/java/org/mvplugins/multiverse/inventories/profile/group/GroupingConflictResult.java index ad5ecac1..9acd27ce 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/profile/group/GroupingConflictResult.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/profile/group/GroupingConflictResult.java @@ -43,7 +43,7 @@ public void sendConflictIssue(MVCommandIssuer issuer) { conflicts.forEach(conflict -> issuer.sendInfo(MVInvi18n.CONFLICT_RESULTS, replace("{group1}").with(conflict.getFirstGroup().getName()), replace("{group2}").with(conflict.getSecondGroup().getName()), - replace("{shares}").with(conflict.getConflictingShares().toString()), + replace("{shares}").with(conflict.getConflictingShares()), replace("{worlds}").with(conflict.getWorldsString()))); issuer.sendInfo(MVInvi18n.CONFLICT_FOUND); } diff --git a/src/main/java/org/mvplugins/multiverse/inventories/util/MVInvi18n.java b/src/main/java/org/mvplugins/multiverse/inventories/util/MVInvi18n.java index a72e00ea..3b2b8ba6 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/util/MVInvi18n.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/util/MVInvi18n.java @@ -34,12 +34,28 @@ public enum MVInvi18n implements MessageKeyProvider { ERROR_NOWORLD, ERROR_NOWORLDPROFILE, ERROR_NOSHARESSPECIFIED, + ERROR_INVALIDGLOBALPROFILE, CONFLICT_RESULTS, CONFLICT_CHECKING, CONFLICT_FOUND, CONFLICT_NOTFOUND, + CACHE_ENTRY, + CACHE_HITSCOUNT, + CACHE_MISSESCOUNT, + CACHE_LOADSCOUNT, + CACHE_EVICTIONS, + CACHE_HITRATE, + CACHE_MISSRATE, + CACHE_AVGLOADPENALTY, + CACHE_SEPARATOR, + + CONFIG_CURRENTVALUE, + CONFIG_SHOWFAILED, + CONFIG_SET, + CONFIG_SETFAILED, + INFO_WORLD, INFO_WORLD_INFO, INFO_GROUP, @@ -49,6 +65,15 @@ public enum MVInvi18n implements MessageKeyProvider { INFO_GROUP_APPLICABLESHARES, INFO_ZEROARG, + INVENTORY_LOADING, + INVENTORY_LOADFAILED, + INVENTORY_UNKNOWNLOADERROR, + INVENTORY_LIVEINVENTORY, + INVENTORY_STOREDINVENTORY, + INVENTORY_NODATAFOUND, + INVENTORY_OPENED, + INVENTORY_MODIFYLIVESELF, + LIST_GROUPS, LIST_GROUPS_INFO, @@ -64,6 +89,12 @@ public enum MVInvi18n implements MessageKeyProvider { DISABLEDSHARES_NOWSHARING, + GIVE_SUCCESS, + GIVE_FAILED, + GIVE_INVALIDAMOUNT, + GIVE_AMOUNTTOOLARGE, + GIVE_INVALIDMATERIAL, + SPAWN_TELEPORTING, SPAWN_TELEPORTEDBY, SPAWN_TELEPORTCONSOLEERROR, @@ -74,6 +105,7 @@ public enum MVInvi18n implements MessageKeyProvider { TOGGLE_NOWUSINGOPTIONAL, TOGGLE_NOWNOTUSINGOPTIONAL, TOGGLE_NOOPTIONALSHARES, + TOGGLE_LASTLOCATIONINFO, GROUP_COMMANDPROMPT, GROUP_CREATEPROMPT, @@ -91,8 +123,38 @@ public enum MVInvi18n implements MessageKeyProvider { GROUP_NONCONVERSABLE, GROUP_INVALIDOPTION, + BULKEDIT_SUMMARY, + BULKEDIT_SUMMARYENTRY, + BULKEDIT_STARTING, + BULKEDIT_SUCCESSCOUNT, + BULKEDIT_FAILURECOUNT, + BULKEDIT_COMPLETEDTIME, + BULKEDIT_GLOBALPROFILE_CLEAR_CONFIRMPROMPT, + BULKEDIT_GLOBALPROFILE_MODIFY_CONFIRMPROMPT, + BULKEDIT_GLOBALPROFILE_MODIFY_FAILED, + BULKEDIT_GLOBALPROFILE_MODIFY_SUCCESS, + BULKEDIT_PLAYERPROFILE_CLONEPLAYER_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_CLONEWORLDGROUP_SAMECONTAINER, + BULKEDIT_PLAYERPROFILE_CLONEWORLDGROUP_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_CLEAR_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_DELETE_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_NBT_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_BUKKIT_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_PLAYERERROR, + BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_UPDATED, + BULKEDIT_PLAYERPROFILE_MIGRATEINVENTORYSERIALIZATION_COMPLETED, + BULKEDIT_PLAYERPROFILE_MIGRATEPLAYERNAME_CONFIRMPROMPT, + BULKEDIT_PLAYERPROFILE_MIGRATEPLAYERNAME_FAILED, + + PLAYERDATAIMPORT_IMPORTERNOTINSTALLED, + PLAYERDATAIMPORT_DOWNLOADLINK, + PLAYERDATAIMPORT_LEARNMORE, + MIGRATE_PLUGINNOTENABLED, MIGRATE_UNSUPPORTEDPLUGIN, + MIGRATE_IMPORTERNOTINSTALLED, + MIGRATE_DOWNLOADLINK, + MIGRATE_LEARNMORE, MIGRATE_CONFIRMPROMPT, MIGRATE_SUCCESS, MIGRATE_FAILED, diff --git a/src/main/java/org/mvplugins/multiverse/inventories/view/InventoryStatus.java b/src/main/java/org/mvplugins/multiverse/inventories/view/InventoryStatus.java index 69bcef36..7f22c27d 100644 --- a/src/main/java/org/mvplugins/multiverse/inventories/view/InventoryStatus.java +++ b/src/main/java/org/mvplugins/multiverse/inventories/view/InventoryStatus.java @@ -1,8 +1,11 @@ package org.mvplugins.multiverse.inventories.view; -import org.bukkit.ChatColor; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; +import org.mvplugins.multiverse.core.locale.message.MessageReplacement; +import org.mvplugins.multiverse.inventories.util.MVInvi18n; + +import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace; /** * Represents the status of an inventory data load operation. @@ -10,6 +13,7 @@ * * @since 5.2 */ +//TODO: Make this enum implement LocalizableMessage @ApiStatus.Experimental @ApiStatus.AvailableSince("5.2") public enum InventoryStatus { @@ -19,7 +23,9 @@ public enum InventoryStatus { * @since 5.2 */ @ApiStatus.AvailableSince("5.2") - LIVE_INVENTORY(ChatColor.GREEN + "Displaying LIVE inventory"), + LIVE_INVENTORY( + MVInvi18n.INVENTORY_LIVEINVENTORY, + "&aDisplaying LIVE inventory for {player} in world {world}"), /** * Indicates that stored inventory data from Multiverse-Inventories profiles was displayed. @@ -27,7 +33,9 @@ public enum InventoryStatus { * @since 5.2 */ @ApiStatus.AvailableSince("5.2") - STORED_INVENTORY(ChatColor.GREEN + "Displaying STORED inventory"), + STORED_INVENTORY( + MVInvi18n.INVENTORY_STOREDINVENTORY, + "&aDisplaying STORED inventory for {player} in world {world}"), /** * Indicates that no player data was found for the specified world/player. @@ -35,12 +43,17 @@ public enum InventoryStatus { * @since 5.2 */ @ApiStatus.AvailableSince("5.2") - NO_DATA_FOUND(ChatColor.RED + "No player data found"); + NO_DATA_FOUND( + MVInvi18n.INVENTORY_NODATAFOUND, + "&cNo player data found for {player} in world {world}. " + + "Try checking a different world or ensure the player has played in this world."); - private final String message; + private final MVInvi18n messageKey; + private final String nonLocalizedMessage; - InventoryStatus(@NotNull String message) { - this.message = message; + InventoryStatus(@NotNull MVInvi18n messageKey, @NotNull String nonLocalizedMessage) { + this.messageKey = messageKey; + this.nonLocalizedMessage = nonLocalizedMessage; } /** @@ -54,9 +67,13 @@ public enum InventoryStatus { */ @ApiStatus.AvailableSince("5.2") public @NotNull String getFormattedMessage(@NotNull String playerName, @NotNull String worldName) { - if (this == NO_DATA_FOUND) { - return this.message + " for " + playerName + " in world" + worldName + ". Try checking a different world or ensure the player has played in this world."; - } - return this.message + " for " + playerName + " in world " + worldName; + return messageKey.bundle(nonLocalizedMessage, getReplacements(playerName, worldName)).formatted(); + } + + private MessageReplacement[] getReplacements(@NotNull String playerName, @NotNull String worldName) { + return new MessageReplacement[]{ + replace("{player}").with(playerName), + replace("{world}").with(worldName) + }; } } diff --git a/src/main/resources/multiverse-inventories_en.properties b/src/main/resources/multiverse-inventories_en.properties index 8ae14ab5..8145f26c 100644 --- a/src/main/resources/multiverse-inventories_en.properties +++ b/src/main/resources/multiverse-inventories_en.properties @@ -22,6 +22,7 @@ mv-inventories.error.nogroup=&cThere is no group with the name: &f{group} mv-inventories.error.noworld=&cThere is no world with the name: &f{world} mv-inventories.error.noworldprofile=&cThere is no world profile for the world: &f{world} mv-inventories.error.nosharesspecified=&cYou did not specify any valid shares! +mv-inventories.error.invalidglobalprofile=Invalid global profile for player: {player} # Conflicts mv-inventories.conflict.results=&cConflict found for groups: '&6{group1}&c' and '&6{group2}&c'! Both groups contains world(s) '&3{worlds}&c' that share(s): '&3{shares}&c'. @@ -30,6 +31,23 @@ mv-inventories.conflict.found=&cConflicts have been found... If these are not re mv-inventories.conflict.notfound=No group conflicts found! # Commands +# Cache Command +mv-inventories.cache.entry=&bCache: &f{cache} +mv-inventories.cache.hitscount=\ \ &6hits count: &f{count} +mv-inventories.cache.missescount=\ \ &6misses count: &f{count} +mv-inventories.cache.loadscount=\ \ &6loads count: &f{count} +mv-inventories.cache.evictions=\ \ &6evictions: &f{count} +mv-inventories.cache.hitrate=\ \ &6hit rate: &f{rate}% +mv-inventories.cache.missrate=\ \ &6miss rate: &f{rate}% +mv-inventories.cache.avgloadpenalty=\ \ &6avg load penalty: &f{milliseconds}ms +mv-inventories.cache.separator=&8-------- + +# Config Command +mv-inventories.config.currentvalue={name} is currently set to {value} +mv-inventories.config.showfailed={error} +mv-inventories.config.set=Successfully set {name} to {value} +mv-inventories.config.setfailed=Unable to set {name} to {value}. {error} + ## Info Command mv-inventories.info.world=&b===[ Info for world: &6{world}&b ]=== mv-inventories.info.world.info=&6In Groups:&f {groups} @@ -40,6 +58,16 @@ mv-inventories.info.group.infoshares=&bConfig Shares:&f {shares} mv-inventories.info.group.applicableshares=&bApplicable Shares:&f {shares} mv-inventories.info.zeroarg=You may only use the no argument version of this command in game! +# Inventory Command +mv-inventories.inventory.loading=&eLoading inventory data for {player}... +mv-inventories.inventory.loadfailed=&cFailed to load inventory data: {error} +mv-inventories.inventory.unknownloaderror=An unknown error occurred while loading inventory data. +mv-inventories.inventory.liveinventory=&aDisplaying LIVE inventory for {player} in world {world} +mv-inventories.inventory.storedinventory=&aDisplaying STORED inventory for {player} in world {world} +mv-inventories.inventory.nodatafound=&cNo player data found for {player} in world {world}. Try checking a different world or ensure the player has played in this world. +mv-inventories.inventory.opened={status}. Changes will save on close. +mv-inventories.inventory.modifyliveself=&cYou cannot modify your own live inventory using this command. Use your regular inventory. + # List Command mv-inventories.list.groups=&b===[ Group List ]=== mv-inventories.list.groups.info=&6Groups:&f {groups} @@ -61,6 +89,13 @@ mv-inventories.shares.nowsharing=&6Group: &f{group} &6is now sharing: &f{shares} # Add/remove disabled shares command mv-inventories.disabledshares.nowsharing=&6Group &f{group} &6now has the following disabled shares: &f{shares} +# Give command +mv-inventories.give.success=Gave player {player} {amount} {item} in world {world}. +mv-inventories.give.failed={error} +mv-inventories.give.invalidamount=You have to give at least 1 item. +mv-inventories.give.amounttoolarge=Cannot give more than {amount} items at once. +mv-inventories.give.invalidmaterial=Invalid Material: {material} + # Spawn command mv-inventories.spawn.teleporting=Teleporting to this world group's spawn... mv-inventories.spawn.teleportedby=You were teleported by: {player} @@ -74,6 +109,7 @@ mv-inventories.debug.set=Debug mode is set to {mode}. mv-inventories.toggle.nowusingoptional=&f{share} &6will now be considered when player's change world. mv-inventories.toggle.nownotusingoptional=&f{share} &6will no longer be considered when player's change world. mv-inventories.toggle.nooptionalshares=&f{share} &6is not an optional share! +mv-inventories.toggle.lastlocationinfo=For more information on configuring last location, please see: {url} # Group command mv-inventories.group.commandprompt=&6What would you like to do? &fCreate&6, &fEdit &6or &fDelete&6. Enter &f##&6 at any time to cancel. @@ -92,13 +128,45 @@ mv-inventories.group.updated=&2Group has been updated! mv-inventories.group.nonconversable=You are not allowed to access conversations (remote console?) mv-inventories.group.invalidoption=&cThat is not a valid option! Type &f##&c to stop working on groups. +# Bulkedit command +mv-inventories.bulkedit.summary=Summary of affected profiles: +mv-inventories.bulkedit.summaryentry=\ \ {key}: {value} +mv-inventories.bulkedit.starting=Starting bulk edit action... +mv-inventories.bulkedit.successcount=Successfully processed {count} profiles! +mv-inventories.bulkedit.failurecount=Failed to process {count} profiles! See log for details. +mv-inventories.bulkedit.completedtime=Bulk edit action completed in {milliseconds} ms. +mv-inventories.bulkedit.globalprofile.clear.confirmprompt=Are you sure you want to clear the selected global profiles? +mv-inventories.bulkedit.globalprofile.modify.confirmprompt=Are you sure you want to modify {property} to {value} for {count} players? +mv-inventories.bulkedit.globalprofile.modify.failed=Failed to modify {property} for {profile}. {error} +mv-inventories.bulkedit.globalprofile.modify.success=Successfully modified {property} to {value} for {count} players. +mv-inventories.bulkedit.playerprofile.cloneplayer.confirmprompt=Are you sure you want to clone profiles from {fromplayer} to {toplayers} for the selected groups/worlds? +mv-inventories.bulkedit.playerprofile.cloneworldgroup.samecontainer=Cannot copy profiles to the same {containertype}: {container} +mv-inventories.bulkedit.playerprofile.cloneworldgroup.confirmprompt=Are you sure you want to clone profiles from {containertype} {container} to the selected groups/worlds? +mv-inventories.bulkedit.playerprofile.clear.confirmprompt=Are you sure you want to clear the selected profiles? +mv-inventories.bulkedit.playerprofile.delete.confirmprompt=Are you sure you want to delete {share} from the selected profiles? +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.nbt.confirmprompt=Are you sure you want to migrate all player data to NBT? +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.bukkit.confirmprompt=Are you sure you want to migrate all player data to old Bukkit serialization? +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.playererror=Error updating player {player}: {error} +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.updated=Updated {count} player profiles. +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.completed=Bulk edit completed in {milliseconds} ms. +mv-inventories.bulkedit.playerprofile.migrateplayername.confirmprompt=Are you sure you want to migrate all player data for {oldname} to {newname}? This action cannot be undone. +mv-inventories.bulkedit.playerprofile.migrateplayername.failed=Failed to migrate player data for {player}. {error} + +# Playerdataimport command +mv-inventories.playerdataimport.importernotinstalled=Please install Multiverse-InventoriesImporter plugin to use this command. +mv-inventories.playerdataimport.downloadlink=Download Link: {url} +mv-inventories.playerdataimport.learnmore=Learn More: {url} + # Migrate command mv-inventories.migrate.pluginnotenabled=&f{plugin} &6is not enabled so you may not import data from it! mv-inventories.migrate.unsupportedplugin=&6Sorry, the plugin '&f{plugin}&6' is not supported for importing. +mv-inventories.migrate.importernotinstalled=Please install Multiverse-InventoriesImporter plugin to use this command. +mv-inventories.migrate.downloadlink=Download Link: {url} +mv-inventories.migrate.learnmore=Learn More: {url} mv-inventories.migrate.confirmprompt=&6Are you sure you want to import data from &f{plugin}&6? This will override existing Multiverse-Inventories playerdata!!! mv-inventories.migrate.success=&2Successfully imported data from &f{plugin}! mv-inventories.migrate.failed=Failed to import data from &f{plugin}! # Deletegroup command mv-inventories.deletegroup.confirmprompt=Are you sure you want to delete group &f{group}&6? -mv-inventories.deletegroup.success=&2Successfully deleted group: &f{group}! \ No newline at end of file +mv-inventories.deletegroup.success=&2Successfully deleted group: &f{group}! diff --git a/src/main/resources/multiverse-inventories_zh.properties b/src/main/resources/multiverse-inventories_zh.properties index b349b02f..dfa8ba8c 100644 --- a/src/main/resources/multiverse-inventories_zh.properties +++ b/src/main/resources/multiverse-inventories_zh.properties @@ -22,6 +22,7 @@ mv-inventories.error.nogroup=&c没有名为 &f{group}&6 的组 mv-inventories.error.noworld=&c没有名为 &f{world}&6 的世界 mv-inventories.error.noworldprofile=&c世界 &f{world}&6 没有配置文件 mv-inventories.error.nosharesspecified=&c你没有指定任何有效的共享! +mv-inventories.error.invalidglobalprofile=玩家的全局配置文件无效:{player} # Conflicts mv-inventories.conflict.results=&c在以下组中检测到冲突:'&6{group1}&c' 和 '&6{group2}&c',这两个组在世界 ''{worlds}'' 中都共享了: ''{shares}''。 @@ -30,6 +31,23 @@ mv-inventories.conflict.found=&c已发现冲突……如果这些冲突没有解 mv-inventories.conflict.notfound=没有发现组冲突! # Commands +# Cache Command +mv-inventories.cache.entry=&b缓存:&f{cache} +mv-inventories.cache.hitscount=\ \ &6命中次数:&f{count} +mv-inventories.cache.missescount=\ \ &6未命中次数:&f{count} +mv-inventories.cache.loadscount=\ \ &6加载次数:&f{count} +mv-inventories.cache.evictions=\ \ &6驱逐次数:&f{count} +mv-inventories.cache.hitrate=\ \ &6命中率:&f{rate}% +mv-inventories.cache.missrate=\ \ &6未命中率:&f{rate}% +mv-inventories.cache.avgloadpenalty=\ \ &6平均加载耗时:&f{milliseconds}ms +mv-inventories.cache.separator=&8-------- + +# Config Command +mv-inventories.config.currentvalue={name} 当前设置为 {value} +mv-inventories.config.showfailed={error} +mv-inventories.config.set=成功将 {name} 设置为 {value} +mv-inventories.config.setfailed=无法将 {name} 设置为 {value}。{error} + ## Info Command mv-inventories.info.world=&b===[ 世界信息:&6{world}&b ]=== mv-inventories.info.world.info=&6在组 &f {groups} 中: @@ -40,6 +58,16 @@ mv-inventories.info.group.infoshares=&b已配置的共享:&f {shares} mv-inventories.info.group.applicableshares=&b适用的共享:&f {shares} mv-inventories.info.zeroarg=你只能在游戏中使用该命令的无参数版本! +# Inventory Command +mv-inventories.inventory.loading=&e正在加载 {player} 的背包数据…… +mv-inventories.inventory.loadfailed=&c加载背包数据失败:{error} +mv-inventories.inventory.unknownloaderror=加载背包数据时发生未知错误。 +mv-inventories.inventory.liveinventory=&a正在显示 {player} 在世界 {world} 中的实时背包 +mv-inventories.inventory.storedinventory=&a正在显示 {player} 在世界 {world} 中保存的背包 +mv-inventories.inventory.nodatafound=&c找不到 {player} 在世界 {world} 中的玩家数据。请尝试检查其他世界,或确认该玩家曾进入过这个世界。 +mv-inventories.inventory.opened={status}。关闭时将保存更改。 +mv-inventories.inventory.modifyliveself=&c你不能使用此命令修改自己的实时背包。请使用你的普通背包。 + # List Command mv-inventories.list.groups=&b===[ 组列表 ]=== mv-inventories.list.groups.info=&6组: &f {groups} @@ -61,6 +89,13 @@ mv-inventories.shares.nowsharing=&6组 &f{group} &6正在共享: &f{shares} &6 # Add/remove disabled shares command mv-inventories.disabledshares.nowsharing=&6组 &f{group} &6的以下共享已禁用: &f{shares} +# Give command +mv-inventories.give.success=已在世界 {world} 中给予玩家 {player} {amount} 个 {item}。 +mv-inventories.give.failed={error} +mv-inventories.give.invalidamount=你必须至少给予 1 个物品。 +mv-inventories.give.amounttoolarge=一次不能给予超过 {amount} 个物品。 +mv-inventories.give.invalidmaterial=无效的材料:{material} + # Spawn command mv-inventories.spawn.teleporting=正在传送到当前世界组的出生点…… mv-inventories.spawn.teleportedby=你已被玩家 {player} 传送。 @@ -74,6 +109,7 @@ mv-inventories.debug.set=调试模式已设置为 {mode}。 mv-inventories.toggle.nowusingoptional=&6当玩家的世界改变时,&f{share} &6将会被考虑。 mv-inventories.toggle.nownotusingoptional=&6当玩家的世界改变时,&f{share} &6将不再被考虑。 mv-inventories.toggle.nooptionalshares=&f{share} &6 不是一个可选择的共享! +mv-inventories.toggle.lastlocationinfo=有关配置上次位置的更多信息,请参阅:{url} # Group command mv-inventories.group.commandprompt=&6你想做什么? &f创建(Create)&6, &f编辑(Edit) &6或者 &f删除(Delete)&6。 输入 &f##&6 取消当前操作。 @@ -92,9 +128,41 @@ mv-inventories.group.updated=&2组已经更新! mv-inventories.group.nonconversable=无法访问会话(远程控制台?) mv-inventories.group.invalidoption=&c这不是一个有效的选项!输入&f##&c停止处理组。 +# Bulkedit command +mv-inventories.bulkedit.summary=受影响配置文件摘要: +mv-inventories.bulkedit.summaryentry=\ \ {key}: {value} +mv-inventories.bulkedit.starting=正在开始批量编辑操作…… +mv-inventories.bulkedit.successcount=成功处理 {count} 个配置文件! +mv-inventories.bulkedit.failurecount=处理 {count} 个配置文件失败!详情请查看日志。 +mv-inventories.bulkedit.completedtime=批量编辑操作在 {milliseconds} ms 内完成。 +mv-inventories.bulkedit.globalprofile.clear.confirmprompt=你确定要清除所选全局配置文件吗? +mv-inventories.bulkedit.globalprofile.modify.confirmprompt=你确定要将 {count} 个玩家的 {property} 修改为 {value} 吗? +mv-inventories.bulkedit.globalprofile.modify.failed=无法为 {profile} 修改 {property}。{error} +mv-inventories.bulkedit.globalprofile.modify.success=成功将 {count} 个玩家的 {property} 修改为 {value}。 +mv-inventories.bulkedit.playerprofile.cloneplayer.confirmprompt=你确定要将 {fromplayer} 的配置文件克隆到 {toplayers} 的所选组/世界吗? +mv-inventories.bulkedit.playerprofile.cloneworldgroup.samecontainer=无法将配置文件复制到相同的 {containertype}:{container} +mv-inventories.bulkedit.playerprofile.cloneworldgroup.confirmprompt=你确定要从 {containertype} {container} 克隆配置文件到所选组/世界吗? +mv-inventories.bulkedit.playerprofile.clear.confirmprompt=你确定要清除所选配置文件吗? +mv-inventories.bulkedit.playerprofile.delete.confirmprompt=你确定要从所选配置文件中删除 {share} 吗? +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.nbt.confirmprompt=你确定要将所有玩家数据迁移为 NBT 吗? +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.bukkit.confirmprompt=你确定要将所有玩家数据迁移为旧版 Bukkit 序列化吗? +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.playererror=更新玩家 {player} 时出错:{error} +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.updated=已更新 {count} 个玩家配置文件。 +mv-inventories.bulkedit.playerprofile.migrateinventoryserialization.completed=批量编辑在 {milliseconds} ms 内完成。 +mv-inventories.bulkedit.playerprofile.migrateplayername.confirmprompt=你确定要将 {oldname} 的所有玩家数据迁移到 {newname} 吗?此操作无法撤销。 +mv-inventories.bulkedit.playerprofile.migrateplayername.failed=迁移 {player} 的玩家数据失败。{error} + +# Playerdataimport command +mv-inventories.playerdataimport.importernotinstalled=请安装 Multiverse-InventoriesImporter 插件以使用此命令。 +mv-inventories.playerdataimport.downloadlink=下载链接:{url} +mv-inventories.playerdataimport.learnmore=了解更多:{url} + # Migrate command mv-inventories.migrate.pluginnotenabled=&f{plugin} &6未启用,因此你可能无法从中导入数据! mv-inventories.migrate.unsupportedplugin=&6抱歉,插件 '&f{plugin}&6' 不支持导入。 +mv-inventories.migrate.importernotinstalled=请安装 Multiverse-InventoriesImporter 插件以使用此命令。 +mv-inventories.migrate.downloadlink=下载链接:{url} +mv-inventories.migrate.learnmore=了解更多:{url} mv-inventories.migrate.confirmprompt=&6你确认从 &f{plugin}&6 导入数据吗?这将覆盖 Multiverse-Inventories 中已存在的玩家数据!!! mv-inventories.migrate.success=&2成功从 &f{plugin} &2中导入数据! mv-inventories.migrate.failed=&c从 &f{plugin} &c中导入数据失败!