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!)" }