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

@@ -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(