feat(C-01): i18n subcommands — 33 translatable keys

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
This commit is contained in:
NotEvil
2026-04-15 13:28:02 +02:00
parent 0662739fe0
commit 70965c2dda
6 changed files with 175 additions and 150 deletions

View File

@@ -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);