feat(C-01): i18n main commands — 148 translatable keys
Phase 3: Migrate Component.literal() in all remaining command files. - NPCCommand (34), CellCommand (33), SocialCommand (16), CollarCommand (25), KeyCommand (18), BountyCommand (6), KidnapSetCommand (2), CaptivityDebugCommand (7), InventorySubCommand (3), TestAnimSubCommand (2), MasterTestSubCommand (7), DebtSubCommand (8) - Strip all section sign color codes, use .withStyle(ChatFormatting) - 148 new keys in en_us.json (command.tiedup.*) - Debug/dynamic strings intentionally kept as literal
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user