From 0662739fe0ab647e9770e0671881ac4397b9f796 Mon Sep 17 00:00:00 2001 From: NotEvil Date: Wed, 15 Apr 2026 13:24:05 +0200 Subject: [PATCH 1/4] =?UTF-8?q?feat(C-01):=20i18n=20SystemMessageManager?= =?UTF-8?q?=20=E2=80=94=2083=20translatable=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 1: Core system message migration to Component.translatable(). - Replace getMessageTemplate() hardcoded strings with getTranslationKey() key derivation - All send methods now use Component.translatable() with positional args - Add 83 keys to en_us.json (msg.tiedup.system.*) - Add sendTranslatable() convenience for external callers with string args - Migrate 3 external getTemplate() callers (PlayerShockCollar, CellRegistryV2) - Add resistance_suffix key for sendWithResistance() --- .../tiedup/remake/cells/CellRegistryV2.java | 8 +- .../remake/core/SystemMessageManager.java | 215 +++++++----------- .../state/components/PlayerShockCollar.java | 24 +- .../resources/assets/tiedup/lang/en_us.json | 86 ++++++- 4 files changed, 173 insertions(+), 160 deletions(-) diff --git a/src/main/java/com/tiedup/remake/cells/CellRegistryV2.java b/src/main/java/com/tiedup/remake/cells/CellRegistryV2.java index 91e4345..122baf1 100644 --- a/src/main/java/com/tiedup/remake/cells/CellRegistryV2.java +++ b/src/main/java/com/tiedup/remake/cells/CellRegistryV2.java @@ -670,13 +670,7 @@ public class CellRegistryV2 extends SavedData { if (server == null || ownerId == null) return; ServerPlayer owner = server.getPlayerList().getPlayer(ownerId); if (owner != null) { - String template = SystemMessageManager.getTemplate(category); - String formattedMessage = String.format(template, prisonerName); - SystemMessageManager.sendToPlayer( - owner, - category, - formattedMessage - ); + SystemMessageManager.sendTranslatable(owner, category, prisonerName); } } diff --git a/src/main/java/com/tiedup/remake/core/SystemMessageManager.java b/src/main/java/com/tiedup/remake/core/SystemMessageManager.java index f790e62..c36dd76 100644 --- a/src/main/java/com/tiedup/remake/core/SystemMessageManager.java +++ b/src/main/java/com/tiedup/remake/core/SystemMessageManager.java @@ -138,120 +138,17 @@ public class SystemMessageManager { ERROR, // Generic error } - // MESSAGE TEMPLATES + // TRANSLATION KEYS /** - * Get the raw message template for a category. - * Use this when you need to customize the message. + * Get the translation key for a category. + * Keys follow the pattern: msg.tiedup.system.<category_lowercase> * * @param category The message category - * @return The template string (may contain %s placeholders) + * @return The translation key (for use with Component.translatable) */ - public static String getTemplate(MessageCategory category) { - return getMessageTemplate(category); - } - - /** - * Get message template for a category. - * Use %s for entity name placeholder. - */ - private static String getMessageTemplate(MessageCategory category) { - return switch (category) { - // Restraint actions - case BEING_TIED -> "%s is tying you up!"; - case TIED_UP -> "%s tied you up, you can't move!"; - case BEING_GAGGED -> "%s is gagging you!"; - case GAGGED -> "%s gagged you, you can't speak!"; - case BEING_BLINDFOLDED -> "%s is blindfolding you!"; - case BLINDFOLDED -> "%s blindfolded you, you can't see!"; - case BEING_COLLARED -> "%s is putting a collar on you!"; - case COLLARED -> "%s collared you!"; - case EARPLUGS_ON -> "%s put earplugs on you!"; - case MITTENS_ON -> "%s put mittens on you!"; - case ENSLAVED -> "You have been enslaved by %s!"; - // Restraint actions (kidnapper's perspective) - case TYING_TARGET -> "You are tying %s..."; - case TIED_TARGET -> "You tied %s!"; - case GAGGING_TARGET -> "You are gagging %s..."; - case GAGGED_TARGET -> "You gagged %s!"; - case BLINDFOLDING_TARGET -> "You are blindfolding %s..."; - case BLINDFOLDED_TARGET -> "You blindfolded %s!"; - case COLLARING_TARGET -> "You are collaring %s..."; - case COLLARED_TARGET -> "You collared %s!"; - // Release actions - case UNTIED -> "%s untied you!"; - case UNGAGGED -> "%s removed your gag!"; - case UNBLINDFOLDED -> "%s removed your blindfold!"; - case UNCOLLARED -> "%s removed your collar!"; - case FREED -> "You have been freed!"; - // Struggle - case STRUGGLE_SUCCESS -> "You feel the ropes loosening..."; - case STRUGGLE_FAIL -> "You struggle against the ropes, but they hold tight."; - case STRUGGLE_BROKE_FREE -> "You broke free!"; - case STRUGGLE_SHOCKED -> "You were shocked for struggling!"; - case STRUGGLE_COLLAR_SUCCESS -> "You manage to damage the lock!"; - case STRUGGLE_COLLAR_FAIL -> "You try to reach the lock, but can't get a good grip."; - // Restrictions (Tied) - case CANT_MOVE -> "You can't move while tied!"; - case CANT_ATTACK_TIED -> "You can't attack while tied!"; - case CANT_USE_ITEM_TIED -> "You can't use items while tied!"; - case CANT_OPEN_INVENTORY -> "You can't open inventory while tied!"; - case CANT_INTERACT_TIED -> "You can't interact while tied!"; - case CANT_SPEAK -> "You can't speak while gagged!"; - case CANT_SEE -> "You can't see while blindfolded!"; - case CANT_BREAK_TIED -> "You can't break blocks while tied!"; - case CANT_PLACE_TIED -> "You can't place blocks while tied!"; - case NO_ELYTRA -> "You can't fly with elytra while tied!"; - // Restrictions (Mittens) - case CANT_ATTACK_MITTENS -> "You can't attack with mittens on!"; - case CANT_USE_ITEM_MITTENS -> "You can't use items with mittens on!"; - case CANT_INTERACT_MITTENS -> "You can't interact with mittens on!"; - case CANT_BREAK_MITTENS -> "You can't break blocks with mittens on!"; - case CANT_PLACE_MITTENS -> "You can't place blocks with mittens on!"; - // Slave system - case SLAVE_COMMAND -> "Your master commands: %s"; - case SLAVE_SHOCK -> "You've been shocked!"; - case GPS_ZONE_VIOLATION -> "You've been shocked! Return back to your allowed area!"; - case GPS_OWNER_ALERT -> "ALERT: %s is outside the safe zone!"; - case SLAVE_JOB_ASSIGNED -> "Job assigned: bring %s"; - case SLAVE_JOB_COMPLETE -> "Job complete! You are free."; - case SLAVE_JOB_FAILED -> "Job failed!"; - case SLAVE_JOB_LAST_CHANCE -> "LAST CHANCE! Next failure means death!"; - case SLAVE_JOB_KILLED -> "You were executed for failing your task."; - // Tighten - case BINDS_TIGHTENED -> "%s tightened your binds!"; - // Tools & Items - case KEY_CLAIMED -> "Key claimed and linked to %s!"; - case KEY_NOT_OWNER -> "You don't own this key!"; - case KEY_WRONG_TARGET -> "This key doesn't fit this collar!"; - case LOCATOR_CLAIMED -> "Locator claimed!"; - case LOCATOR_NOT_OWNER -> "You don't own this locator!"; - case LOCATOR_DETECTED -> "Target detected: %s"; - case SHOCKER_CLAIMED -> "Shocker claimed!"; - case SHOCKER_NOT_OWNER -> "You don't own this shocker!"; - case SHOCKER_MODE_SET -> "Shocker mode: %s"; - case SHOCKER_TRIGGERED -> "Shocked %s!"; - case RAG_DRY -> "The rag is dry - soak it first"; - case RAG_SOAKED -> "You soaked the rag with chloroform"; - case RAG_EVAPORATED -> "The chloroform has evaporated"; - // Bounty - case BOUNTY_CREATED -> "Bounty created on %s!"; - case BOUNTY_CLAIMED -> "You claimed the bounty on %s!"; - case BOUNTY_EXPIRED -> "Bounty on %s expired"; - // Cell System - case PRISONER_ARRIVED -> "%s has been placed in your cell"; - case PRISONER_ESCAPED -> "%s has escaped from your cell!"; - case PRISONER_RELEASED -> "%s has been released from your cell"; - case CELL_BREACH -> "Your cell wall has been breached!"; - case CELL_ASSIGNED -> "You have been assigned to %s's cell"; - case CELL_CREATED -> "Cell created successfully"; - case CELL_DELETED -> "Cell deleted"; - case CELL_RENAMED -> "Cell renamed to: %s"; - // Generic - case INFO -> "%s"; - case WARNING -> "%s"; - case ERROR -> "%s"; - }; + public static String getTranslationKey(MessageCategory category) { + return "msg.tiedup.system." + category.name().toLowerCase(); } /** @@ -373,11 +270,11 @@ public class SystemMessageManager { /** * Send a system message to a player's action bar. - * Uses category template with entity name. + * Uses translatable category with entity name as argument. * * @param player The player to send to * @param category The message category - * @param actor The entity performing the action (for %s replacement) + * @param actor The entity performing the action (for %1$s replacement) */ public static void sendToPlayer( Player player, @@ -387,14 +284,23 @@ public class SystemMessageManager { if (player == null) return; String actorName = actor != null ? getEntityName(actor) : "Someone"; - String message = String.format(getMessageTemplate(category), actorName); + MutableComponent component = Component.translatable( + getTranslationKey(category), actorName + ).withStyle(style -> style.withColor(getCategoryColor(category))); - sendToPlayer(player, message, getCategoryColor(category)); + player.displayClientMessage(component, true); + + TiedUpMod.LOGGER.debug( + "[SystemMessage] -> {}: {} ({})", + player.getName().getString(), + getTranslationKey(category), + actorName + ); } /** * Send a system message to a player's action bar. - * Uses category template without entity (for messages that don't need one). + * Uses translatable category without arguments. * * @param player The player to send to * @param category The message category @@ -402,12 +308,22 @@ public class SystemMessageManager { public static void sendToPlayer(Player player, MessageCategory category) { if (player == null) return; - String message = getMessageTemplate(category); - sendToPlayer(player, message, getCategoryColor(category)); + MutableComponent component = Component.translatable( + getTranslationKey(category) + ).withStyle(style -> style.withColor(getCategoryColor(category))); + + player.displayClientMessage(component, true); + + TiedUpMod.LOGGER.debug( + "[SystemMessage] -> {}: {}", + player.getName().getString(), + getTranslationKey(category) + ); } /** * Send a custom system message to a player's action bar. + * Uses literal text (for dynamic/non-translatable messages). * * @param player The player to send to * @param message The message to send @@ -420,12 +336,10 @@ public class SystemMessageManager { ) { if (player == null || message == null) return; - // Works on both client and server MutableComponent component = Component.literal(message).withStyle( style -> style.withColor(color) ); - // true = action bar (above hotbar), false = chat player.displayClientMessage(component, true); TiedUpMod.LOGGER.debug( @@ -437,6 +351,7 @@ public class SystemMessageManager { /** * Send a custom system message to a player's CHAT. + * Uses literal text (for dynamic/non-translatable messages). * * @param player The player to send to * @param message The message to send @@ -453,7 +368,6 @@ public class SystemMessageManager { style -> style.withColor(color) ); - // false = chat player.displayClientMessage(component, false); TiedUpMod.LOGGER.debug( @@ -464,19 +378,21 @@ public class SystemMessageManager { } /** - * Send a system message to a player's CHAT using a category. + * Send a system message to a player's CHAT using a translatable category. */ public static void sendChatToPlayer( Player player, MessageCategory category ) { if (player == null) return; - String message = getMessageTemplate(category); - sendChatToPlayer(player, message, getCategoryColor(category)); + MutableComponent component = Component.translatable( + getTranslationKey(category) + ).withStyle(style -> style.withColor(getCategoryColor(category))); + player.displayClientMessage(component, false); } /** - * Send a system message to a player's CHAT using a category and actor. + * Send a system message to a player's CHAT using a translatable category and actor. */ public static void sendChatToPlayer( Player player, @@ -485,8 +401,10 @@ public class SystemMessageManager { ) { if (player == null) return; String actorName = actor != null ? getEntityName(actor) : "Someone"; - String message = String.format(getMessageTemplate(category), actorName); - sendChatToPlayer(player, message, getCategoryColor(category)); + MutableComponent component = Component.translatable( + getTranslationKey(category), actorName + ).withStyle(style -> style.withColor(getCategoryColor(category))); + player.displayClientMessage(component, false); } /** @@ -494,7 +412,7 @@ public class SystemMessageManager { * * @param player The player to send to * @param category The category (for color) - * @param customMessage The custom message text + * @param customMessage The custom message text (literal, not translatable) */ public static void sendToPlayer( Player player, @@ -505,7 +423,27 @@ public class SystemMessageManager { } /** - * Send a message with resistance info appended. + * Send a translatable message with string arguments. + * Uses the category's translation key and color. + * + * @param player The player to send to + * @param category The message category + * @param args Arguments for the translation (replaces %1$s, %2$s, etc.) + */ + public static void sendTranslatable( + Player player, + MessageCategory category, + Object... args + ) { + if (player == null) return; + MutableComponent component = Component.translatable( + getTranslationKey(category), args + ).withStyle(style -> style.withColor(getCategoryColor(category))); + player.displayClientMessage(component, true); + } + + /** + * Send a translatable message with resistance info appended. * * @param player The player to send to * @param category The message category @@ -518,9 +456,13 @@ public class SystemMessageManager { ) { if (player == null) return; - String message = - getMessageTemplate(category) + " (Resistance: " + resistance + ")"; - sendToPlayer(player, message, getCategoryColor(category)); + MutableComponent component = Component.translatable( + getTranslationKey(category) + ).append( + Component.translatable("msg.tiedup.system.resistance_suffix", resistance) + ).withStyle(style -> style.withColor(getCategoryColor(category))); + + player.displayClientMessage(component, true); } // SEND METHODS - TO NEARBY PLAYERS @@ -695,15 +637,10 @@ public class SystemMessageManager { */ public static void sendJobAssigned(Player player, String itemName) { if (player == null) return; - String message = String.format( - getMessageTemplate(MessageCategory.SLAVE_JOB_ASSIGNED), - itemName - ); - sendToPlayer( - player, - message, - getCategoryColor(MessageCategory.SLAVE_JOB_ASSIGNED) - ); + MutableComponent component = Component.translatable( + getTranslationKey(MessageCategory.SLAVE_JOB_ASSIGNED), itemName + ).withStyle(style -> style.withColor(getCategoryColor(MessageCategory.SLAVE_JOB_ASSIGNED))); + player.displayClientMessage(component, true); } // UTILITY diff --git a/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java b/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java index 42f8b79..ceb32f5 100644 --- a/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java +++ b/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java @@ -15,6 +15,8 @@ import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; import java.util.List; import java.util.UUID; import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -99,12 +101,11 @@ public class PlayerShockCollar { // HUD Message via SystemMessageManager if (messageAddon != null) { // Custom message with addon (e.g., GPS violation) - SystemMessageManager.sendToPlayer( - player, - MessageCategory.SLAVE_SHOCK, - SystemMessageManager.getTemplate(MessageCategory.SLAVE_SHOCK) + - messageAddon - ); + MutableComponent msg = Component.translatable( + SystemMessageManager.getTranslationKey(MessageCategory.SLAVE_SHOCK) + ).append(Component.literal(messageAddon)); + msg.withStyle(style -> style.withColor(ChatFormatting.RED)); + player.displayClientMessage(msg, true); } else { SystemMessageManager.sendToPlayer( player, @@ -239,11 +240,8 @@ public class PlayerShockCollar { if (!CollarHelper.shouldWarnMasters(stack)) return; - // Format: "ALERT: is outside the safe zone!" - String alertMessage = String.format( - SystemMessageManager.getTemplate(MessageCategory.GPS_OWNER_ALERT), - player.getName().getString() - ); + // Translatable: "ALERT: is outside the safe zone!" + String playerName = player.getName().getString(); for (UUID ownerId : CollarHelper.getOwners(stack)) { ServerPlayer owner = player @@ -253,8 +251,8 @@ public class PlayerShockCollar { if (owner != null) { SystemMessageManager.sendChatToPlayer( owner, - alertMessage, - ChatFormatting.RED + MessageCategory.GPS_OWNER_ALERT, + player ); } } diff --git a/src/main/resources/assets/tiedup/lang/en_us.json b/src/main/resources/assets/tiedup/lang/en_us.json index 0069fa3..8d09396 100644 --- a/src/main/resources/assets/tiedup/lang/en_us.json +++ b/src/main/resources/assets/tiedup/lang/en_us.json @@ -687,5 +687,89 @@ "gui.tiedup.status.key_info": "Key: %s", "gui.tiedup.status.no_key": "No key", "gui.tiedup.status.target_info": "Target: %s", - "gui.tiedup.status_bar": "Status bar" + "gui.tiedup.status_bar": "Status bar", + + "msg.tiedup.system.being_tied": "%1$s is tying you up!", + "msg.tiedup.system.tied_up": "%1$s tied you up, you can't move!", + "msg.tiedup.system.being_gagged": "%1$s is gagging you!", + "msg.tiedup.system.gagged": "%1$s gagged you, you can't speak!", + "msg.tiedup.system.being_blindfolded": "%1$s is blindfolding you!", + "msg.tiedup.system.blindfolded": "%1$s blindfolded you, you can't see!", + "msg.tiedup.system.being_collared": "%1$s is putting a collar on you!", + "msg.tiedup.system.collared": "%1$s collared you!", + "msg.tiedup.system.earplugs_on": "%1$s put earplugs on you!", + "msg.tiedup.system.mittens_on": "%1$s put mittens on you!", + "msg.tiedup.system.enslaved": "You have been enslaved by %1$s!", + "msg.tiedup.system.tying_target": "You are tying %1$s...", + "msg.tiedup.system.tied_target": "You tied %1$s!", + "msg.tiedup.system.gagging_target": "You are gagging %1$s...", + "msg.tiedup.system.gagged_target": "You gagged %1$s!", + "msg.tiedup.system.blindfolding_target": "You are blindfolding %1$s...", + "msg.tiedup.system.blindfolded_target": "You blindfolded %1$s!", + "msg.tiedup.system.collaring_target": "You are collaring %1$s...", + "msg.tiedup.system.collared_target": "You collared %1$s!", + "msg.tiedup.system.untied": "%1$s untied you!", + "msg.tiedup.system.ungagged": "%1$s removed your gag!", + "msg.tiedup.system.unblindfolded": "%1$s removed your blindfold!", + "msg.tiedup.system.uncollared": "%1$s removed your collar!", + "msg.tiedup.system.freed": "You have been freed!", + "msg.tiedup.system.struggle_success": "You feel the ropes loosening...", + "msg.tiedup.system.struggle_fail": "You struggle against the ropes, but they hold tight.", + "msg.tiedup.system.struggle_broke_free": "You broke free!", + "msg.tiedup.system.struggle_shocked": "You were shocked for struggling!", + "msg.tiedup.system.struggle_collar_success": "You manage to damage the lock!", + "msg.tiedup.system.struggle_collar_fail": "You try to reach the lock, but can't get a good grip.", + "msg.tiedup.system.cant_move": "You can't move while tied!", + "msg.tiedup.system.cant_attack_tied": "You can't attack while tied!", + "msg.tiedup.system.cant_use_item_tied": "You can't use items while tied!", + "msg.tiedup.system.cant_open_inventory": "You can't open inventory while tied!", + "msg.tiedup.system.cant_interact_tied": "You can't interact while tied!", + "msg.tiedup.system.cant_speak": "You can't speak while gagged!", + "msg.tiedup.system.cant_see": "You can't see while blindfolded!", + "msg.tiedup.system.cant_break_tied": "You can't break blocks while tied!", + "msg.tiedup.system.cant_place_tied": "You can't place blocks while tied!", + "msg.tiedup.system.no_elytra": "You can't fly with elytra while tied!", + "msg.tiedup.system.cant_attack_mittens": "You can't attack with mittens on!", + "msg.tiedup.system.cant_use_item_mittens": "You can't use items with mittens on!", + "msg.tiedup.system.cant_interact_mittens": "You can't interact with mittens on!", + "msg.tiedup.system.cant_break_mittens": "You can't break blocks with mittens on!", + "msg.tiedup.system.cant_place_mittens": "You can't place blocks with mittens on!", + "msg.tiedup.system.slave_command": "Your master commands: %1$s", + "msg.tiedup.system.slave_shock": "You've been shocked!", + "msg.tiedup.system.gps_zone_violation": "You've been shocked! Return back to your allowed area!", + "msg.tiedup.system.gps_owner_alert": "ALERT: %1$s is outside the safe zone!", + "msg.tiedup.system.slave_job_assigned": "Job assigned: bring %1$s", + "msg.tiedup.system.slave_job_complete": "Job complete! You are free.", + "msg.tiedup.system.slave_job_failed": "Job failed!", + "msg.tiedup.system.slave_job_last_chance": "LAST CHANCE! Next failure means death!", + "msg.tiedup.system.slave_job_killed": "You were executed for failing your task.", + "msg.tiedup.system.binds_tightened": "%1$s tightened your binds!", + "msg.tiedup.system.key_claimed": "Key claimed and linked to %1$s!", + "msg.tiedup.system.key_not_owner": "You don't own this key!", + "msg.tiedup.system.key_wrong_target": "This key doesn't fit this collar!", + "msg.tiedup.system.locator_claimed": "Locator claimed!", + "msg.tiedup.system.locator_not_owner": "You don't own this locator!", + "msg.tiedup.system.locator_detected": "Target detected: %1$s", + "msg.tiedup.system.shocker_claimed": "Shocker claimed!", + "msg.tiedup.system.shocker_not_owner": "You don't own this shocker!", + "msg.tiedup.system.shocker_mode_set": "Shocker mode: %1$s", + "msg.tiedup.system.shocker_triggered": "Shocked %1$s!", + "msg.tiedup.system.rag_dry": "The rag is dry - soak it first", + "msg.tiedup.system.rag_soaked": "You soaked the rag with chloroform", + "msg.tiedup.system.rag_evaporated": "The chloroform has evaporated", + "msg.tiedup.system.bounty_created": "Bounty created on %1$s!", + "msg.tiedup.system.bounty_claimed": "You claimed the bounty on %1$s!", + "msg.tiedup.system.bounty_expired": "Bounty on %1$s expired", + "msg.tiedup.system.prisoner_arrived": "%1$s has been placed in your cell", + "msg.tiedup.system.prisoner_escaped": "%1$s has escaped from your cell!", + "msg.tiedup.system.prisoner_released": "%1$s has been released from your cell", + "msg.tiedup.system.cell_breach": "Your cell wall has been breached!", + "msg.tiedup.system.cell_assigned": "You have been assigned to %1$s's cell", + "msg.tiedup.system.cell_created": "Cell created successfully", + "msg.tiedup.system.cell_deleted": "Cell deleted", + "msg.tiedup.system.cell_renamed": "Cell renamed to: %1$s", + "msg.tiedup.system.info": "%1$s", + "msg.tiedup.system.warning": "%1$s", + "msg.tiedup.system.error": "%1$s", + "msg.tiedup.system.resistance_suffix": " (Resistance: %1$s)" } -- 2.49.1 From 70965c2dda1a865dc741a12414fc141f15197ae0 Mon Sep 17 00:00:00 2001 From: NotEvil Date: Wed, 15 Apr 2026 13:28:02 +0200 Subject: [PATCH 2/4] =?UTF-8?q?feat(C-01):=20i18n=20subcommands=20?= =?UTF-8?q?=E2=80=94=2033=20translatable=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 2: Migrate all Component.literal() in 5 subcommand files. - BindCommands, GagCommands, BlindfoldCommands, CollarCommands, AccessoryCommands - Strip \u00a7a section signs, use .withStyle(ChatFormatting.GREEN) - Add 33 keys to en_us.json (command.tiedup.*) - Shared error key: command.tiedup.error.no_state --- .../subcommands/AccessoryCommands.java | 118 ++++++++---------- .../commands/subcommands/BindCommands.java | 35 +++--- .../subcommands/BlindfoldCommands.java | 35 +++--- .../commands/subcommands/CollarCommands.java | 62 +++++---- .../commands/subcommands/GagCommands.java | 34 ++--- .../resources/assets/tiedup/lang/en_us.json | 41 +++++- 6 files changed, 175 insertions(+), 150 deletions(-) diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/AccessoryCommands.java b/src/main/java/com/tiedup/remake/commands/subcommands/AccessoryCommands.java index 2f0a851..1242a80 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/AccessoryCommands.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/AccessoryCommands.java @@ -11,6 +11,7 @@ import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.v2.bondage.CollarHelper; import com.tiedup.remake.core.SystemMessageManager; import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; +import net.minecraft.ChatFormatting; import net.minecraft.resources.ResourceLocation; import com.tiedup.remake.state.PlayerBindState; import net.minecraft.commands.CommandSourceStack; @@ -111,7 +112,7 @@ public class AccessoryCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -119,9 +120,9 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " already has earplugs" + Component.translatable( + "command.tiedup.accessory.already_earplugs", + targetPlayer.getName().getString() ) ); return 0; @@ -135,11 +136,10 @@ public class AccessoryCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been given earplugs" - ), + Component.translatable( + "command.tiedup.accessory.earplugs_on", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToTarget( @@ -159,7 +159,7 @@ public class AccessoryCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -167,9 +167,9 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " does not have earplugs" + Component.translatable( + "command.tiedup.accessory.no_earplugs", + targetPlayer.getName().getString() ) ); return 0; @@ -182,11 +182,10 @@ public class AccessoryCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - "'s earplugs have been removed" - ), + Component.translatable( + "command.tiedup.accessory.earplugs_removed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToPlayer( @@ -206,7 +205,7 @@ public class AccessoryCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -214,9 +213,9 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " already has clothes" + Component.translatable( + "command.tiedup.accessory.already_clothes", + targetPlayer.getName().getString() ) ); return 0; @@ -230,11 +229,10 @@ public class AccessoryCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been given clothes" - ), + Component.translatable( + "command.tiedup.accessory.clothes_on", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); @@ -249,7 +247,7 @@ public class AccessoryCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -257,9 +255,9 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is not wearing clothes" + Component.translatable( + "command.tiedup.accessory.no_clothes", + targetPlayer.getName().getString() ) ); return 0; @@ -276,10 +274,10 @@ public class AccessoryCommands { .getSource() .sendSuccess( () -> - Component.literal( - "Removed clothes from " + - targetPlayer.getName().getString() - ), + Component.translatable( + "command.tiedup.accessory.clothes_removed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -293,7 +291,7 @@ public class AccessoryCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -338,9 +336,9 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is already fully restrained" + Component.translatable( + "command.tiedup.accessory.already_restrained", + targetPlayer.getName().getString() ) ); return 0; @@ -353,13 +351,11 @@ public class AccessoryCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been fully restrained (" + - finalApplied + - " items applied)" - ), + Component.translatable( + "command.tiedup.accessory.fully_restrained", + targetPlayer.getName().getString(), + finalApplied + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToPlayer( @@ -381,7 +377,7 @@ public class AccessoryCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -416,9 +412,7 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - "Invalid type. Use: gag, blindfold, or all" - ) + Component.translatable("command.tiedup.accessory.adjust_invalid_type") ); return 0; } @@ -427,11 +421,10 @@ public class AccessoryCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " has no " + - type + - " to adjust" + Component.translatable( + "command.tiedup.accessory.nothing_to_adjust", + targetPlayer.getName().getString(), + type ) ); return 0; @@ -451,15 +444,12 @@ public class AccessoryCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7aAdjusted " + - items + - " for " + - targetPlayer.getName().getString() + - " to " + - valueStr + - " pixels" - ), + Component.translatable( + "command.tiedup.accessory.adjusted", + items, + targetPlayer.getName().getString(), + valueStr + ).withStyle(ChatFormatting.GREEN), true ); diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/BindCommands.java b/src/main/java/com/tiedup/remake/commands/subcommands/BindCommands.java index f8d897c..b128bf2 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/BindCommands.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/BindCommands.java @@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.core.SystemMessageManager; import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; +import net.minecraft.ChatFormatting; import net.minecraft.resources.ResourceLocation; import com.tiedup.remake.state.PlayerBindState; import net.minecraft.commands.CommandSourceStack; @@ -51,7 +52,7 @@ public class BindCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -59,9 +60,9 @@ public class BindCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is already tied up" + Component.translatable( + "command.tiedup.bind.already_tied", + targetPlayer.getName().getString() ) ); return 0; @@ -76,11 +77,10 @@ public class BindCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been tied up" - ), + Component.translatable( + "command.tiedup.bind.tied", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendTiedUp( @@ -99,7 +99,7 @@ public class BindCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -112,9 +112,9 @@ public class BindCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is not restrained" + Component.translatable( + "command.tiedup.bind.not_restrained", + targetPlayer.getName().getString() ) ); return 0; @@ -149,11 +149,10 @@ public class BindCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been freed from all restraints" - ), + Component.translatable( + "command.tiedup.bind.freed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendFreed(targetPlayer); diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/BlindfoldCommands.java b/src/main/java/com/tiedup/remake/commands/subcommands/BlindfoldCommands.java index 44d297b..0777f31 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/BlindfoldCommands.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/BlindfoldCommands.java @@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.core.SystemMessageManager; import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; +import net.minecraft.ChatFormatting; import net.minecraft.resources.ResourceLocation; import com.tiedup.remake.state.PlayerBindState; import net.minecraft.commands.CommandSourceStack; @@ -51,7 +52,7 @@ public class BlindfoldCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -59,9 +60,9 @@ public class BlindfoldCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is already blindfolded" + Component.translatable( + "command.tiedup.blindfold.already_blindfolded", + targetPlayer.getName().getString() ) ); return 0; @@ -76,11 +77,10 @@ public class BlindfoldCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been blindfolded" - ), + Component.translatable( + "command.tiedup.blindfold.blindfolded", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToTarget( @@ -100,7 +100,7 @@ public class BlindfoldCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -108,9 +108,9 @@ public class BlindfoldCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is not blindfolded" + Component.translatable( + "command.tiedup.blindfold.not_blindfolded", + targetPlayer.getName().getString() ) ); return 0; @@ -123,11 +123,10 @@ public class BlindfoldCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - "'s blindfold has been removed" - ), + Component.translatable( + "command.tiedup.blindfold.removed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToTarget( diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/CollarCommands.java b/src/main/java/com/tiedup/remake/commands/subcommands/CollarCommands.java index d83682d..5eb2272 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/CollarCommands.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/CollarCommands.java @@ -9,6 +9,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.core.SystemMessageManager; import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; +import net.minecraft.ChatFormatting; import net.minecraft.resources.ResourceLocation; import com.tiedup.remake.state.PlayerBindState; import net.minecraft.commands.CommandSourceStack; @@ -76,7 +77,7 @@ public class CollarCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -84,9 +85,9 @@ public class CollarCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " already has a collar" + Component.translatable( + "command.tiedup.collar.already_collared", + targetPlayer.getName().getString() ) ); return 0; @@ -106,11 +107,10 @@ public class CollarCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been collared" - ), + Component.translatable( + "command.tiedup.collar.collared", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToTarget( @@ -130,7 +130,7 @@ public class CollarCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -138,9 +138,9 @@ public class CollarCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " does not have a collar" + Component.translatable( + "command.tiedup.collar.no_collar", + targetPlayer.getName().getString() ) ); return 0; @@ -153,11 +153,10 @@ public class CollarCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - "'s collar has been removed" - ), + Component.translatable( + "command.tiedup.collar.removed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToTarget( @@ -177,7 +176,7 @@ public class CollarCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -222,11 +221,10 @@ public class CollarCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been enslaved" - ), + Component.translatable( + "command.tiedup.collar.enslaved", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendEnslaved( @@ -245,7 +243,7 @@ public class CollarCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -253,8 +251,9 @@ public class CollarCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + " is not captured" + Component.translatable( + "command.tiedup.collar.not_captured", + targetPlayer.getName().getString() ) ); return 0; @@ -273,11 +272,10 @@ public class CollarCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been freed from slavery" - ), + Component.translatable( + "command.tiedup.collar.freed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendFreed(targetPlayer); diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/GagCommands.java b/src/main/java/com/tiedup/remake/commands/subcommands/GagCommands.java index 2f3a2ef..20f5d33 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/GagCommands.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/GagCommands.java @@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.core.SystemMessageManager; import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; +import net.minecraft.ChatFormatting; import net.minecraft.resources.ResourceLocation; import com.tiedup.remake.state.PlayerBindState; import net.minecraft.commands.CommandSourceStack; @@ -51,7 +52,7 @@ public class GagCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -59,9 +60,9 @@ public class GagCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " is already gagged" + Component.translatable( + "command.tiedup.gag.already_gagged", + targetPlayer.getName().getString() ) ); return 0; @@ -76,11 +77,10 @@ public class GagCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - " has been gagged" - ), + Component.translatable( + "command.tiedup.gag.gagged", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendGagged( @@ -99,7 +99,7 @@ public class GagCommands { if (state == null) { context .getSource() - .sendFailure(Component.literal("Failed to get player state")); + .sendFailure(Component.translatable("command.tiedup.error.no_state")); return 0; } @@ -107,8 +107,9 @@ public class GagCommands { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + " is not gagged" + Component.translatable( + "command.tiedup.gag.not_gagged", + targetPlayer.getName().getString() ) ); return 0; @@ -121,11 +122,10 @@ public class GagCommands { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7a" + - targetPlayer.getName().getString() + - "'s gag has been removed" - ), + Component.translatable( + "command.tiedup.gag.removed", + targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToTarget( diff --git a/src/main/resources/assets/tiedup/lang/en_us.json b/src/main/resources/assets/tiedup/lang/en_us.json index 8d09396..a49fe2c 100644 --- a/src/main/resources/assets/tiedup/lang/en_us.json +++ b/src/main/resources/assets/tiedup/lang/en_us.json @@ -771,5 +771,44 @@ "msg.tiedup.system.info": "%1$s", "msg.tiedup.system.warning": "%1$s", "msg.tiedup.system.error": "%1$s", - "msg.tiedup.system.resistance_suffix": " (Resistance: %1$s)" + "msg.tiedup.system.resistance_suffix": " (Resistance: %1$s)", + + "command.tiedup.error.no_state": "Failed to get player state", + + "command.tiedup.bind.already_tied": "%1$s is already tied up", + "command.tiedup.bind.tied": "%1$s has been tied up", + "command.tiedup.bind.not_restrained": "%1$s is not restrained", + "command.tiedup.bind.freed": "%1$s has been freed from all restraints", + + "command.tiedup.gag.already_gagged": "%1$s is already gagged", + "command.tiedup.gag.gagged": "%1$s has been gagged", + "command.tiedup.gag.not_gagged": "%1$s is not gagged", + "command.tiedup.gag.removed": "%1$s's gag has been removed", + + "command.tiedup.blindfold.already_blindfolded": "%1$s is already blindfolded", + "command.tiedup.blindfold.blindfolded": "%1$s has been blindfolded", + "command.tiedup.blindfold.not_blindfolded": "%1$s is not blindfolded", + "command.tiedup.blindfold.removed": "%1$s's blindfold has been removed", + + "command.tiedup.collar.already_collared": "%1$s already has a collar", + "command.tiedup.collar.collared": "%1$s has been collared", + "command.tiedup.collar.no_collar": "%1$s does not have a collar", + "command.tiedup.collar.removed": "%1$s's collar has been removed", + "command.tiedup.collar.enslaved": "%1$s has been enslaved", + "command.tiedup.collar.not_captured": "%1$s is not captured", + "command.tiedup.collar.freed": "%1$s has been freed from slavery", + + "command.tiedup.accessory.already_earplugs": "%1$s already has earplugs", + "command.tiedup.accessory.earplugs_on": "%1$s has been given earplugs", + "command.tiedup.accessory.no_earplugs": "%1$s does not have earplugs", + "command.tiedup.accessory.earplugs_removed": "%1$s's earplugs have been removed", + "command.tiedup.accessory.already_clothes": "%1$s already has clothes", + "command.tiedup.accessory.clothes_on": "%1$s has been given clothes", + "command.tiedup.accessory.no_clothes": "%1$s is not wearing clothes", + "command.tiedup.accessory.clothes_removed": "Removed clothes from %1$s", + "command.tiedup.accessory.already_restrained": "%1$s is already fully restrained", + "command.tiedup.accessory.fully_restrained": "%1$s has been fully restrained (%2$s items applied)", + "command.tiedup.accessory.adjust_invalid_type": "Invalid type. Use: gag, blindfold, or all", + "command.tiedup.accessory.nothing_to_adjust": "%1$s has no %2$s to adjust", + "command.tiedup.accessory.adjusted": "Adjusted %1$s for %2$s to %3$s pixels" } -- 2.49.1 From fa5cfb913c8710501bd813ac89be3117b4e6fd01 Mon Sep 17 00:00:00 2001 From: NotEvil Date: Wed, 15 Apr 2026 13:54:26 +0200 Subject: [PATCH 3/4] =?UTF-8?q?feat(C-01):=20i18n=20main=20commands=20?= =?UTF-8?q?=E2=80=94=20148=20translatable=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 3: Migrate Component.literal() in all remaining command files. - NPCCommand (34), CellCommand (33), SocialCommand (16), CollarCommand (25), KeyCommand (18), BountyCommand (6), KidnapSetCommand (2), CaptivityDebugCommand (7), InventorySubCommand (3), TestAnimSubCommand (2), MasterTestSubCommand (7), DebtSubCommand (8) - Strip all section sign color codes, use .withStyle(ChatFormatting) - 148 new keys in en_us.json (command.tiedup.*) - Debug/dynamic strings intentionally kept as literal --- .../tiedup/remake/commands/BountyCommand.java | 30 ++-- .../commands/CaptivityDebugCommand.java | 36 ++-- .../tiedup/remake/commands/CellCommand.java | 148 +++++++---------- .../tiedup/remake/commands/CollarCommand.java | 152 +++++++---------- .../tiedup/remake/commands/CommandHelper.java | 2 +- .../tiedup/remake/commands/KeyCommand.java | 57 +++---- .../remake/commands/KidnapSetCommand.java | 19 +-- .../tiedup/remake/commands/NPCCommand.java | 148 ++++++++--------- .../tiedup/remake/commands/SocialCommand.java | 58 +++---- .../commands/subcommands/DebtSubCommand.java | 69 +++----- .../subcommands/InventorySubCommand.java | 18 +- .../subcommands/MasterTestSubCommand.java | 26 ++- .../subcommands/TestAnimSubCommand.java | 6 +- .../resources/assets/tiedup/lang/en_us.json | 154 +++++++++++++++++- 14 files changed, 478 insertions(+), 445 deletions(-) diff --git a/src/main/java/com/tiedup/remake/commands/BountyCommand.java b/src/main/java/com/tiedup/remake/commands/BountyCommand.java index 7a9dc66..7dc2a9b 100644 --- a/src/main/java/com/tiedup/remake/commands/BountyCommand.java +++ b/src/main/java/com/tiedup/remake/commands/BountyCommand.java @@ -69,8 +69,8 @@ public class BountyCommand { // Cannot bounty yourself if (player.getUUID().equals(target.getUUID())) { source.sendFailure( - Component.literal( - "You cannot put a bounty on yourself!" + Component.translatable( + "command.tiedup.bounty.cannot_self" ).withStyle(ChatFormatting.RED) ); return 0; @@ -80,8 +80,8 @@ public class BountyCommand { IBondageState playerState = KidnappedHelper.getKidnappedState(player); if (playerState != null && playerState.isTiedUp()) { source.sendFailure( - Component.literal( - "You cannot create bounties while tied up!" + Component.translatable( + "command.tiedup.bounty.tied_up" ).withStyle(ChatFormatting.RED) ); return 0; @@ -96,8 +96,8 @@ public class BountyCommand { player.serverLevel().getGameRules() ); source.sendFailure( - Component.literal( - "Maximum number (" + max + ") of active bounties reached!" + Component.translatable( + "command.tiedup.bounty.max_reached", max ).withStyle(ChatFormatting.RED) ); return 0; @@ -107,8 +107,8 @@ public class BountyCommand { ItemStack heldItem = player.getMainHandItem(); if (heldItem.isEmpty()) { source.sendFailure( - Component.literal( - "You must hold an item as the reward!" + Component.translatable( + "command.tiedup.bounty.must_hold_item" ).withStyle(ChatFormatting.RED) ); return 0; @@ -143,8 +143,8 @@ public class BountyCommand { // Notify player source.sendSuccess( () -> - Component.literal( - "Bounty created on " + target.getName().getString() + "!" + Component.translatable( + "command.tiedup.bounty.created", target.getName().getString() ).withStyle(ChatFormatting.GREEN), false ); @@ -153,12 +153,10 @@ public class BountyCommand { player.server .getPlayerList() .broadcastSystemMessage( - Component.literal( - "[Bounty] " + - player.getName().getString() + - " has put a bounty on " + - target.getName().getString() + - "!" + Component.translatable( + "command.tiedup.bounty.broadcast", + player.getName().getString(), + target.getName().getString() ).withStyle(ChatFormatting.GOLD), false ); diff --git a/src/main/java/com/tiedup/remake/commands/CaptivityDebugCommand.java b/src/main/java/com/tiedup/remake/commands/CaptivityDebugCommand.java index 01e517d..4f3b02d 100644 --- a/src/main/java/com/tiedup/remake/commands/CaptivityDebugCommand.java +++ b/src/main/java/com/tiedup/remake/commands/CaptivityDebugCommand.java @@ -117,9 +117,9 @@ public class CaptivityDebugCommand { .getSource() .sendSuccess( () -> - Component.literal( - "=== Captivity Debug Info ===\n" + debugInfo - ).withStyle(ChatFormatting.YELLOW), + Component.translatable( + "command.tiedup.debug.prisoner_header" + ).append(Component.literal("\n" + debugInfo)).withStyle(ChatFormatting.YELLOW), false ); @@ -128,7 +128,7 @@ public class CaptivityDebugCommand { ctx .getSource() .sendFailure( - Component.literal("Error: " + e.getMessage()).withStyle( + Component.translatable("command.tiedup.debug.error", e.getMessage()).withStyle( ChatFormatting.RED ) ); @@ -149,8 +149,8 @@ public class CaptivityDebugCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Checking captivity system..." + Component.translatable( + "command.tiedup.debug.validate_checking" ).withStyle(ChatFormatting.YELLOW), true ); @@ -163,9 +163,7 @@ public class CaptivityDebugCommand { .getSource() .sendSuccess( () -> - Component.literal(debugInfo).withStyle( - ChatFormatting.GREEN - ), + Component.literal(debugInfo).withStyle(ChatFormatting.GREEN), true ); @@ -174,8 +172,8 @@ public class CaptivityDebugCommand { ctx .getSource() .sendFailure( - Component.literal( - "Error during validation: " + e.getMessage() + Component.translatable( + "command.tiedup.debug.error", e.getMessage() ).withStyle(ChatFormatting.RED) ); return 0; // Failure @@ -193,8 +191,8 @@ public class CaptivityDebugCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Repair functionality has been simplified with the new PrisonerManager system." + Component.translatable( + "command.tiedup.debug.repair_simplified" ).withStyle(ChatFormatting.YELLOW), true ); @@ -203,8 +201,8 @@ public class CaptivityDebugCommand { .getSource() .sendSuccess( () -> - Component.literal( - "The new system maintains consistency automatically." + Component.translatable( + "command.tiedup.debug.repair_auto" ).withStyle(ChatFormatting.GREEN), true ); @@ -214,7 +212,7 @@ public class CaptivityDebugCommand { ctx .getSource() .sendFailure( - Component.literal("Error: " + e.getMessage()).withStyle( + Component.translatable("command.tiedup.debug.error", e.getMessage()).withStyle( ChatFormatting.RED ) ); @@ -251,8 +249,8 @@ public class CaptivityDebugCommand { ctx .getSource() .sendFailure( - Component.literal( - "No camp found with ID prefix: " + campIdPrefix + Component.translatable( + "command.tiedup.debug.camp_not_found", campIdPrefix ).withStyle(ChatFormatting.RED) ); return 0; @@ -322,7 +320,7 @@ public class CaptivityDebugCommand { ctx .getSource() .sendFailure( - Component.literal("Error: " + e.getMessage()).withStyle( + Component.translatable("command.tiedup.debug.error", e.getMessage()).withStyle( ChatFormatting.RED ) ); diff --git a/src/main/java/com/tiedup/remake/commands/CellCommand.java b/src/main/java/com/tiedup/remake/commands/CellCommand.java index 71caac3..6772765 100644 --- a/src/main/java/com/tiedup/remake/commands/CellCommand.java +++ b/src/main/java/com/tiedup/remake/commands/CellCommand.java @@ -12,6 +12,7 @@ import com.tiedup.remake.items.ItemAdminWand; import java.util.Collection; import java.util.List; import java.util.UUID; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.EntityArgument; @@ -110,7 +111,7 @@ public class CellCommand { // Must be a player if (!(source.getEntity() instanceof ServerPlayer player)) { - source.sendFailure(Component.literal("Must be a player")); + source.sendFailure(Component.translatable("command.tiedup.error.must_be_player")); return 0; } @@ -121,9 +122,7 @@ public class CellCommand { UUID selectedCellId = getSelectedCellFromWand(player); if (selectedCellId == null) { source.sendFailure( - Component.literal( - "No cell selected. Use the Admin Wand on a Cell Core first." - ) + Component.translatable("command.tiedup.cell.no_selection") ); return 0; } @@ -131,7 +130,7 @@ public class CellCommand { CellDataV2 cell = registry.getCell(selectedCellId); if (cell == null) { source.sendFailure( - Component.literal("Selected cell no longer exists") + Component.translatable("command.tiedup.cell.no_longer_exists") ); return 0; } @@ -142,7 +141,7 @@ public class CellCommand { existingCell != null && !existingCell.getId().equals(selectedCellId) ) { source.sendFailure( - Component.literal("Cell name '" + name + "' already exists") + Component.translatable("command.tiedup.cell.name_exists", name) ); return 0; } @@ -161,9 +160,7 @@ public class CellCommand { source.sendSuccess( () -> - Component.literal( - "Named cell '" + name + "' and linked to you" - ), + Component.translatable("command.tiedup.cell.named", name).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -182,20 +179,20 @@ public class CellCommand { Collection cells = registry.getAllCells(); if (cells.isEmpty()) { source.sendSuccess( - () -> Component.literal("No cells registered"), + () -> Component.translatable("command.tiedup.cell.none_registered"), false ); return 1; } source.sendSuccess( - () -> Component.literal("=== Cells (" + cells.size() + ") ==="), + () -> Component.translatable("command.tiedup.cell.list_header", cells.size()).withStyle(ChatFormatting.GOLD), false ); for (CellDataV2 cell : cells) { String info = formatCellInfo(cell, serverLevel); - source.sendSuccess(() -> Component.literal(info), false); + source.sendSuccess(() -> Component.literal(info).withStyle(ChatFormatting.GRAY), false); } return 1; @@ -217,9 +214,7 @@ public class CellCommand { if (cells.isEmpty()) { source.sendSuccess( () -> - Component.literal( - owner.getName().getString() + " has no cells" - ), + Component.translatable("command.tiedup.cell.no_cells_for_owner", owner.getName().getString()), false ); return 1; @@ -227,19 +222,17 @@ public class CellCommand { source.sendSuccess( () -> - Component.literal( - "=== Cells owned by " + - owner.getName().getString() + - " (" + - cells.size() + - ") ===" - ), + Component.translatable( + "command.tiedup.cell.list_owner_header", + owner.getName().getString(), + cells.size() + ).withStyle(ChatFormatting.GOLD), false ); for (CellDataV2 cell : cells) { String info = formatCellInfo(cell, serverLevel); - source.sendSuccess(() -> Component.literal(info), false); + source.sendSuccess(() -> Component.literal(info).withStyle(ChatFormatting.GRAY), false); } return 1; @@ -257,7 +250,7 @@ public class CellCommand { // Must be a player if (!(source.getEntity() instanceof ServerPlayer player)) { - source.sendFailure(Component.literal("Must be a player")); + source.sendFailure(Component.translatable("command.tiedup.error.must_be_player")); return 0; } @@ -267,9 +260,7 @@ public class CellCommand { UUID selectedCellId = getSelectedCellFromWand(player); if (selectedCellId == null) { source.sendFailure( - Component.literal( - "No cell selected. Use the Admin Wand on a Cell Core first." - ) + Component.translatable("command.tiedup.cell.no_selection") ); return 0; } @@ -277,7 +268,7 @@ public class CellCommand { CellDataV2 cell = registry.getCell(selectedCellId); if (cell == null) { source.sendFailure( - Component.literal("Selected cell no longer exists") + Component.translatable("command.tiedup.cell.no_longer_exists") ); return 0; } @@ -300,7 +291,7 @@ public class CellCommand { CellDataV2 cell = registry.getCellByName(name); if (cell == null) { source.sendFailure( - Component.literal("Cell '" + name + "' not found") + Component.translatable("command.tiedup.cell.not_found", name) ); return 0; } @@ -321,7 +312,7 @@ public class CellCommand { // Must be a player if (!(source.getEntity() instanceof ServerPlayer player)) { - source.sendFailure(Component.literal("Must be a player")); + source.sendFailure(Component.translatable("command.tiedup.error.must_be_player")); return 0; } @@ -331,9 +322,7 @@ public class CellCommand { UUID selectedCellId = getSelectedCellFromWand(player); if (selectedCellId == null) { source.sendFailure( - Component.literal( - "No cell selected. Use the Admin Wand on a Cell Core first." - ) + Component.translatable("command.tiedup.cell.no_selection") ); return 0; } @@ -341,7 +330,7 @@ public class CellCommand { CellDataV2 cell = registry.getCell(selectedCellId); if (cell == null) { source.sendFailure( - Component.literal("Selected cell no longer exists") + Component.translatable("command.tiedup.cell.no_longer_exists") ); return 0; } @@ -365,7 +354,7 @@ public class CellCommand { } source.sendSuccess( - () -> Component.literal("Deleted cell '" + cellName + "'"), + () -> Component.translatable("command.tiedup.cell.deleted", cellName).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -438,24 +427,16 @@ public class CellCommand { source.sendSuccess( () -> - Component.literal( - "Reset " + - finalResetCount + - " spawn markers (found " + - finalSpawnMarkerCount + - " total spawn markers in " + - radius + - " block radius)" - ), + Component.translatable( + "command.tiedup.cell.reset_spawns", finalResetCount, finalSpawnMarkerCount, radius + ).withStyle(ChatFormatting.GREEN), true ); if (resetCount > 0) { source.sendSuccess( () -> - Component.literal( - "You can now save the structure - NPCs will spawn when it's placed." - ), + Component.translatable("command.tiedup.cell.reset_spawns_hint").withStyle(ChatFormatting.GRAY), false ); } @@ -541,25 +522,25 @@ public class CellCommand { String nameDisplay = cell.getName() != null ? cell.getName() : "(unnamed)"; source.sendSuccess( - () -> Component.literal("=== Cell: " + nameDisplay + " ==="), + () -> Component.translatable("command.tiedup.cell.info_header", nameDisplay).withStyle(ChatFormatting.GOLD), false ); source.sendSuccess( - () -> Component.literal("ID: " + cell.getId().toString()), + () -> Component.translatable("command.tiedup.cell.info_id", cell.getId().toString()).withStyle(ChatFormatting.GRAY), false ); source.sendSuccess( - () -> Component.literal("State: " + cell.getState()), + () -> Component.translatable("command.tiedup.cell.info_state", cell.getState().toString()).withStyle(ChatFormatting.GRAY), false ); source.sendSuccess( () -> - Component.literal( - "Core Position: " + cell.getCorePos().toShortString() - ), + Component.translatable( + "command.tiedup.cell.info_core_pos", cell.getCorePos().toShortString() + ).withStyle(ChatFormatting.GRAY), false ); @@ -567,9 +548,9 @@ public class CellCommand { if (cell.getSpawnPoint() != null) { source.sendSuccess( () -> - Component.literal( - "Spawn Point: " + cell.getSpawnPoint().toShortString() - ), + Component.translatable( + "command.tiedup.cell.info_spawn_point", cell.getSpawnPoint().toShortString() + ).withStyle(ChatFormatting.GRAY), false ); } @@ -584,18 +565,16 @@ public class CellCommand { owner != null ? owner.getName().getString() : "(offline)"; source.sendSuccess( () -> - Component.literal( - "Owner: " + - ownerName + - " (" + - cell.getOwnerId().toString().substring(0, 8) + - "...)" - ), + Component.translatable( + "command.tiedup.cell.info_owner", + ownerName, + cell.getOwnerId().toString().substring(0, 8) + "..." + ).withStyle(ChatFormatting.GRAY), false ); } else { source.sendSuccess( - () -> Component.literal("Owner: (world-generated)"), + () -> Component.translatable("command.tiedup.cell.info_owner_world").withStyle(ChatFormatting.GRAY), false ); } @@ -603,16 +582,16 @@ public class CellCommand { // Geometry source.sendSuccess( () -> - Component.literal( - "Interior blocks: " + cell.getInteriorBlocks().size() - ), + Component.translatable( + "command.tiedup.cell.info_interior", cell.getInteriorBlocks().size() + ).withStyle(ChatFormatting.GRAY), false ); source.sendSuccess( () -> - Component.literal( - "Wall blocks: " + cell.getWallBlocks().size() - ), + Component.translatable( + "command.tiedup.cell.info_walls", cell.getWallBlocks().size() + ).withStyle(ChatFormatting.GRAY), false ); @@ -620,16 +599,11 @@ public class CellCommand { if (!cell.getBreachedPositions().isEmpty()) { source.sendSuccess( () -> - Component.literal( - "Breaches: " + - cell.getBreachedPositions().size() + - " (" + - String.format( - "%.1f", - cell.getBreachPercentage() * 100 - ) + - "%)" - ), + Component.translatable( + "command.tiedup.cell.info_breaches", + cell.getBreachedPositions().size(), + String.format("%.1f", cell.getBreachPercentage() * 100) + ).withStyle(ChatFormatting.RED), false ); } @@ -637,19 +611,19 @@ public class CellCommand { // Features if (!cell.getBeds().isEmpty()) { source.sendSuccess( - () -> Component.literal("Beds: " + cell.getBeds().size()), + () -> Component.translatable("command.tiedup.cell.info_beds", cell.getBeds().size()).withStyle(ChatFormatting.GRAY), false ); } if (!cell.getAnchors().isEmpty()) { source.sendSuccess( - () -> Component.literal("Anchors: " + cell.getAnchors().size()), + () -> Component.translatable("command.tiedup.cell.info_anchors", cell.getAnchors().size()).withStyle(ChatFormatting.GRAY), false ); } if (!cell.getDoors().isEmpty()) { source.sendSuccess( - () -> Component.literal("Doors: " + cell.getDoors().size()), + () -> Component.translatable("command.tiedup.cell.info_doors", cell.getDoors().size()).withStyle(ChatFormatting.GRAY), false ); } @@ -657,9 +631,9 @@ public class CellCommand { // Prisoners source.sendSuccess( () -> - Component.literal( - "Prisoners: " + cell.getPrisonerCount() + "/4" - ), + Component.translatable( + "command.tiedup.cell.info_prisoners", cell.getPrisonerCount() + ).withStyle(ChatFormatting.GRAY), false ); for (UUID prisonerId : cell.getPrisonerIds()) { @@ -670,7 +644,7 @@ public class CellCommand { String prisonerName = prisoner != null ? prisoner.getName().getString() : "(offline)"; source.sendSuccess( - () -> Component.literal(" - " + prisonerName), + () -> Component.literal(" - " + prisonerName).withStyle(ChatFormatting.GRAY), false ); } diff --git a/src/main/java/com/tiedup/remake/commands/CollarCommand.java b/src/main/java/com/tiedup/remake/commands/CollarCommand.java index 7384090..97a5e4e 100644 --- a/src/main/java/com/tiedup/remake/commands/CollarCommand.java +++ b/src/main/java/com/tiedup/remake/commands/CollarCommand.java @@ -12,6 +12,7 @@ import com.tiedup.remake.v2.bondage.CollarHelper; import com.tiedup.remake.util.teleport.Position; import com.tiedup.remake.util.teleport.TeleportHelper; import com.tiedup.remake.v2.BodyRegionV2; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.EntityArgument; @@ -152,9 +153,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -164,18 +163,16 @@ public class CollarCommand { CollarHelper.addOwner(collar, executor); source.sendSuccess( () -> - Component.literal( - "§aClaimed " + - target.getName().getString() + - "'s collar" - ), + Component.translatable( + "command.tiedup.collar_cmd.claimed", target.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; } } - source.sendFailure(Component.literal("Failed to claim collar")); + source.sendFailure(Component.translatable("command.tiedup.collar_cmd.claim_failed")); return 0; } @@ -187,9 +184,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -199,18 +194,16 @@ public class CollarCommand { CollarHelper.removeOwner(collar, executor.getUUID()); source.sendSuccess( () -> - Component.literal( - "§aRemoved your ownership from " + - target.getName().getString() + - "'s collar" - ), + Component.translatable( + "command.tiedup.collar_cmd.unclaimed", target.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; } } - source.sendFailure(Component.literal("Failed to unclaim collar")); + source.sendFailure(Component.translatable("command.tiedup.collar_cmd.unclaim_failed")); return 0; } @@ -223,9 +216,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -234,9 +225,9 @@ public class CollarCommand { CollarHelper.setNickname(collar, name); source.sendSuccess( () -> - Component.literal( - "§aSet collar nickname to '" + name + "'" - ), + Component.translatable( + "command.tiedup.collar_cmd.renamed", name + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -254,9 +245,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -265,13 +254,11 @@ public class CollarCommand { CollarHelper.addOwner(collar, owner); source.sendSuccess( () -> - Component.literal( - "§aAdded " + - owner.getName().getString() + - " as owner of " + - target.getName().getString() + - "'s collar" - ), + Component.translatable( + "command.tiedup.collar_cmd.owner_added", + owner.getName().getString(), + target.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -289,9 +276,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -300,13 +285,11 @@ public class CollarCommand { CollarHelper.removeOwner(collar, owner.getUUID()); source.sendSuccess( () -> - Component.literal( - "§aRemoved " + - owner.getName().getString() + - " as owner of " + - target.getName().getString() + - "'s collar" - ), + Component.translatable( + "command.tiedup.collar_cmd.owner_removed", + owner.getName().getString(), + target.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -329,9 +312,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -343,7 +324,7 @@ public class CollarCommand { if (cell == null) { source.sendFailure( - Component.literal("Cell '" + cellName + "' not found") + Component.translatable("command.tiedup.collar_cmd.cell_not_found", cellName) ); return 0; } @@ -352,13 +333,11 @@ public class CollarCommand { CollarHelper.setCellId(collar, cell.getId()); source.sendSuccess( () -> - Component.literal( - "§aAssigned cell '" + - cellName + - "' to " + - target.getName().getString() + - "'s collar" - ), + Component.translatable( + "command.tiedup.collar_cmd.cell_assigned", + cellName, + target.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -381,9 +360,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -391,7 +368,7 @@ public class CollarCommand { if (CollarHelper.isCollar(collar)) { if (!CollarHelper.hasCellAssigned(collar)) { source.sendFailure( - Component.literal("No cell assigned to collar") + Component.translatable("command.tiedup.collar_cmd.no_cell_assigned") ); return 0; } @@ -403,7 +380,7 @@ public class CollarCommand { if (cell == null) { source.sendFailure( - Component.literal("Assigned cell no longer exists") + Component.translatable("command.tiedup.collar_cmd.cell_deleted") ); return 0; } @@ -420,12 +397,11 @@ public class CollarCommand { source.sendSuccess( () -> - Component.literal( - "§aTeleported " + - target.getName().getString() + - " to cell at " + - cell.getCorePos().toShortString() - ), + Component.translatable( + "command.tiedup.collar_cmd.teleported", + target.getName().getString(), + cell.getCorePos().toShortString() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -442,9 +418,7 @@ public class CollarCommand { ItemStack collar = getPlayerCollar(target); if (collar.isEmpty()) { source.sendFailure( - Component.literal( - target.getName().getString() + " does not have a collar" - ) + Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString()) ); return 0; } @@ -452,28 +426,23 @@ public class CollarCommand { if (CollarHelper.isCollar(collar)) { source.sendSuccess( () -> - Component.literal( - "§6=== Collar Info for " + - target.getName().getString() + - " ===" - ), + Component.translatable( + "command.tiedup.collar_cmd.info_header", + target.getName().getString() + ).withStyle(ChatFormatting.GOLD), false ); String nickname = CollarHelper.getNickname(collar); + String nicknameDisplay = (nickname == null || nickname.isEmpty()) ? "None" : nickname; source.sendSuccess( () -> - Component.literal( - "§7Nickname: §f" + - (nickname == null || nickname.isEmpty() ? "None" : nickname) - ), + Component.translatable("command.tiedup.collar_cmd.info_nickname", nicknameDisplay).withStyle(ChatFormatting.GRAY), false ); source.sendSuccess( () -> - Component.literal( - "§7Has Owner: §f" + CollarHelper.hasOwner(collar) - ), + Component.translatable("command.tiedup.collar_cmd.info_has_owner", String.valueOf(CollarHelper.hasOwner(collar))).withStyle(ChatFormatting.GRAY), false ); // Cell assignment @@ -489,23 +458,22 @@ public class CollarCommand { : cellId.toString().substring(0, 8) + "..."; source.sendSuccess( () -> - Component.literal( - "§7Assigned Cell: §a" + - cellDisplay + - " §7@ " + - cell.getCorePos().toShortString() - ), + Component.translatable( + "command.tiedup.collar_cmd.info_cell", + cellDisplay, + cell.getCorePos().toShortString() + ).withStyle(ChatFormatting.GRAY), false ); } else { source.sendSuccess( - () -> Component.literal("§7Assigned Cell: §c(deleted)"), + () -> Component.translatable("command.tiedup.collar_cmd.info_cell_deleted").withStyle(ChatFormatting.RED), false ); } } else { source.sendSuccess( - () -> Component.literal("§7Assigned Cell: §fNone"), + () -> Component.translatable("command.tiedup.collar_cmd.info_cell_none").withStyle(ChatFormatting.GRAY), false ); } @@ -514,9 +482,9 @@ public class CollarCommand { && lockable.isLocked(collar); source.sendSuccess( () -> - Component.literal( - "§7Locked: §f" + locked - ), + Component.translatable( + "command.tiedup.collar_cmd.info_locked", String.valueOf(locked) + ).withStyle(ChatFormatting.GRAY), false ); diff --git a/src/main/java/com/tiedup/remake/commands/CommandHelper.java b/src/main/java/com/tiedup/remake/commands/CommandHelper.java index bf55d64..422dd76 100644 --- a/src/main/java/com/tiedup/remake/commands/CommandHelper.java +++ b/src/main/java/com/tiedup/remake/commands/CommandHelper.java @@ -42,7 +42,7 @@ public final class CommandHelper { if (source.getEntity() instanceof ServerPlayer player) { return Optional.of(player); } - source.sendFailure(Component.literal("Must be a player")); + source.sendFailure(Component.translatable("command.tiedup.error.must_be_player")); return Optional.empty(); } diff --git a/src/main/java/com/tiedup/remake/commands/KeyCommand.java b/src/main/java/com/tiedup/remake/commands/KeyCommand.java index 7b4988c..2494e2d 100644 --- a/src/main/java/com/tiedup/remake/commands/KeyCommand.java +++ b/src/main/java/com/tiedup/remake/commands/KeyCommand.java @@ -5,6 +5,7 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.items.ModItems; import java.util.Optional; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.EntityArgument; @@ -89,7 +90,7 @@ public class KeyCommand { ItemStack key = getHeldKey(player); if (key.isEmpty()) { - source.sendFailure(Component.literal("You must hold a collar key")); + source.sendFailure(Component.translatable("command.tiedup.key.must_hold_key")); return 0; } @@ -101,7 +102,7 @@ public class KeyCommand { !tag.getUUID(TAG_OWNER).equals(player.getUUID()) ) { source.sendFailure( - Component.literal("This key is already claimed by someone else") + Component.translatable("command.tiedup.key.already_claimed") ); return 0; } @@ -110,7 +111,7 @@ public class KeyCommand { tag.putString(TAG_OWNER_NAME, player.getName().getString()); source.sendSuccess( - () -> Component.literal("§aYou have claimed this key"), + () -> Component.translatable("command.tiedup.key.claimed").withStyle(ChatFormatting.GREEN), false ); @@ -129,19 +130,19 @@ public class KeyCommand { ItemStack key = getHeldKey(player); if (key.isEmpty()) { - source.sendFailure(Component.literal("You must hold a collar key")); + source.sendFailure(Component.translatable("command.tiedup.key.must_hold_key")); return 0; } CompoundTag tag = key.getOrCreateTag(); if (!tag.hasUUID(TAG_OWNER)) { - source.sendFailure(Component.literal("This key is not claimed")); + source.sendFailure(Component.translatable("command.tiedup.key.not_claimed")); return 0; } if (!tag.getUUID(TAG_OWNER).equals(player.getUUID())) { - source.sendFailure(Component.literal("You do not own this key")); + source.sendFailure(Component.translatable("command.tiedup.key.not_owner")); return 0; } @@ -149,7 +150,7 @@ public class KeyCommand { tag.remove(TAG_OWNER_NAME); source.sendSuccess( - () -> Component.literal("§aYou have unclaimed this key"), + () -> Component.translatable("command.tiedup.key.unclaimed").withStyle(ChatFormatting.GREEN), false ); @@ -170,7 +171,7 @@ public class KeyCommand { ItemStack key = getHeldKey(player); if (key.isEmpty()) { - source.sendFailure(Component.literal("You must hold a collar key")); + source.sendFailure(Component.translatable("command.tiedup.key.must_hold_key")); return 0; } @@ -181,7 +182,7 @@ public class KeyCommand { tag.hasUUID(TAG_OWNER) && !tag.getUUID(TAG_OWNER).equals(player.getUUID()) ) { - source.sendFailure(Component.literal("You do not own this key")); + source.sendFailure(Component.translatable("command.tiedup.key.not_owner")); return 0; } @@ -190,9 +191,9 @@ public class KeyCommand { source.sendSuccess( () -> - Component.literal( - "§aAssigned key to " + target.getName().getString() - ), + Component.translatable( + "command.tiedup.key.assigned", target.getName().getString() + ).withStyle(ChatFormatting.GREEN), false ); @@ -211,7 +212,7 @@ public class KeyCommand { ItemStack key = getHeldKey(player); if (key.isEmpty()) { - source.sendFailure(Component.literal("You must hold a collar key")); + source.sendFailure(Component.translatable("command.tiedup.key.must_hold_key")); return 0; } @@ -222,7 +223,7 @@ public class KeyCommand { tag.hasUUID(TAG_OWNER) && !tag.getUUID(TAG_OWNER).equals(player.getUUID()) ) { - source.sendFailure(Component.literal("You do not own this key")); + source.sendFailure(Component.translatable("command.tiedup.key.not_owner")); return 0; } @@ -231,9 +232,9 @@ public class KeyCommand { source.sendSuccess( () -> - Component.literal( - "§aKey is now " + (isPublic ? "public" : "private") - ), + Component.translatable( + isPublic ? "command.tiedup.key.now_public" : "command.tiedup.key.now_private" + ).withStyle(ChatFormatting.GREEN), false ); @@ -252,40 +253,40 @@ public class KeyCommand { ItemStack key = getHeldKey(player); if (key.isEmpty()) { - source.sendFailure(Component.literal("You must hold a collar key")); + source.sendFailure(Component.translatable("command.tiedup.key.must_hold_key")); return 0; } CompoundTag tag = key.getOrCreateTag(); source.sendSuccess( - () -> Component.literal("§6=== Key Info ==="), + () -> Component.translatable("command.tiedup.key.info_header").withStyle(ChatFormatting.GOLD), false ); String ownerName = tag.getString(TAG_OWNER_NAME); source.sendSuccess( () -> - Component.literal( - "§7Owner: §f" + - (ownerName.isEmpty() ? "Not claimed" : ownerName) - ), + Component.translatable( + "command.tiedup.key.info_owner", + ownerName.isEmpty() ? "Not claimed" : ownerName + ).withStyle(ChatFormatting.GRAY), false ); String targetName = tag.getString(TAG_TARGET_NAME); source.sendSuccess( () -> - Component.literal( - "§7Assigned to: §f" + - (targetName.isEmpty() ? "Not assigned" : targetName) - ), + Component.translatable( + "command.tiedup.key.info_assigned", + targetName.isEmpty() ? "Not assigned" : targetName + ).withStyle(ChatFormatting.GRAY), false ); boolean isPublic = tag.getBoolean(TAG_PUBLIC); source.sendSuccess( - () -> Component.literal("§7Public: §f" + (isPublic ? "Yes" : "No")), + () -> Component.translatable("command.tiedup.key.info_public", isPublic ? "Yes" : "No").withStyle(ChatFormatting.GRAY), false ); diff --git a/src/main/java/com/tiedup/remake/commands/KidnapSetCommand.java b/src/main/java/com/tiedup/remake/commands/KidnapSetCommand.java index 759a819..a6d1e7a 100644 --- a/src/main/java/com/tiedup/remake/commands/KidnapSetCommand.java +++ b/src/main/java/com/tiedup/remake/commands/KidnapSetCommand.java @@ -8,6 +8,7 @@ import com.tiedup.remake.items.base.KnifeVariant; import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem; import java.util.Optional; import net.minecraft.resources.ResourceLocation; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.network.chat.Component; @@ -147,9 +148,9 @@ public class KidnapSetCommand { int finalGiven = given; source.sendSuccess( () -> - Component.literal( - "§aGave kidnap set (" + finalGiven + " item stacks)" - ), + Component.translatable( + "command.tiedup.kidnapset.gave", finalGiven + ).withStyle(ChatFormatting.GREEN), true ); @@ -205,13 +206,11 @@ public class KidnapSetCommand { int finalReloaded = reloaded; source.sendSuccess( () -> - Component.literal( - "§aReloaded " + - (type.equals("all") ? "all data files" : type) + - " (" + - finalReloaded + - " files)" - ), + Component.translatable( + "command.tiedup.kidnapreload.reloaded", + type.equals("all") ? "all data files" : type, + finalReloaded + ).withStyle(ChatFormatting.GREEN), true ); diff --git a/src/main/java/com/tiedup/remake/commands/NPCCommand.java b/src/main/java/com/tiedup/remake/commands/NPCCommand.java index 22968fb..167219e 100644 --- a/src/main/java/com/tiedup/remake/commands/NPCCommand.java +++ b/src/main/java/com/tiedup/remake/commands/NPCCommand.java @@ -13,6 +13,7 @@ import net.minecraft.resources.ResourceLocation; import com.tiedup.remake.v2.BodyRegionV2; import java.util.List; import java.util.Optional; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.EntityArgument; @@ -199,7 +200,7 @@ public class NPCCommand { z = player.getZ(); } else { source.sendFailure( - Component.literal("Must specify a player or be a player") + Component.translatable("command.tiedup.error.must_be_player") ); return 0; } @@ -219,15 +220,15 @@ public class NPCCommand { source.sendSuccess( () -> - Component.literal( - "§aSpawned Kidnapper at " + formatPos(x, y, z) - ), + Component.translatable( + "command.tiedup.npc.spawned_kidnapper", formatPos(x, y, z) + ).withStyle(ChatFormatting.GREEN), true ); return 1; } - source.sendFailure(Component.literal("Failed to spawn Kidnapper")); + source.sendFailure(Component.translatable("command.tiedup.npc.spawn_failed_kidnapper")); return 0; } @@ -245,11 +246,7 @@ public class NPCCommand { ); if (variant == null) { source.sendFailure( - Component.literal( - "Unknown elite variant: " + - name + - ". Available: suki, carol, athena, evelyn" - ) + Component.translatable("command.tiedup.npc.unknown_variant", name) ); return 0; } @@ -266,7 +263,7 @@ public class NPCCommand { z = player.getZ(); } else { source.sendFailure( - Component.literal("Must specify a player or be a player") + Component.translatable("command.tiedup.error.must_be_player") ); return 0; } @@ -289,19 +286,16 @@ public class NPCCommand { source.sendSuccess( () -> - Component.literal( - "§aSpawned Elite Kidnapper '" + - variant.defaultName() + - "' at " + - formatPos(x, y, z) - ), + Component.translatable( + "command.tiedup.npc.spawned_elite", variant.defaultName(), formatPos(x, y, z) + ).withStyle(ChatFormatting.GREEN), true ); return 1; } source.sendFailure( - Component.literal("Failed to spawn Elite Kidnapper") + Component.translatable("command.tiedup.npc.spawn_failed_elite") ); return 0; } @@ -325,7 +319,7 @@ public class NPCCommand { z = player.getZ(); } else { source.sendFailure( - Component.literal("Must specify a player or be a player") + Component.translatable("command.tiedup.error.must_be_player") ); return 0; } @@ -346,16 +340,16 @@ public class NPCCommand { source.sendSuccess( () -> - Component.literal( - "§aSpawned Archer Kidnapper at " + formatPos(x, y, z) - ), + Component.translatable( + "command.tiedup.npc.spawned_archer", formatPos(x, y, z) + ).withStyle(ChatFormatting.GREEN), true ); return 1; } source.sendFailure( - Component.literal("Failed to spawn Archer Kidnapper") + Component.translatable("command.tiedup.npc.spawn_failed_archer") ); return 0; } @@ -379,7 +373,7 @@ public class NPCCommand { z = player.getZ(); } else { source.sendFailure( - Component.literal("Must specify a player or be a player") + Component.translatable("command.tiedup.error.must_be_player") ); return 0; } @@ -399,15 +393,15 @@ public class NPCCommand { source.sendSuccess( () -> - Component.literal( - "§aSpawned Damsel at " + formatPos(x, y, z) - ), + Component.translatable( + "command.tiedup.npc.spawned_damsel", formatPos(x, y, z) + ).withStyle(ChatFormatting.GREEN), true ); return 1; } - source.sendFailure(Component.literal("Failed to spawn Damsel")); + source.sendFailure(Component.translatable("command.tiedup.npc.spawn_failed_damsel")); return 0; } @@ -441,9 +435,9 @@ public class NPCCommand { int finalKilled = killed; source.sendSuccess( () -> - Component.literal( - "§aKilled " + finalKilled + " mod NPCs in radius " + radius - ), + Component.translatable( + "command.tiedup.npc.killed", finalKilled, radius + ).withStyle(ChatFormatting.GREEN), true ); @@ -491,7 +485,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -499,7 +493,7 @@ public class NPCCommand { if (npc.isTiedUp()) { context .getSource() - .sendFailure(Component.literal("NPC is already tied up")); + .sendFailure(Component.translatable("command.tiedup.npc.already_tied")); return 0; } @@ -510,7 +504,7 @@ public class NPCCommand { context .getSource() .sendSuccess( - () -> Component.literal("§aTied up " + npc.getKidnappedName()), + () -> Component.translatable("command.tiedup.npc.tied", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -522,7 +516,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -530,7 +524,7 @@ public class NPCCommand { if (npc.isGagged()) { context .getSource() - .sendFailure(Component.literal("NPC is already gagged")); + .sendFailure(Component.translatable("command.tiedup.npc.already_gagged")); return 0; } @@ -541,7 +535,7 @@ public class NPCCommand { context .getSource() .sendSuccess( - () -> Component.literal("§aGagged " + npc.getKidnappedName()), + () -> Component.translatable("command.tiedup.npc.gagged", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -555,7 +549,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -563,7 +557,7 @@ public class NPCCommand { if (npc.isBlindfolded()) { context .getSource() - .sendFailure(Component.literal("NPC is already blindfolded")); + .sendFailure(Component.translatable("command.tiedup.npc.already_blindfolded")); return 0; } @@ -575,9 +569,8 @@ public class NPCCommand { .getSource() .sendSuccess( () -> - Component.literal( - "§aBlindfolded " + npc.getKidnappedName() - ), + Component.translatable("command.tiedup.npc.blindfolded", npc.getKidnappedName() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -589,7 +582,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -597,7 +590,7 @@ public class NPCCommand { if (npc.hasCollar()) { context .getSource() - .sendFailure(Component.literal("NPC already has a collar")); + .sendFailure(Component.translatable("command.tiedup.npc.already_collared")); return 0; } @@ -608,7 +601,7 @@ public class NPCCommand { context .getSource() .sendSuccess( - () -> Component.literal("§aCollared " + npc.getKidnappedName()), + () -> Component.translatable("command.tiedup.npc.collared", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -620,7 +613,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -629,7 +622,7 @@ public class NPCCommand { context .getSource() .sendSuccess( - () -> Component.literal("§aUntied " + npc.getKidnappedName()), + () -> Component.translatable("command.tiedup.npc.untied", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -643,7 +636,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -667,9 +660,9 @@ public class NPCCommand { .getSource() .sendSuccess( () -> - Component.literal( - "§aFully restrained " + npc.getKidnappedName() - ), + Component.translatable( + "command.tiedup.npc.fully_restrained", npc.getKidnappedName() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -683,7 +676,7 @@ public class NPCCommand { context .getSource() .sendFailure( - Component.literal("No mod NPC found within 10 blocks") + Component.translatable("command.tiedup.npc.no_npc_nearby") ); return 0; } @@ -692,68 +685,67 @@ public class NPCCommand { source.sendSuccess( () -> - Component.literal( - "§6=== NPC State: " + npc.getKidnappedName() + " ===" - ), + Component.translatable( + "command.tiedup.npc.state_header", npc.getKidnappedName() + ).withStyle(ChatFormatting.GOLD), false ); if (npc instanceof EntityDamsel damsel) { source.sendSuccess( () -> - Component.literal("§eVariant: §f" + damsel.getVariantId()), + Component.translatable("command.tiedup.npc.state_variant", damsel.getVariantId()).withStyle(ChatFormatting.YELLOW), false ); source.sendSuccess( () -> - Component.literal( - "§eSlim Arms: " + - (damsel.hasSlimArms() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_slim_arms", + Component.translatable(damsel.hasSlimArms() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); } source.sendSuccess( () -> - Component.literal( - "§eTied Up: " + (npc.isTiedUp() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_tied", + Component.translatable(npc.isTiedUp() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); source.sendSuccess( () -> - Component.literal( - "§eGagged: " + (npc.isGagged() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_gagged", + Component.translatable(npc.isGagged() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); source.sendSuccess( () -> - Component.literal( - "§eBlindfolded: " + (npc.isBlindfolded() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_blindfolded", + Component.translatable(npc.isBlindfolded() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); source.sendSuccess( () -> - Component.literal( - "§eHas Collar: " + (npc.hasCollar() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_collar", + Component.translatable(npc.hasCollar() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); source.sendSuccess( () -> - Component.literal( - "§eHas Earplugs: " + (npc.hasEarplugs() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_earplugs", + Component.translatable(npc.hasEarplugs() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); source.sendSuccess( () -> - Component.literal( - "§eIs Captive: " + (npc.isCaptive() ? "§aYes" : "§7No") - ), + Component.translatable("command.tiedup.npc.state_captive", + Component.translatable(npc.isCaptive() ? "command.tiedup.yes" : "command.tiedup.no") + ).withStyle(ChatFormatting.YELLOW), false ); diff --git a/src/main/java/com/tiedup/remake/commands/SocialCommand.java b/src/main/java/com/tiedup/remake/commands/SocialCommand.java index 0dabe6c..5f43606 100644 --- a/src/main/java/com/tiedup/remake/commands/SocialCommand.java +++ b/src/main/java/com/tiedup/remake/commands/SocialCommand.java @@ -162,7 +162,7 @@ public class SocialCommand { ServerPlayer target = EntityArgument.getPlayer(context, "player"); if (player.getUUID().equals(target.getUUID())) { - source.sendFailure(Component.literal("You cannot block yourself")); + source.sendFailure(Component.translatable("command.tiedup.social.cannot_block_self")); return 0; } @@ -170,9 +170,7 @@ public class SocialCommand { if (data.isBlocked(player.getUUID(), target.getUUID())) { source.sendFailure( - Component.literal( - target.getName().getString() + " is already blocked" - ) + Component.translatable("command.tiedup.social.already_blocked", target.getName().getString()) ); return 0; } @@ -180,7 +178,7 @@ public class SocialCommand { data.addBlock(player.getUUID(), target.getUUID()); source.sendSuccess( () -> - Component.literal("§aBlocked " + target.getName().getString()), + Component.translatable("command.tiedup.social.blocked", target.getName().getString()).withStyle(ChatFormatting.GREEN), false ); @@ -208,9 +206,7 @@ public class SocialCommand { if (!data.isBlocked(player.getUUID(), target.getUUID())) { source.sendFailure( - Component.literal( - target.getName().getString() + " is not blocked" - ) + Component.translatable("command.tiedup.social.not_blocked", target.getName().getString()) ); return 0; } @@ -218,9 +214,7 @@ public class SocialCommand { data.removeBlock(player.getUUID(), target.getUUID()); source.sendSuccess( () -> - Component.literal( - "§aUnblocked " + target.getName().getString() - ), + Component.translatable("command.tiedup.social.unblocked", target.getName().getString()).withStyle(ChatFormatting.GREEN), false ); @@ -245,19 +239,13 @@ public class SocialCommand { if (blocked) { source.sendSuccess( () -> - Component.literal( - "§c" + target.getName().getString() + " has blocked you" - ), + Component.translatable("command.tiedup.social.has_blocked_you", target.getName().getString()).withStyle(ChatFormatting.RED), false ); } else { source.sendSuccess( () -> - Component.literal( - "§a" + - target.getName().getString() + - " has not blocked you" - ), + Component.translatable("command.tiedup.social.has_not_blocked_you", target.getName().getString()).withStyle(ChatFormatting.GREEN), false ); } @@ -300,11 +288,7 @@ public class SocialCommand { if (lastUse != null && now - lastUse < NORP_COOLDOWN_MS) { long remaining = (NORP_COOLDOWN_MS - (now - lastUse)) / 1000; source.sendFailure( - Component.literal( - "Please wait " + - remaining + - " seconds before using /norp again" - ) + Component.translatable("command.tiedup.social.norp_cooldown", remaining) ); return 0; } @@ -315,7 +299,7 @@ public class SocialCommand { // Broadcast to all players Component message = Component.literal("") .append( - Component.literal("[NoRP] ").withStyle( + Component.translatable("command.tiedup.social.norp_prefix").withStyle( ChatFormatting.RED, ChatFormatting.BOLD ) @@ -326,8 +310,8 @@ public class SocialCommand { ) ) .append( - Component.literal( - " has announced non-consent to current RP" + Component.translatable( + "command.tiedup.social.norp_announcement" ).withStyle(ChatFormatting.RED) ); @@ -411,7 +395,7 @@ public class SocialCommand { SocialData data = SocialData.get(sender.serverLevel()); if (data.isBlocked(target.getUUID(), sender.getUUID())) { source.sendFailure( - Component.literal("This player has blocked you") + Component.translatable("command.tiedup.social.pm_blocked") ); return 0; } @@ -419,8 +403,8 @@ public class SocialCommand { // Send to target (earplug-aware) Component toTarget = Component.literal("") .append( - Component.literal( - "[PM from " + sender.getName().getString() + "] " + Component.translatable( + "command.tiedup.social.pm_from", sender.getName().getString() ).withStyle(ChatFormatting.LIGHT_PURPLE) ) .append(Component.literal(message).withStyle(ChatFormatting.WHITE)); @@ -429,8 +413,8 @@ public class SocialCommand { // Confirm to sender (always show - they're the one sending) Component toSender = Component.literal("") .append( - Component.literal( - "[PM to " + target.getName().getString() + "] " + Component.translatable( + "command.tiedup.social.pm_to", target.getName().getString() ).withStyle(ChatFormatting.GRAY) ) .append(Component.literal(message).withStyle(ChatFormatting.WHITE)); @@ -458,15 +442,13 @@ public class SocialCommand { if (distance == 0) { source.sendSuccess( - () -> Component.literal("§aTalk area disabled (global chat)"), + () -> Component.translatable("command.tiedup.social.talkarea_disabled").withStyle(ChatFormatting.GREEN), false ); } else { source.sendSuccess( () -> - Component.literal( - "§aTalk area set to " + distance + " blocks" - ), + Component.translatable("command.tiedup.social.talkarea_set", distance).withStyle(ChatFormatting.GREEN), false ); } @@ -490,12 +472,12 @@ public class SocialCommand { if (talkArea == 0) { source.sendSuccess( () -> - Component.literal("Talk area: §edisabled §7(global chat)"), + Component.translatable("command.tiedup.social.talkinfo_disabled").withStyle(ChatFormatting.YELLOW), false ); } else { source.sendSuccess( - () -> Component.literal("Talk area: §e" + talkArea + " blocks"), + () -> Component.translatable("command.tiedup.social.talkinfo_distance", talkArea).withStyle(ChatFormatting.YELLOW), false ); } diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/DebtSubCommand.java b/src/main/java/com/tiedup/remake/commands/subcommands/DebtSubCommand.java index 3f6f280..0724b31 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/DebtSubCommand.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/DebtSubCommand.java @@ -7,6 +7,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.prison.PrisonerManager; import com.tiedup.remake.prison.RansomRecord; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.EntityArgument; @@ -77,9 +78,8 @@ public class DebtSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - target.getName().getString() + - " has no debt record." + Component.translatable( + "command.tiedup.debt.no_record", target.getName().getString() ), false ); @@ -94,16 +94,11 @@ public class DebtSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - target.getName().getString() + - " \u2014 Debt: " + - total + - " | Paid: " + - paid + - " | Remaining: " + - remaining + - " emeralds" - ), + Component.translatable( + "command.tiedup.debt.show", + target.getName().getString(), + total, paid, remaining + ).withStyle(ChatFormatting.YELLOW), false ); return 1; @@ -121,9 +116,7 @@ public class DebtSubCommand { context .getSource() .sendFailure( - Component.literal( - target.getName().getString() + " has no debt record." - ) + Component.translatable("command.tiedup.debt.no_record", target.getName().getString()) ); return 0; } @@ -133,13 +126,10 @@ public class DebtSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Set " + - target.getName().getString() + - "'s total debt to " + - amount + - " emeralds." - ), + Component.translatable( + "command.tiedup.debt.set", + target.getName().getString(), amount + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -157,9 +147,7 @@ public class DebtSubCommand { context .getSource() .sendFailure( - Component.literal( - target.getName().getString() + " has no debt record." - ) + Component.translatable("command.tiedup.debt.no_record", target.getName().getString()) ); return 0; } @@ -169,14 +157,10 @@ public class DebtSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Added " + - amount + - " emeralds to " + - target.getName().getString() + - "'s debt. Remaining: " + - ransom.getRemainingDebt() - ), + Component.translatable( + "command.tiedup.debt.added", + amount, target.getName().getString(), ransom.getRemainingDebt() + ).withStyle(ChatFormatting.GREEN), true ); return 1; @@ -194,9 +178,7 @@ public class DebtSubCommand { context .getSource() .sendFailure( - Component.literal( - target.getName().getString() + " has no debt record." - ) + Component.translatable("command.tiedup.debt.no_record", target.getName().getString()) ); return 0; } @@ -207,15 +189,10 @@ public class DebtSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Removed " + - amount + - " emeralds from " + - target.getName().getString() + - "'s debt. Remaining: " + - ransom.getRemainingDebt() + - (paid ? " (PAID OFF!)" : "") - ), + Component.translatable( + paid ? "command.tiedup.debt.removed_paid" : "command.tiedup.debt.removed", + amount, target.getName().getString(), ransom.getRemainingDebt() + ).withStyle(ChatFormatting.GREEN), true ); return 1; diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/InventorySubCommand.java b/src/main/java/com/tiedup/remake/commands/subcommands/InventorySubCommand.java index eadf51d..8dc08a6 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/InventorySubCommand.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/InventorySubCommand.java @@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.tiedup.remake.cells.ConfiscatedInventoryRegistry; import com.tiedup.remake.commands.CommandHelper; import com.tiedup.remake.core.SystemMessageManager; +import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.EntityArgument; @@ -56,9 +57,8 @@ public class InventorySubCommand { context .getSource() .sendFailure( - Component.literal( - targetPlayer.getName().getString() + - " has no confiscated inventory to restore" + Component.translatable( + "command.tiedup.inventory.no_confiscated", targetPlayer.getName().getString() ) ); return 0; @@ -71,10 +71,9 @@ public class InventorySubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "\u00a7aRestored confiscated inventory to " + - targetPlayer.getName().getString() - ), + Component.translatable( + "command.tiedup.inventory.restored", targetPlayer.getName().getString() + ).withStyle(ChatFormatting.GREEN), true ); SystemMessageManager.sendToPlayer( @@ -88,9 +87,8 @@ public class InventorySubCommand { context .getSource() .sendFailure( - Component.literal( - "Failed to restore inventory for " + - targetPlayer.getName().getString() + Component.translatable( + "command.tiedup.inventory.restore_failed", targetPlayer.getName().getString() ) ); return 0; diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/MasterTestSubCommand.java b/src/main/java/com/tiedup/remake/commands/subcommands/MasterTestSubCommand.java index 67808cf..51941f5 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/MasterTestSubCommand.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/MasterTestSubCommand.java @@ -77,7 +77,7 @@ public class MasterTestSubCommand { context .getSource() .sendFailure( - Component.literal("Failed to create Master entity") + Component.translatable("command.tiedup.master.spawn_failed") ); return 0; } @@ -108,10 +108,8 @@ public class MasterTestSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Spawned Master '" + - finalName + - "' \u2014 you are now their pet." + Component.translatable( + "command.tiedup.master.spawned", finalName ), true ); @@ -133,7 +131,7 @@ public class MasterTestSubCommand { context .getSource() .sendFailure( - Component.literal("No Master NPC found within 20 blocks") + Component.translatable("command.tiedup.master.no_master_nearby") ); return 0; } @@ -157,8 +155,8 @@ public class MasterTestSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Forced " + finalName + " into HUMAN_CHAIR state" + Component.translatable( + "command.tiedup.master.forced_state", finalName, "HUMAN_CHAIR" ), true ); @@ -183,7 +181,7 @@ public class MasterTestSubCommand { context .getSource() .sendFailure( - Component.literal("Unknown MasterState: " + taskName) + Component.translatable("command.tiedup.master.unknown_state", taskName) ); return 0; } @@ -193,7 +191,7 @@ public class MasterTestSubCommand { context .getSource() .sendFailure( - Component.literal("No Master NPC found within 20 blocks") + Component.translatable("command.tiedup.master.no_master_nearby") ); return 0; } @@ -217,12 +215,8 @@ public class MasterTestSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Forced " + - finalName + - " into " + - targetState.name() + - " state" + Component.translatable( + "command.tiedup.master.forced_state", finalName, targetState.name() ), true ); diff --git a/src/main/java/com/tiedup/remake/commands/subcommands/TestAnimSubCommand.java b/src/main/java/com/tiedup/remake/commands/subcommands/TestAnimSubCommand.java index 9f095f4..8da0688 100644 --- a/src/main/java/com/tiedup/remake/commands/subcommands/TestAnimSubCommand.java +++ b/src/main/java/com/tiedup/remake/commands/subcommands/TestAnimSubCommand.java @@ -87,8 +87,8 @@ public class TestAnimSubCommand { .getSource() .sendSuccess( () -> - Component.literal( - "Playing animation '" + anim + "' on " + name + Component.translatable( + "command.tiedup.testanim.playing", anim, name ), false ); @@ -116,7 +116,7 @@ public class TestAnimSubCommand { context .getSource() .sendSuccess( - () -> Component.literal("Stopped animation on " + name), + () -> Component.translatable("command.tiedup.testanim.stopped", name), false ); return 1; diff --git a/src/main/resources/assets/tiedup/lang/en_us.json b/src/main/resources/assets/tiedup/lang/en_us.json index a49fe2c..af82db6 100644 --- a/src/main/resources/assets/tiedup/lang/en_us.json +++ b/src/main/resources/assets/tiedup/lang/en_us.json @@ -810,5 +810,157 @@ "command.tiedup.accessory.fully_restrained": "%1$s has been fully restrained (%2$s items applied)", "command.tiedup.accessory.adjust_invalid_type": "Invalid type. Use: gag, blindfold, or all", "command.tiedup.accessory.nothing_to_adjust": "%1$s has no %2$s to adjust", - "command.tiedup.accessory.adjusted": "Adjusted %1$s for %2$s to %3$s pixels" + "command.tiedup.accessory.adjusted": "Adjusted %1$s for %2$s to %3$s pixels", + + "command.tiedup.error.must_be_player": "Must be a player", + "command.tiedup.yes": "Yes", + "command.tiedup.no": "No", + + "command.tiedup.npc.spawned_kidnapper": "Spawned Kidnapper at %1$s", + "command.tiedup.npc.spawned_elite": "Spawned Elite Kidnapper '%1$s' at %2$s", + "command.tiedup.npc.spawned_archer": "Spawned Archer Kidnapper at %1$s", + "command.tiedup.npc.spawned_damsel": "Spawned Damsel at %1$s", + "command.tiedup.npc.spawn_failed_kidnapper": "Failed to spawn Kidnapper", + "command.tiedup.npc.spawn_failed_elite": "Failed to spawn Elite Kidnapper", + "command.tiedup.npc.spawn_failed_archer": "Failed to spawn Archer Kidnapper", + "command.tiedup.npc.spawn_failed_damsel": "Failed to spawn Damsel", + "command.tiedup.npc.unknown_variant": "Unknown elite variant: %1$s. Available: suki, carol, athena, evelyn", + "command.tiedup.npc.killed": "Killed %1$s mod NPCs in radius %2$s", + "command.tiedup.npc.no_npc_nearby": "No mod NPC found within 10 blocks", + "command.tiedup.npc.already_tied": "NPC is already tied up", + "command.tiedup.npc.tied": "Tied up %1$s", + "command.tiedup.npc.already_gagged": "NPC is already gagged", + "command.tiedup.npc.gagged": "Gagged %1$s", + "command.tiedup.npc.already_blindfolded": "NPC is already blindfolded", + "command.tiedup.npc.blindfolded": "Blindfolded %1$s", + "command.tiedup.npc.already_collared": "NPC already has a collar", + "command.tiedup.npc.collared": "Collared %1$s", + "command.tiedup.npc.untied": "Untied %1$s", + "command.tiedup.npc.fully_restrained": "Fully restrained %1$s", + "command.tiedup.npc.state_header": "=== NPC State: %1$s ===", + "command.tiedup.npc.state_variant": "Variant: %1$s", + "command.tiedup.npc.state_slim_arms": "Slim Arms: %1$s", + "command.tiedup.npc.state_tied": "Tied Up: %1$s", + "command.tiedup.npc.state_gagged": "Gagged: %1$s", + "command.tiedup.npc.state_blindfolded": "Blindfolded: %1$s", + "command.tiedup.npc.state_collar": "Has Collar: %1$s", + "command.tiedup.npc.state_earplugs": "Has Earplugs: %1$s", + "command.tiedup.npc.state_captive": "Is Captive: %1$s", + + "command.tiedup.cell.no_selection": "No cell selected. Use the Admin Wand on a Cell Core first.", + "command.tiedup.cell.no_longer_exists": "Selected cell no longer exists", + "command.tiedup.cell.name_exists": "Cell name '%1$s' already exists", + "command.tiedup.cell.named": "Named cell '%1$s' and linked to you", + "command.tiedup.cell.none_registered": "No cells registered", + "command.tiedup.cell.list_header": "=== Cells (%1$s) ===", + "command.tiedup.cell.no_cells_for_owner": "%1$s has no cells", + "command.tiedup.cell.list_owner_header": "=== Cells owned by %1$s (%2$s) ===", + "command.tiedup.cell.not_found": "Cell '%1$s' not found", + "command.tiedup.cell.deleted": "Deleted cell '%1$s'", + "command.tiedup.cell.reset_spawns": "Reset %1$s spawn markers (found %2$s total spawn markers in %3$s block radius)", + "command.tiedup.cell.reset_spawns_hint": "You can now save the structure - NPCs will spawn when it's placed.", + "command.tiedup.cell.info_header": "=== Cell: %1$s ===", + "command.tiedup.cell.info_id": "ID: %1$s", + "command.tiedup.cell.info_state": "State: %1$s", + "command.tiedup.cell.info_core_pos": "Core Position: %1$s", + "command.tiedup.cell.info_spawn_point": "Spawn Point: %1$s", + "command.tiedup.cell.info_owner": "Owner: %1$s (%2$s)", + "command.tiedup.cell.info_owner_world": "Owner: (world-generated)", + "command.tiedup.cell.info_interior": "Interior blocks: %1$s", + "command.tiedup.cell.info_walls": "Wall blocks: %1$s", + "command.tiedup.cell.info_breaches": "Breaches: %1$s (%2$s%%)", + "command.tiedup.cell.info_beds": "Beds: %1$s", + "command.tiedup.cell.info_anchors": "Anchors: %1$s", + "command.tiedup.cell.info_doors": "Doors: %1$s", + "command.tiedup.cell.info_prisoners": "Prisoners: %1$s/4", + + "command.tiedup.social.cannot_block_self": "You cannot block yourself", + "command.tiedup.social.already_blocked": "%1$s is already blocked", + "command.tiedup.social.blocked": "Blocked %1$s", + "command.tiedup.social.not_blocked": "%1$s is not blocked", + "command.tiedup.social.unblocked": "Unblocked %1$s", + "command.tiedup.social.has_blocked_you": "%1$s has blocked you", + "command.tiedup.social.has_not_blocked_you": "%1$s has not blocked you", + "command.tiedup.social.norp_cooldown": "Please wait %1$s seconds before using /norp again", + "command.tiedup.social.norp_prefix": "[NoRP] ", + "command.tiedup.social.norp_announcement": " has announced non-consent to current RP", + "command.tiedup.social.pm_blocked": "This player has blocked you", + "command.tiedup.social.pm_from": "[PM from %1$s] ", + "command.tiedup.social.pm_to": "[PM to %1$s] ", + "command.tiedup.social.talkarea_disabled": "Talk area disabled (global chat)", + "command.tiedup.social.talkarea_set": "Talk area set to %1$s blocks", + "command.tiedup.social.talkinfo_disabled": "Talk area: disabled (global chat)", + "command.tiedup.social.talkinfo_distance": "Talk area: %1$s blocks", + + "command.tiedup.collar_cmd.no_collar": "%1$s does not have a collar", + "command.tiedup.collar_cmd.claimed": "Claimed %1$s's collar", + "command.tiedup.collar_cmd.claim_failed": "Failed to claim collar", + "command.tiedup.collar_cmd.unclaimed": "Removed your ownership from %1$s's collar", + "command.tiedup.collar_cmd.unclaim_failed": "Failed to unclaim collar", + "command.tiedup.collar_cmd.renamed": "Set collar nickname to '%1$s'", + "command.tiedup.collar_cmd.owner_added": "Added %1$s as owner of %2$s's collar", + "command.tiedup.collar_cmd.owner_removed": "Removed %1$s as owner of %2$s's collar", + "command.tiedup.collar_cmd.cell_not_found": "Cell '%1$s' not found", + "command.tiedup.collar_cmd.cell_assigned": "Assigned cell '%1$s' to %2$s's collar", + "command.tiedup.collar_cmd.no_cell_assigned": "No cell assigned to collar", + "command.tiedup.collar_cmd.cell_deleted": "Assigned cell no longer exists", + "command.tiedup.collar_cmd.teleported": "Teleported %1$s to cell at %2$s", + "command.tiedup.collar_cmd.info_header": "=== Collar Info for %1$s ===", + "command.tiedup.collar_cmd.info_nickname": "Nickname: %1$s", + "command.tiedup.collar_cmd.info_has_owner": "Has Owner: %1$s", + "command.tiedup.collar_cmd.info_cell": "Assigned Cell: %1$s @ %2$s", + "command.tiedup.collar_cmd.info_cell_deleted": "Assigned Cell: (deleted)", + "command.tiedup.collar_cmd.info_cell_none": "Assigned Cell: None", + "command.tiedup.collar_cmd.info_locked": "Locked: %1$s", + + "command.tiedup.key.must_hold_key": "You must hold a collar key", + "command.tiedup.key.already_claimed": "This key is already claimed by someone else", + "command.tiedup.key.claimed": "You have claimed this key", + "command.tiedup.key.not_claimed": "This key is not claimed", + "command.tiedup.key.not_owner": "You do not own this key", + "command.tiedup.key.unclaimed": "You have unclaimed this key", + "command.tiedup.key.assigned": "Assigned key to %1$s", + "command.tiedup.key.now_public": "Key is now public", + "command.tiedup.key.now_private": "Key is now private", + "command.tiedup.key.info_header": "=== Key Info ===", + "command.tiedup.key.info_owner": "Owner: %1$s", + "command.tiedup.key.info_assigned": "Assigned to: %1$s", + "command.tiedup.key.info_public": "Public: %1$s", + + "command.tiedup.bounty.cannot_self": "You cannot put a bounty on yourself!", + "command.tiedup.bounty.tied_up": "You cannot create bounties while tied up!", + "command.tiedup.bounty.max_reached": "Maximum number (%1$s) of active bounties reached!", + "command.tiedup.bounty.must_hold_item": "You must hold an item as the reward!", + "command.tiedup.bounty.created": "Bounty created on %1$s!", + "command.tiedup.bounty.broadcast": "[Bounty] %1$s has put a bounty on %2$s!", + + "command.tiedup.kidnapset.gave": "Gave kidnap set (%1$s item stacks)", + "command.tiedup.kidnapreload.reloaded": "Reloaded %1$s (%2$s files)", + + "command.tiedup.debug.prisoner_header": "=== Captivity Debug Info ===", + "command.tiedup.debug.error": "Error: %1$s", + "command.tiedup.debug.validate_checking": "Checking captivity system...", + "command.tiedup.debug.repair_simplified": "Repair functionality has been simplified with the new PrisonerManager system.", + "command.tiedup.debug.repair_auto": "The new system maintains consistency automatically.", + "command.tiedup.debug.camp_not_found": "No camp found with ID prefix: %1$s", + + "command.tiedup.inventory.no_confiscated": "%1$s has no confiscated inventory to restore", + "command.tiedup.inventory.restored": "Restored confiscated inventory to %1$s", + "command.tiedup.inventory.restore_failed": "Failed to restore inventory for %1$s", + + "command.tiedup.testanim.playing": "Playing animation '%1$s' on %2$s", + "command.tiedup.testanim.stopped": "Stopped animation on %1$s", + + "command.tiedup.master.spawn_failed": "Failed to create Master entity", + "command.tiedup.master.spawned": "Spawned Master '%1$s' — you are now their pet.", + "command.tiedup.master.no_master_nearby": "No Master NPC found within 20 blocks", + "command.tiedup.master.forced_state": "Forced %1$s into %2$s state", + "command.tiedup.master.unknown_state": "Unknown MasterState: %1$s", + + "command.tiedup.debt.no_record": "%1$s has no debt record.", + "command.tiedup.debt.show": "%1$s — Debt: %2$s | Paid: %3$s | Remaining: %4$s emeralds", + "command.tiedup.debt.set": "Set %1$s's total debt to %2$s emeralds.", + "command.tiedup.debt.added": "Added %1$s emeralds to %2$s's debt. Remaining: %3$s", + "command.tiedup.debt.removed": "Removed %1$s emeralds from %2$s's debt. Remaining: %3$s", + "command.tiedup.debt.removed_paid": "Removed %1$s emeralds from %2$s's debt. Remaining: %3$s (PAID OFF!)" } -- 2.49.1 From c34bac11b0c6f918cd0455ba1ee45b5931ac3c5c Mon Sep 17 00:00:00 2001 From: NotEvil Date: Wed, 15 Apr 2026 14:08:41 +0200 Subject: [PATCH 4/4] =?UTF-8?q?fix(C-01):=20review=20fixes=20=E2=80=94=20m?= =?UTF-8?q?issing=20keys,=20duplicate,=20GPS=20shock=20i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing keephead_enabled/disabled translation keys (BUG-001) - Remove duplicate gui.tiedup.close key at line 403 (RISK-004) - Fix GPS shock: use null addon + send GPS_ZONE_VIOLATION separately (RISK-001) --- .../remake/state/components/PlayerShockCollar.java | 9 ++++++--- src/main/resources/assets/tiedup/lang/en_us.json | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java b/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java index ceb32f5..be20278 100644 --- a/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java +++ b/src/main/java/com/tiedup/remake/state/components/PlayerShockCollar.java @@ -56,7 +56,8 @@ public class PlayerShockCollar { * Triggers a visual and auditory shock effect. * Damage is applied (shock can kill). * - * @param messageAddon Optional message addon for HUD (e.g., GPS violation) + * @param messageAddon Optional message addon for HUD (e.g., GPS violation). + * For translatable messages, prefer calling shockKidnapped() then sending the message separately. * @param damage Shock damage amount */ public void shockKidnapped(@Nullable String messageAddon, float damage) { @@ -100,7 +101,7 @@ public class PlayerShockCollar { // HUD Message via SystemMessageManager if (messageAddon != null) { - // Custom message with addon (e.g., GPS violation) + // Legacy addon path: append literal text to SLAVE_SHOCK message MutableComponent msg = Component.translatable( SystemMessageManager.getTranslationKey(MessageCategory.SLAVE_SHOCK) ).append(Component.literal(messageAddon)); @@ -197,9 +198,11 @@ public class PlayerShockCollar { if (shouldShockGPS && gpsStackCopy != null) { this.shockKidnapped( - " Return back to your allowed area!", + null, GameConstants.DEFAULT_SHOCK_DAMAGE ); + // GPS-specific message (replaces hardcoded " Return back to your allowed area!") + SystemMessageManager.sendToPlayer(host.getPlayer(), MessageCategory.GPS_ZONE_VIOLATION); warnOwnersGPSViolation(gpsStackCopy); } } diff --git a/src/main/resources/assets/tiedup/lang/en_us.json b/src/main/resources/assets/tiedup/lang/en_us.json index af82db6..6c2e5a4 100644 --- a/src/main/resources/assets/tiedup/lang/en_us.json +++ b/src/main/resources/assets/tiedup/lang/en_us.json @@ -282,6 +282,8 @@ "command.tiedup.clothes.unknown_layer": "Unknown layer: %s", "command.tiedup.clothes.layer_visible": "Wearer's %s layer is now visible", "command.tiedup.clothes.layer_hidden": "Wearer's %s layer is now hidden", + "command.tiedup.clothes.keephead_enabled": "Keep head mode enabled", + "command.tiedup.clothes.keephead_disabled": "Keep head mode disabled", "gui.tiedup.command_wand.title": "Command Wand", "gui.tiedup.command_wand.personality": "Personality", @@ -400,7 +402,6 @@ "gui.tiedup.slave_trader": "Slave Trader", "gui.tiedup.buy": "Buy", - "gui.tiedup.close": "Close", "gui.tiedup.no_captives_available": "No captives available for sale", "gui.tiedup.cell_manager": "Cell Manager", -- 2.49.1