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

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

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

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(

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

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

View File

@@ -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"
}