22 Commits

Author SHA1 Message Date
NotEvil
4e136cff96 centralize all ModConfig.SERVER reads through SettingsAccessor
No more direct ModConfig.SERVER access outside SettingsAccessor.
32 new accessor methods, 21 consumer files rerouted.
2026-04-16 13:16:05 +02:00
683eeec11f Merge pull request 'fix/swarm-review-p0-p1-p2' (#15) from fix/swarm-review-p0-p1-p2 into develop
Reviewed-on: #15
2026-04-16 10:37:05 +00:00
NotEvil
fd60086322 feat(i18n): complete migration — items, entities, AI goals, GUI screens
119 new translation keys across 3 domains:
- Items/Blocks/Misc (46 keys): tooltips, action messages, trap states
- Entities/AI Goals (55 keys): NPC speech, maid/master/guard messages
- Client GUI (18 keys): widget labels, screen buttons, merchant display

Remaining 119 Component.literal() are all intentional:
- Debug/Admin/Command wands (47) — dev tools, not player-facing
- Entity display names (~25) — dynamic getNpcName() calls
- Empty string roots (~15) — .append() chain bases
- User-typed text (~10) — /me, /pm, /norp chat content
- Runtime data (~12) — StringBuilder, gag muffling, MCA compat
2026-04-16 12:33:13 +02:00
NotEvil
9b2c5dec8e chore(P2): V1 zombie comments cleanup + i18n events/network/items
Zombie comments (14 files):
- Replace references to deleted V1 classes (ItemBind, ItemCollar, IBondageItem,
  BindVariant, etc.) with V2 equivalents or past-tense historical notes
- "V1 path" → "legacy slot-index path" for still-active legacy codepaths
- Clean misleading javadoc that implied V1 code was still present

i18n (13 files, 31 new keys):
- Events: 12 Component.literal() → translatable (labor tools, gag eat,
  death escape, debt, punishment, grace, camp protection, chest, maid)
- Network: 12 Component.literal() → translatable (trader messages,
  lockpick jam, slave freedom warnings)
- Items: 2 Component.literal() → translatable (ItemOwnerTarget tooltips)
2026-04-16 11:20:17 +02:00
NotEvil
371a138b71 fix(P1+P2): swarm review — UX fixes + V1 dead code cleanup
P1 — UX visible:
- Add 4 missing translations (leather_mittens, ball_gag_3d, taser, debug_wand)
- Fix earplugs resistance bucket: "blindfold" → "earplug"
- Split mixin config: core (require=1) + compat MCA (require=0)
- Bump PROTOCOL_VERSION from "1" to "2"
- Add debug_wand item model (no texture — debug only)
- Fix 3 display_name inconsistencies (chain, vine_seed, shock_collar_auto)

P2 — Dead code cleanup:
- Delete IHas3DModelConfig + Model3DConfig (zero imports)
- Remove MovementStyleResolver.resolveV1Fallback() + V1Fallback record + V1 constants
- Remove AnimationTickHandler V1 fallback block + buildAnimationId()
- Document PlayerEquipment.equipInRegion() bypass as intentional (force-equip paths)
2026-04-16 10:58:44 +02:00
NotEvil
d75b74f9f9 fix(P0): 3 exploit fixes from swarm review
- RISK-006: Mittens bypass lock/unlock — add HANDS check in PacketV2SelfLock/Unlock
- RISK-002: Struggle re-roll exploit — reject-if-active in startContinuous*Session()
- RISK-003: Non-V2 locked items bypass conflict resolution — check ILockable before swap
2026-04-16 10:49:04 +02:00
bce0598059 Merge pull request 'chore/audit-uc02-roomtheme-datadriven' (#14) from chore/audit-uc02-roomtheme-datadriven into develop
Reviewed-on: #14
2026-04-16 00:38:58 +00:00
NotEvil
6d56024c7e fix(UC-02): LOW review items — anchored path strip + corner offset doc
- Use substring instead of replace for path cleanup (anchored, no double-strip risk)
- Document that corner_decorations ignores x/z offsets (by design)
2026-04-16 02:32:50 +02:00
NotEvil
8823c671d7 fix(UC-02): clean theme IDs — strip directory prefix and .json suffix
RISK-003: Definition IDs were "tiedup:tiedup_room_themes/oubliette.json"
instead of clean "tiedup:oubliette". Now derived from filename only.
2026-04-16 01:54:03 +02:00
NotEvil
6d9d6b4b81 fix(UC-02): arch review — furniture x/z offsets + ceiling chain fidelity
- Add x_offset/z_offset to PositionedBlock for multi-block furniture clusters
- Furniture items now spread across 2-3 positions (matching original Java code)
- Offsets multiplied by inward direction for correct corner orientation
- Fix has_ceiling_chain: only oubliette has ceiling chains (was true for all 6)
- Fix firstCornerSpecial: oubliette cauldron uses x/z offset +1 (inward diagonal)
- Update parser to read x_offset/z_offset (defaults to 0)
2026-04-16 01:52:31 +02:00
NotEvil
706172fb9a fix(UC-02): QA review — crypt bottom_row + ice decorations fidelity
- BUG-001: CRYPT bottom_row had unreachable mossy_stone_bricks (same f variable
  makes mossy_cobblestone guard trigger first). Fixed weights: 0.20/0.10/0.70
- BUG-003: ICE ceiling ice stalactites (y_offset=10) were missing from JSON
- BUG-002: ICE snow corner layers use middle value (3) as compromise since
  DecorationConfig.PositionedBlock doesn't support random_property
2026-04-16 01:45:04 +02:00
NotEvil
3aaf92b788 feat(UC-02): data-driven room themes — 6 JSON + consumer migration + cleanup
Phase 3: Extract 6 themes into JSON (oubliette, inferno, crypt, ice, sculk, sandstone)
Phase 4: Migrate HangingCagePiece to use RoomThemeRegistry.pickRandomOrFallback()
  - Move 7 shared static methods from RoomTheme into HangingCagePiece
  - Replace per-enum placeDecorations() with generic DecorationConfig-based placement
Phase 5: Delete RoomTheme.java (-1368L)
2026-04-16 01:39:40 +02:00
NotEvil
69f52eacf3 feat(UC-02): data-driven room theme infrastructure (Phase 1+2)
- BlockPalette: weighted random block selection with condition variants
- RoomThemeDefinition: immutable record with wallBlock/floorBlock/etc convenience API
- DecorationConfig: positioned block records for theme-specific decorations
- RoomThemeRegistry: volatile atomic snapshot + pickRandom(weight-based)
- RoomThemeParser: JSON parsing with BlockStateParser + random_property expansion
- RoomThemeReloadListener: scans data/<ns>/tiedup_room_themes/*.json
- Register listener in TiedUpMod.onAddReloadListeners()
2026-04-16 01:30:51 +02:00
a4fc05b503 Merge pull request 'chore/audit-s02-s05-state-cleanup' (#13) from chore/audit-s02-s05-state-cleanup into develop
Reviewed-on: #13
2026-04-15 14:48:42 +00:00
NotEvil
7444853840 fix(S-02): remove unused host field from PlayerMovement (review) 2026-04-15 16:48:22 +02:00
NotEvil
22d79a452b refactor(S-02/S-05): extract PlayerMovement component + fix thread safety
- Extract 11 movement fields from PlayerBindState into PlayerMovement component
- Replace volatile isStruggling/struggleStartTick pair with atomic StruggleSnapshot record
- Remove 5+2 misleading synchronized keywords (different monitors, all server-thread-only)
- Update all 36 MovementStyleManager field accesses to use getMovement() getters/setters
2026-04-15 16:48:22 +02:00
70f85b58a6 Merge pull request 'chore/audit-c01-i18n' (#12) from chore/audit-c01-i18n into develop
Reviewed-on: #12
2026-04-15 14:48:07 +00:00
NotEvil
c34bac11b0 fix(C-01): review fixes — missing keys, duplicate, GPS shock i18n
- Add missing keephead_enabled/disabled translation keys (BUG-001)
- Remove duplicate gui.tiedup.close key at line 403 (RISK-004)
- Fix GPS shock: use null addon + send GPS_ZONE_VIOLATION separately (RISK-001)
2026-04-15 14:08:41 +02:00
NotEvil
fa5cfb913c 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
2026-04-15 13:54:26 +02:00
NotEvil
70965c2dda 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
2026-04-15 13:28:02 +02:00
NotEvil
0662739fe0 feat(C-01): i18n SystemMessageManager — 83 translatable keys
Phase 1: Core system message migration to Component.translatable().
- Replace getMessageTemplate() hardcoded strings with getTranslationKey() key derivation
- All send methods now use Component.translatable() with positional args
- Add 83 keys to en_us.json (msg.tiedup.system.*)
- Add sendTranslatable() convenience for external callers with string args
- Migrate 3 external getTemplate() callers (PlayerShockCollar, CellRegistryV2)
- Add resistance_suffix key for sendWithResistance()
2026-04-15 13:24:05 +02:00
ac72f6aae7 Merge pull request 'chore/quickwin-fix' (#11) from chore/quickwin-fix into develop
Reviewed-on: #11
2026-04-15 09:22:08 +00:00
151 changed files with 3695 additions and 3022 deletions

View File

@@ -104,6 +104,7 @@ minecraft {
// Mixin config arg
args '-mixin.config=tiedup.mixins.json'
args '-mixin.config=tiedup-compat.mixins.json'
}
server {
@@ -116,6 +117,7 @@ minecraft {
// Mixin config arg
args '-mixin.config=tiedup.mixins.json'
args '-mixin.config=tiedup-compat.mixins.json'
}
// Additional client instances for multiplayer testing
@@ -155,6 +157,7 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }
mixin {
add sourceSets.main, 'tiedup.refmap.json'
config 'tiedup.mixins.json'
config 'tiedup-compat.mixins.json'
}
repositories {
@@ -263,7 +266,7 @@ tasks.named('jar', Jar).configure {
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'MixinConfigs' : 'tiedup.mixins.json'
'MixinConfigs' : 'tiedup.mixins.json,tiedup-compat.mixins.json'
])
}

View File

@@ -244,7 +244,7 @@ public class BlockKidnapBomb
beTag.contains("collar")
) {
tooltip.add(
Component.literal("Loaded:").withStyle(
Component.translatable("block.tiedup.kidnap_bomb.loaded").withStyle(
ChatFormatting.YELLOW
)
);
@@ -282,12 +282,12 @@ public class BlockKidnapBomb
);
} else {
tooltip.add(
Component.literal("Empty").withStyle(ChatFormatting.GREEN)
Component.translatable("block.tiedup.kidnap_bomb.empty").withStyle(ChatFormatting.GREEN)
);
}
} else {
tooltip.add(
Component.literal("Empty").withStyle(ChatFormatting.GREEN)
Component.translatable("block.tiedup.kidnap_bomb.empty").withStyle(ChatFormatting.GREEN)
);
}
}

View File

@@ -328,7 +328,7 @@ public class BlockRopeTrap extends Block implements EntityBlock, ICanBeLoaded {
// Check if armed
if (beTag.contains("bind")) {
tooltip.add(
Component.literal("Armed").withStyle(
Component.translatable("block.tiedup.trap.armed").withStyle(
ChatFormatting.DARK_RED
)
);
@@ -366,14 +366,14 @@ public class BlockRopeTrap extends Block implements EntityBlock, ICanBeLoaded {
);
} else {
tooltip.add(
Component.literal("Disarmed").withStyle(
Component.translatable("block.tiedup.trap.disarmed").withStyle(
ChatFormatting.GREEN
)
);
}
} else {
tooltip.add(
Component.literal("Disarmed").withStyle(ChatFormatting.GREEN)
Component.translatable("block.tiedup.trap.disarmed").withStyle(ChatFormatting.GREEN)
);
}
}

View File

@@ -200,7 +200,7 @@ public class BlockTrappedChest extends ChestBlock implements ICanBeLoaded {
beTag.contains("collar")
) {
tooltip.add(
Component.literal("Armed").withStyle(
Component.translatable("block.tiedup.trap.armed").withStyle(
ChatFormatting.DARK_RED
)
);
@@ -231,14 +231,14 @@ public class BlockTrappedChest extends ChestBlock implements ICanBeLoaded {
);
} else {
tooltip.add(
Component.literal("Disarmed").withStyle(
Component.translatable("block.tiedup.trap.disarmed").withStyle(
ChatFormatting.GREEN
)
);
}
} else {
tooltip.add(
Component.literal("Disarmed").withStyle(ChatFormatting.GREEN)
Component.translatable("block.tiedup.trap.disarmed").withStyle(ChatFormatting.GREEN)
);
}
}

View File

@@ -382,9 +382,8 @@ public class BountyManager extends SavedData {
server
.getPlayerList()
.broadcastSystemMessage(
Component.literal("[Bounty] " + message).withStyle(
ChatFormatting.GOLD
),
Component.translatable("msg.tiedup.bounty.broadcast", message)
.withStyle(ChatFormatting.GOLD),
false
);
}

View File

@@ -250,10 +250,8 @@ public final class CampLifecycleManager {
// Notify prisoner
prisoner.sendSystemMessage(
Component.literal("Your captor has died. You are FREE!").withStyle(
ChatFormatting.GREEN,
ChatFormatting.BOLD
)
Component.translatable("msg.tiedup.camp.captor_died")
.withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD)
);
// Grant grace period (5 minutes = 6000 ticks)
@@ -261,9 +259,8 @@ public final class CampLifecycleManager {
manager.release(prisoner.getUUID(), level.getGameTime(), 6000);
prisoner.sendSystemMessage(
Component.literal(
"You have 5 minutes of protection from kidnappers."
).withStyle(ChatFormatting.AQUA)
Component.translatable("msg.tiedup.camp.grace_period")
.withStyle(ChatFormatting.AQUA)
);
TiedUpMod.LOGGER.info(

View File

@@ -670,13 +670,7 @@ public class CellRegistryV2 extends SavedData {
if (server == null || ownerId == null) return;
ServerPlayer owner = server.getPlayerList().getPlayer(ownerId);
if (owner != null) {
String template = SystemMessageManager.getTemplate(category);
String formattedMessage = String.format(template, prisonerName);
SystemMessageManager.sendToPlayer(
owner,
category,
formattedMessage
);
SystemMessageManager.sendTranslatable(owner, category, prisonerName);
}
}

View File

@@ -3,7 +3,7 @@ package com.tiedup.remake.client;
import com.mojang.blaze3d.platform.InputConstants;
import com.tiedup.remake.client.gui.screens.AdjustmentScreen;
import com.tiedup.remake.client.gui.screens.UnifiedBondageScreen;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.ILockable;
import com.tiedup.remake.v2.bondage.CollarHelper;
@@ -315,7 +315,7 @@ public class ModKeybindings {
// Check if player has bind equipped
if (state.isTiedUp()) {
// Has bind - struggle against it
if (ModConfig.SERVER.struggleMiniGameEnabled.get()) {
if (SettingsAccessor.isStruggleMiniGameEnabled()) {
// New: Start struggle mini-game
ModNetwork.sendToServer(
new PacketV2StruggleStart(BodyRegionV2.ARMS)

View File

@@ -7,16 +7,12 @@ import com.tiedup.remake.client.animation.PendingAnimationManager;
import com.tiedup.remake.client.animation.context.AnimationContext;
import com.tiedup.remake.client.animation.context.AnimationContextResolver;
import com.tiedup.remake.client.animation.context.RegionBoneMapper;
import com.tiedup.remake.client.animation.util.AnimationIdBuilder;
import com.tiedup.remake.client.events.CellHighlightHandler;
import com.tiedup.remake.client.events.LeashProxyClientHandler;
import com.tiedup.remake.client.gltf.GltfAnimationApplier;
import com.tiedup.remake.client.state.ClothesClientCache;
import com.tiedup.remake.client.state.MovementStyleClientState;
import com.tiedup.remake.client.state.PetBedClientState;
import com.tiedup.remake.items.base.PoseType;
import com.tiedup.remake.v2.bondage.BindModeHelper;
import com.tiedup.remake.v2.bondage.PoseTypeHelper;
import com.tiedup.remake.util.HumanChairHelper;
import com.tiedup.remake.state.PlayerBindState;
import com.tiedup.remake.v2.BodyRegionV2;
@@ -205,30 +201,11 @@ public class AnimationTickHandler {
context,
allOwnedParts
);
// Clear V1 tracking so transition back works
// Clear legacy tracking so transition back works
AnimationStateRegistry.getLastAnimId().remove(uuid);
} else {
// V1 fallback
if (GltfAnimationApplier.hasActiveState(player)) {
GltfAnimationApplier.clearV2Animation(player);
}
String animId = buildAnimationId(player, state);
String lastId = AnimationStateRegistry.getLastAnimId().get(
uuid
);
if (!animId.equals(lastId)) {
boolean success = BondageAnimationManager.playAnimation(
player,
animId
);
if (success) {
AnimationStateRegistry.getLastAnimId().put(
uuid,
animId
);
}
}
}
// No V2 items with GLB models — nothing to animate.
// Items without data-driven GLB definitions are not animated.
} else if (wasTied) {
// Was tied, now free - stop all animations
if (GltfAnimationApplier.hasActiveState(player)) {
@@ -242,53 +219,6 @@ public class AnimationTickHandler {
AnimationStateRegistry.getLastTiedState().put(uuid, isTied);
}
/**
* Build animation ID from player's current state (V1 path).
*/
private static String buildAnimationId(
Player player,
PlayerBindState state
) {
ItemStack bind = state.getEquipment(BodyRegionV2.ARMS);
PoseType poseType = PoseTypeHelper.getPoseType(bind);
// Human chair mode: override DOG pose to HUMAN_CHAIR (straight limbs)
poseType = HumanChairHelper.resolveEffectivePose(poseType, bind);
// Derive bound state from V2 regions (works client-side, synced via capability)
boolean armsBound = V2EquipmentHelper.isRegionOccupied(
player,
BodyRegionV2.ARMS
);
boolean legsBound = V2EquipmentHelper.isRegionOccupied(
player,
BodyRegionV2.LEGS
);
// V1 fallback: if no V2 regions are set but player is tied, derive from bind mode NBT
if (!armsBound && !legsBound && BindModeHelper.isBindItem(bind)) {
armsBound = BindModeHelper.hasArmsBound(bind);
legsBound = BindModeHelper.hasLegsBound(bind);
}
boolean isStruggling = state.isStruggling();
boolean isSneaking = player.isCrouching();
boolean isMoving =
player.getDeltaMovement().horizontalDistanceSqr() > 1e-6;
// Build animation ID with sneak and movement support
return AnimationIdBuilder.build(
poseType,
armsBound,
legsBound,
null,
isStruggling,
true,
isSneaking,
isMoving
);
}
/**
* Player logout event - cleanup animation data.
*/

View File

@@ -82,7 +82,7 @@ public class NpcAnimationTickHandler {
* (base posture) and an item layer (GLB-driven bones). Sitting and kneeling are
* handled by the context resolver, so the V2 path now covers all postures.
*
* <p>V1 fallback: if no V2 GLB model is found, falls back to JSON-based
* <p>Legacy fallback: if no GLB model is found, falls back to JSON-based
* PlayerAnimator animations via {@link BondageAnimationManager}.
*/
private static void updateNpcAnimation(AbstractTiedUpNpc entity) {
@@ -120,7 +120,7 @@ public class NpcAnimationTickHandler {
);
lastNpcAnimId.remove(uuid);
} else {
// V1 fallback: JSON-based PlayerAnimator animations
// Legacy fallback: JSON-based PlayerAnimator animations
if (GltfAnimationApplier.hasActiveState(entity)) {
GltfAnimationApplier.clearV2Animation(entity);
}
@@ -148,7 +148,7 @@ public class NpcAnimationTickHandler {
}
/**
* Build animation ID for an NPC from its current state (V1 path).
* Build animation ID for an NPC from its current state (legacy JSON path).
*/
private static String buildNpcAnimationId(AbstractTiedUpNpc entity) {
// Determine position prefix for SIT/KNEEL poses
@@ -175,7 +175,7 @@ public class NpcAnimationTickHandler {
BodyRegionV2.LEGS
);
// V1 fallback: if no V2 regions set but NPC has a bind, derive from bind mode NBT
// Legacy fallback: if no V2 regions set but NPC has a bind, derive from bind mode NBT
if (!armsBound && !legsBound && BindModeHelper.isBindItem(bind)) {
armsBound = BindModeHelper.hasArmsBound(bind);
legsBound = BindModeHelper.hasLegsBound(bind);

View File

@@ -198,12 +198,12 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
int totalWidth = buttonWidth * 3 + MARGIN_S * 2;
int actionStartX = this.leftPos + (this.imageWidth - totalWidth) / 2;
resetButton = Button.builder(Component.literal("0"), b -> resetValue())
resetButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.reset"), b -> resetValue())
.bounds(actionStartX, actionY, buttonWidth, BUTTON_HEIGHT)
.build();
this.addRenderableWidget(resetButton);
decrementButton = Button.builder(Component.literal("-0.25"), b ->
decrementButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.decrement"), b ->
slider.decrement()
)
.bounds(
@@ -215,7 +215,7 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
.build();
this.addRenderableWidget(decrementButton);
incrementButton = Button.builder(Component.literal("+0.25"), b ->
incrementButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.increment"), b ->
slider.increment()
)
.bounds(
@@ -235,14 +235,14 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
int totalWidth = buttonWidth * 3 + MARGIN_S * 2;
int scaleStartX = this.leftPos + (this.imageWidth - totalWidth) / 2;
scaleResetButton = Button.builder(Component.literal("1x"), b ->
scaleResetButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.scale_reset"), b ->
applyScale(AdjustmentHelper.DEFAULT_SCALE)
)
.bounds(scaleStartX, scaleY, buttonWidth, BUTTON_HEIGHT)
.build();
this.addRenderableWidget(scaleResetButton);
scaleDecrementButton = Button.builder(Component.literal("-0.1"), b ->
scaleDecrementButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.scale_decrement"), b ->
applyScale(currentScaleValue - AdjustmentHelper.SCALE_STEP)
)
.bounds(
@@ -254,7 +254,7 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
.build();
this.addRenderableWidget(scaleDecrementButton);
scaleIncrementButton = Button.builder(Component.literal("+0.1"), b ->
scaleIncrementButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.scale_increment"), b ->
applyScale(currentScaleValue + AdjustmentHelper.SCALE_STEP)
)
.bounds(

View File

@@ -565,7 +565,7 @@ public class CellManagerScreen extends BaseScreen {
if (cell.prisoners.isEmpty()) {
graphics.drawString(
this.font,
Component.literal(" \u2514\u2500 ")
Component.translatable("gui.tiedup.cell_manager.tree_prefix")
.append(
Component.translatable(
"gui.tiedup.cell_manager.label.empty"

View File

@@ -548,12 +548,9 @@ public class CommandWandScreen extends Screen {
}
private void addFollowDistanceCycleButton(int x, int y, int width) {
String modeText = switch (followDistanceMode) {
case "HEEL" -> "H";
case "CLOSE" -> "C";
case "FAR" -> "F";
default -> "?";
};
Component modeLabel = Component.translatable(
"gui.tiedup.command_wand.follow_distance.abbrev." + followDistanceMode.toLowerCase()
);
Component tooltip = Component.translatable(
"gui.tiedup.command_wand.follow_distance.tooltip"
@@ -571,7 +568,7 @@ public class CommandWandScreen extends Screen {
)
);
Button btn = Button.builder(Component.literal(modeText), b ->
Button btn = Button.builder(modeLabel, b ->
cycleFollowDistance()
)
.bounds(x, y, width, BUTTON_HEIGHT)
@@ -857,7 +854,7 @@ public class CommandWandScreen extends Screen {
) {
graphics.renderTooltip(
this.font,
Component.literal((int) hunger + "%"),
Component.translatable("gui.tiedup.command_wand.percent", (int) hunger),
mouseX,
mouseY
);
@@ -871,7 +868,7 @@ public class CommandWandScreen extends Screen {
) {
graphics.renderTooltip(
this.font,
Component.literal((int) rest + "%"),
Component.translatable("gui.tiedup.command_wand.percent", (int) rest),
mouseX,
mouseY
);

View File

@@ -216,24 +216,24 @@ public class MerchantTradingScreen extends BaseScreen {
int goldIngots = countItemInInventory(player, Items.GOLD_INGOT);
int goldNuggets = countItemInInventory(player, Items.GOLD_NUGGET);
Component goldText = Component.literal("Your Gold: ")
Component goldText = Component.translatable("gui.tiedup.merchant.your_gold")
.append(
Component.literal(goldIngots + "x ").withStyle(style ->
Component.translatable("gui.tiedup.merchant.gold_amount", goldIngots).withStyle(style ->
style.withColor(0xFFFFD700)
)
)
.append(
Component.literal("").withStyle(style ->
Component.translatable("gui.tiedup.merchant.gold_icon").withStyle(style ->
style.withColor(0xFFFFD700)
)
)
.append(
Component.literal("+ " + goldNuggets + "x ").withStyle(
Component.translatable("gui.tiedup.merchant.nugget_amount", goldNuggets).withStyle(
style -> style.withColor(0xFFFFA500)
)
)
.append(
Component.literal("").withStyle(style ->
Component.translatable("gui.tiedup.merchant.nugget_icon").withStyle(style ->
style.withColor(0xFFFFA500)
)
);

View File

@@ -53,7 +53,7 @@ public class NpcInventoryScreen
Inventory playerInventory,
Component title
) {
super(menu, playerInventory, Component.literal(menu.getNpcName()));
super(menu, playerInventory, Component.translatable("gui.tiedup.npc_inventory.title_name", menu.getNpcName()));
// Calculate rows from NPC inventory size
this.npcRows = (menu.getNpcSlotCount() + 8) / 9;

View File

@@ -86,7 +86,7 @@ public class ActionPanel extends AbstractWidget {
private int hoveredIndex = -1;
public ActionPanel(int x, int y, int width, int height) {
super(x, y, width, height, Component.literal("Actions"));
super(x, y, width, height, Component.translatable("gui.tiedup.action_panel"));
}
public void setMode(ScreenMode mode) {

View File

@@ -51,7 +51,7 @@ public class ItemPickerOverlay extends AbstractWidget {
private int screenHeight;
public ItemPickerOverlay() {
super(0, 0, 0, 0, Component.literal("Item Picker"));
super(0, 0, 0, 0, Component.translatable("gui.tiedup.item_picker"));
this.active = false;
this.visible = false;
}

View File

@@ -98,7 +98,7 @@ public class RegionTabBar extends AbstractWidget {
private LivingEntity targetEntity;
public RegionTabBar(int x, int y, int width) {
super(x, y, width, TAB_HEIGHT, Component.literal("Tab Bar"));
super(x, y, width, TAB_HEIGHT, Component.translatable("gui.tiedup.tab_bar.label"));
}
public void setOnTabChanged(Consumer<BodyTab> callback) {

View File

@@ -40,7 +40,7 @@ public class StatusBarWidget extends AbstractWidget {
private static final int CLOSE_BTN_HEIGHT = 22;
public StatusBarWidget(int x, int y, int width, int height) {
super(x, y, width, height, Component.literal("Status Bar"));
super(x, y, width, height, Component.translatable("gui.tiedup.status_bar"));
}
public void setMode(ActionPanel.ScreenMode mode) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

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

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

View File

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

View File

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

View File

@@ -215,7 +215,7 @@ public class MCACompatEvents {
IBondageState state = MCACompat.getKidnappedState(livingTarget);
if (state != null) {
// Priority: Untie > Ungag > Unblindfold > etc.
// This mimics EntityDamsel logic or ItemBind.interactLivingEntity logic for untying
// This mimics EntityDamsel logic or TyingInteractionHelper logic for untying
// No collar ownership check — any player can untie MCA villagers by design
// (MCA villagers use a separate relationship system, not TiedUp collars)

View File

@@ -9,16 +9,32 @@ import net.minecraftforge.common.ForgeConfigSpec;
import org.jetbrains.annotations.Nullable;
/**
* Centralized accessor for mod settings that resolves the GameRules vs ModConfig priority.
* Centralized accessor for all TiedUp! mod settings.
*
* Priority order:
* 1. GameRules (if a world is loaded and rules are available) - these are per-world overrides
* 2. ModConfig (if config is loaded) - these are the user's intended defaults
* 3. Hardcoded fallback - safe defaults if neither system is available yet
* <h2>Three-Tier Resolution</h2>
* <ul>
* <li><b>Tier 1 — GameRules</b> (per-world, overridable via {@code /gamerule}): ~24 settings.
* These take priority when a world is loaded and {@code GameRules} is available.</li>
* <li><b>Tier 2 — ModConfig</b> (server {@code .toml} defaults): ~78+ settings.
* Read via {@link #safeGet} to tolerate early access before the config spec is loaded.</li>
* <li><b>Tier 3 — Hardcoded fallbacks</b>: safe defaults returned when neither Tier 1
* nor Tier 2 is available (e.g., during mod construction).</li>
* </ul>
*
* This class exists because GameRules defaults (set at registration time before config loads)
* can diverge from ModConfig defaults. Without this accessor, ModConfig spawn rate values
* were completely ignored (BUG-001).
* <h2>Rule</h2>
* <p><b>All game code should read settings through this class, never directly from
* {@link ModConfig} or {@link ModGameRules}.</b> This ensures a single choke-point
* for defaults, null-safety, and future GameRule promotion of any setting.</p>
*
* <p>Settings that only exist in ModConfig (no GameRule equivalent) use parameterless
* getters. Settings that have a GameRule override accept a {@code @Nullable GameRules}
* parameter.</p>
*
* <p>Client-side config ({@code ModConfig.CLIENT.*}) is excluded — it is read-only
* and single-source, so no accessor is needed.</p>
*
* @see ModConfig.ServerConfig
* @see ModGameRules
*/
public class SettingsAccessor {
@@ -160,7 +176,7 @@ public class SettingsAccessor {
* <p><b>BUG-003 fix:</b> Previously, {@code IHasResistance.getBaseResistance()}
* called {@code ModGameRules.getResistance()} which only knew 4 types (rope, gag,
* blindfold, collar) and returned hardcoded 100 for the other 10 types. Meanwhile
* the old BindVariant.getResistance() read from ModConfig which had all 14 types.
* the old {@code BindVariant.getResistance()} (now removed) read from ModConfig which had all 14 types.
* This caused a display-vs-struggle desync (display: 250, struggle: 100).
* Now both paths use this method.
*
@@ -531,6 +547,377 @@ public class SettingsAccessor {
);
}
// ==================== Minigame Toggles ====================
/**
* Check if the struggle mini-game is enabled.
* When disabled, struggle actions are rejected or use instant logic.
*
* @return true if the struggle mini-game is enabled (default true)
*/
public static boolean isStruggleMiniGameEnabled() {
return safeGet(() -> ModConfig.SERVER.struggleMiniGameEnabled.get(), true);
}
/**
* Check if the lockpick mini-game is enabled.
* When disabled, lockpick actions are rejected or use instant logic.
*
* @return true if the lockpick mini-game is enabled (default true)
*/
public static boolean isLockpickMiniGameEnabled() {
return safeGet(() -> ModConfig.SERVER.lockpickMiniGameEnabled.get(), true);
}
// ==================== Combat & Weapons ====================
/**
* Get the whip damage amount.
*
* @return Damage as float (default 2.0)
*/
public static float getWhipDamage() {
return safeGet(() -> ModConfig.SERVER.whipDamage.get(), 2.0).floatValue();
}
/**
* Get the resistance decrease per whip hit.
*
* @return Resistance decrease amount (default 15)
*/
public static int getWhipResistanceDecrease() {
return safeGet(() -> ModConfig.SERVER.whipResistanceDecrease.get(), 15);
}
/**
* Get the taser stun effect duration in ticks.
*
* @return Duration in ticks (default 100 = 5 seconds)
*/
public static int getTaserStunDuration() {
return safeGet(() -> ModConfig.SERVER.taserStunDuration.get(), 100);
}
/**
* Get the swim speed multiplier applied to tied players.
*
* @return Multiplier (0.0-1.0, default 0.5)
*/
public static double getTiedSwimSpeedMultiplier() {
return safeGet(() -> ModConfig.SERVER.tiedSwimSpeedMultiplier.get(), 0.5);
}
// ==================== Lockpick ====================
/**
* Get the lockpick success chance (0-100).
*
* @return Success chance percentage (default 25)
*/
public static int getLockpickSuccessChance() {
return safeGet(() -> ModConfig.SERVER.lockpickSuccessChance.get(), 25);
}
/**
* Get the lockpick jam chance (0.0-100.0).
*
* @return Jam chance percentage as double (default 2.5)
*/
public static double getLockpickJamChance() {
return safeGet(() -> ModConfig.SERVER.lockpickJamChance.get(), 2.5);
}
/**
* Get the lockpick break chance (0-100).
*
* @return Break chance percentage (default 15)
*/
public static int getLockpickBreakChance() {
return safeGet(() -> ModConfig.SERVER.lockpickBreakChance.get(), 15);
}
// ==================== Rag ====================
/**
* Get the default rag wet time in ticks.
*
* @return Wet time in ticks (default 6000 = 5 minutes)
*/
public static int getRagWetTime() {
return safeGet(() -> ModConfig.SERVER.ragWetTime.get(), 6000);
}
// ==================== Arrows ====================
/**
* Get the rope arrow bind chance for non-archer shooters (0-100).
*
* @return Bind chance percentage (default 50)
*/
public static int getRopeArrowBindChance() {
return safeGet(() -> ModConfig.SERVER.ropeArrowBindChance.get(), 50);
}
/**
* Get the archer's base bind chance per arrow hit (0-100).
*
* @return Base bind chance percentage (default 10)
*/
public static int getArcherArrowBindChanceBase() {
return safeGet(() -> ModConfig.SERVER.archerArrowBindChanceBase.get(), 10);
}
/**
* Get the additional bind chance per previous hit for archers (0-100).
*
* @return Per-hit chance increase percentage (default 10)
*/
public static int getArcherArrowBindChancePerHit() {
return safeGet(() -> ModConfig.SERVER.archerArrowBindChancePerHit.get(), 10);
}
// ==================== Kidnap Bomb ====================
/**
* Get the kidnap bomb fuse duration in ticks.
*
* @return Fuse in ticks (default 80 = 4 seconds)
*/
public static int getKidnapBombFuse() {
return safeGet(() -> ModConfig.SERVER.kidnapBombFuse.get(), 80);
}
// ==================== Merchant ====================
/**
* Get the merchant hostile cooldown duration in ticks.
*
* @return Duration in ticks (default 6000 = 5 minutes)
*/
public static int getMerchantHostileDuration() {
return safeGet(() -> ModConfig.SERVER.merchantHostileDuration.get(), 6000);
}
/**
* Get the minimum number of random trades a merchant generates.
*
* @return Minimum trade count (default 8)
*/
public static int getMerchantMinTrades() {
return safeGet(() -> ModConfig.SERVER.merchantMinTrades.get(), 8);
}
/**
* Get the maximum number of random trades a merchant generates.
*
* @return Maximum trade count (default 12)
*/
public static int getMerchantMaxTrades() {
return safeGet(() -> ModConfig.SERVER.merchantMaxTrades.get(), 12);
}
/**
* Get the tier 1 minimum price in nuggets.
* @return Min price (default 9)
*/
public static int getTier1PriceMin() {
return safeGet(() -> ModConfig.SERVER.tier1PriceMin.get(), 9);
}
/**
* Get the tier 1 maximum price in nuggets.
* @return Max price (default 18)
*/
public static int getTier1PriceMax() {
return safeGet(() -> ModConfig.SERVER.tier1PriceMax.get(), 18);
}
/**
* Get the tier 2 minimum price in nuggets.
* @return Min price (default 27)
*/
public static int getTier2PriceMin() {
return safeGet(() -> ModConfig.SERVER.tier2PriceMin.get(), 27);
}
/**
* Get the tier 2 maximum price in nuggets.
* @return Max price (default 45)
*/
public static int getTier2PriceMax() {
return safeGet(() -> ModConfig.SERVER.tier2PriceMax.get(), 45);
}
/**
* Get the tier 3 minimum price in nuggets.
* @return Min price (default 54)
*/
public static int getTier3PriceMin() {
return safeGet(() -> ModConfig.SERVER.tier3PriceMin.get(), 54);
}
/**
* Get the tier 3 maximum price in nuggets.
* @return Max price (default 90)
*/
public static int getTier3PriceMax() {
return safeGet(() -> ModConfig.SERVER.tier3PriceMax.get(), 90);
}
/**
* Get the tier 4 minimum price in nuggets.
* @return Min price (default 90)
*/
public static int getTier4PriceMin() {
return safeGet(() -> ModConfig.SERVER.tier4PriceMin.get(), 90);
}
/**
* Get the tier 4 maximum price in nuggets.
* @return Max price (default 180)
*/
public static int getTier4PriceMax() {
return safeGet(() -> ModConfig.SERVER.tier4PriceMax.get(), 180);
}
// ==================== Dialogue ====================
/**
* Get the dialogue broadcast radius in blocks.
*
* @return Radius in blocks (default 20)
*/
public static int getDialogueRadius() {
return safeGet(() -> ModConfig.SERVER.dialogueRadius.get(), 20);
}
/**
* Get the dialogue cooldown in ticks.
*
* @return Cooldown in ticks (default 100 = 5 seconds)
*/
public static int getDialogueCooldown() {
return safeGet(() -> ModConfig.SERVER.dialogueCooldown.get(), 100);
}
// ==================== Labor ====================
/**
* Get the labor rest duration in seconds.
*
* @return Rest duration in seconds (default 120)
*/
public static int getLaborRestSeconds() {
return safeGet(() -> ModConfig.SERVER.laborRestSeconds.get(), 120);
}
// ==================== Solo Mode / Master Spawn ====================
/**
* Check if Master NPC spawning is enabled.
*
* @return true if Master can spawn (default true)
*/
public static boolean isEnableMasterSpawn() {
return safeGet(() -> ModConfig.SERVER.enableMasterSpawn.get(), true);
}
/**
* Check if solo mode fallback behavior is enabled.
* When enabled, kidnappers in solo worlds use alternative captive handling.
*
* @return true if solo fallback is enabled (default true)
*/
public static boolean isEnableSoloFallback() {
return safeGet(() -> ModConfig.SERVER.enableSoloFallback.get(), true);
}
/**
* Get the solo mode timeout in seconds before the kidnapper gives up waiting.
*
* @return Timeout in seconds (default 120)
*/
public static int getSoloTimeoutSeconds() {
return safeGet(() -> ModConfig.SERVER.soloTimeoutSeconds.get(), 120);
}
/**
* Get the probability (0.0-1.0) that a kidnapper keeps the captive in solo mode.
*
* @return Keep chance (default 0.6)
*/
public static double getSoloKeepChance() {
return safeGet(() -> ModConfig.SERVER.soloKeepChance.get(), 0.6);
}
// ==================== Abandon Behavior ====================
/**
* Check if kidnapper abandonment keeps the blindfold on the captive.
*
* @return true if blindfold is kept (default true)
*/
public static boolean isAbandonKeepsBlindfold() {
return safeGet(() -> ModConfig.SERVER.abandonKeepsBlindfold.get(), true);
}
/**
* Check if kidnapper abandonment keeps binds on the captive.
*
* @return true if binds are kept (default true)
*/
public static boolean isAbandonKeepsBinds() {
return safeGet(() -> ModConfig.SERVER.abandonKeepsBinds.get(), true);
}
// ==================== Gag Settings ====================
/**
* Get the configured comprehension factor for a gag material.
* Falls back to the material's hardcoded default if the config key is missing.
*
* @param materialKey Lowercase gag material name (e.g., "cloth", "ball")
* @param defaultValue The material's built-in default comprehension
* @return Comprehension factor as float
*/
public static float getGagComprehension(String materialKey, float defaultValue) {
return safeGet(
() -> {
if (ModConfig.SERVER == null) return defaultValue;
Map<String, ForgeConfigSpec.DoubleValue> map =
ModConfig.SERVER.gagComprehension;
if (map != null && map.containsKey(materialKey)) {
return map.get(materialKey).get().floatValue();
}
return defaultValue;
},
defaultValue
);
}
/**
* Get the configured talk range for a gag material.
* Falls back to the material's hardcoded default if the config key is missing.
*
* @param materialKey Lowercase gag material name (e.g., "cloth", "ball")
* @param defaultValue The material's built-in default talk range
* @return Talk range as double
*/
public static double getGagTalkRange(String materialKey, double defaultValue) {
return safeGet(
() -> {
if (ModConfig.SERVER == null) return defaultValue;
Map<String, ForgeConfigSpec.DoubleValue> map =
ModConfig.SERVER.gagRange;
if (map != null && map.containsKey(materialKey)) {
return map.get(materialKey).get();
}
return defaultValue;
},
defaultValue
);
}
// ==================== Helpers ====================
/**

View File

@@ -138,120 +138,17 @@ public class SystemMessageManager {
ERROR, // Generic error
}
// MESSAGE TEMPLATES
// TRANSLATION KEYS
/**
* Get the raw message template for a category.
* Use this when you need to customize the message.
* Get the translation key for a category.
* Keys follow the pattern: msg.tiedup.system.&lt;category_lowercase&gt;
*
* @param category The message category
* @return The template string (may contain %s placeholders)
* @return The translation key (for use with Component.translatable)
*/
public static String getTemplate(MessageCategory category) {
return getMessageTemplate(category);
}
/**
* Get message template for a category.
* Use %s for entity name placeholder.
*/
private static String getMessageTemplate(MessageCategory category) {
return switch (category) {
// Restraint actions
case BEING_TIED -> "%s is tying you up!";
case TIED_UP -> "%s tied you up, you can't move!";
case BEING_GAGGED -> "%s is gagging you!";
case GAGGED -> "%s gagged you, you can't speak!";
case BEING_BLINDFOLDED -> "%s is blindfolding you!";
case BLINDFOLDED -> "%s blindfolded you, you can't see!";
case BEING_COLLARED -> "%s is putting a collar on you!";
case COLLARED -> "%s collared you!";
case EARPLUGS_ON -> "%s put earplugs on you!";
case MITTENS_ON -> "%s put mittens on you!";
case ENSLAVED -> "You have been enslaved by %s!";
// Restraint actions (kidnapper's perspective)
case TYING_TARGET -> "You are tying %s...";
case TIED_TARGET -> "You tied %s!";
case GAGGING_TARGET -> "You are gagging %s...";
case GAGGED_TARGET -> "You gagged %s!";
case BLINDFOLDING_TARGET -> "You are blindfolding %s...";
case BLINDFOLDED_TARGET -> "You blindfolded %s!";
case COLLARING_TARGET -> "You are collaring %s...";
case COLLARED_TARGET -> "You collared %s!";
// Release actions
case UNTIED -> "%s untied you!";
case UNGAGGED -> "%s removed your gag!";
case UNBLINDFOLDED -> "%s removed your blindfold!";
case UNCOLLARED -> "%s removed your collar!";
case FREED -> "You have been freed!";
// Struggle
case STRUGGLE_SUCCESS -> "You feel the ropes loosening...";
case STRUGGLE_FAIL -> "You struggle against the ropes, but they hold tight.";
case STRUGGLE_BROKE_FREE -> "You broke free!";
case STRUGGLE_SHOCKED -> "You were shocked for struggling!";
case STRUGGLE_COLLAR_SUCCESS -> "You manage to damage the lock!";
case STRUGGLE_COLLAR_FAIL -> "You try to reach the lock, but can't get a good grip.";
// Restrictions (Tied)
case CANT_MOVE -> "You can't move while tied!";
case CANT_ATTACK_TIED -> "You can't attack while tied!";
case CANT_USE_ITEM_TIED -> "You can't use items while tied!";
case CANT_OPEN_INVENTORY -> "You can't open inventory while tied!";
case CANT_INTERACT_TIED -> "You can't interact while tied!";
case CANT_SPEAK -> "You can't speak while gagged!";
case CANT_SEE -> "You can't see while blindfolded!";
case CANT_BREAK_TIED -> "You can't break blocks while tied!";
case CANT_PLACE_TIED -> "You can't place blocks while tied!";
case NO_ELYTRA -> "You can't fly with elytra while tied!";
// Restrictions (Mittens)
case CANT_ATTACK_MITTENS -> "You can't attack with mittens on!";
case CANT_USE_ITEM_MITTENS -> "You can't use items with mittens on!";
case CANT_INTERACT_MITTENS -> "You can't interact with mittens on!";
case CANT_BREAK_MITTENS -> "You can't break blocks with mittens on!";
case CANT_PLACE_MITTENS -> "You can't place blocks with mittens on!";
// Slave system
case SLAVE_COMMAND -> "Your master commands: %s";
case SLAVE_SHOCK -> "You've been shocked!";
case GPS_ZONE_VIOLATION -> "You've been shocked! Return back to your allowed area!";
case GPS_OWNER_ALERT -> "ALERT: %s is outside the safe zone!";
case SLAVE_JOB_ASSIGNED -> "Job assigned: bring %s";
case SLAVE_JOB_COMPLETE -> "Job complete! You are free.";
case SLAVE_JOB_FAILED -> "Job failed!";
case SLAVE_JOB_LAST_CHANCE -> "LAST CHANCE! Next failure means death!";
case SLAVE_JOB_KILLED -> "You were executed for failing your task.";
// Tighten
case BINDS_TIGHTENED -> "%s tightened your binds!";
// Tools & Items
case KEY_CLAIMED -> "Key claimed and linked to %s!";
case KEY_NOT_OWNER -> "You don't own this key!";
case KEY_WRONG_TARGET -> "This key doesn't fit this collar!";
case LOCATOR_CLAIMED -> "Locator claimed!";
case LOCATOR_NOT_OWNER -> "You don't own this locator!";
case LOCATOR_DETECTED -> "Target detected: %s";
case SHOCKER_CLAIMED -> "Shocker claimed!";
case SHOCKER_NOT_OWNER -> "You don't own this shocker!";
case SHOCKER_MODE_SET -> "Shocker mode: %s";
case SHOCKER_TRIGGERED -> "Shocked %s!";
case RAG_DRY -> "The rag is dry - soak it first";
case RAG_SOAKED -> "You soaked the rag with chloroform";
case RAG_EVAPORATED -> "The chloroform has evaporated";
// Bounty
case BOUNTY_CREATED -> "Bounty created on %s!";
case BOUNTY_CLAIMED -> "You claimed the bounty on %s!";
case BOUNTY_EXPIRED -> "Bounty on %s expired";
// Cell System
case PRISONER_ARRIVED -> "%s has been placed in your cell";
case PRISONER_ESCAPED -> "%s has escaped from your cell!";
case PRISONER_RELEASED -> "%s has been released from your cell";
case CELL_BREACH -> "Your cell wall has been breached!";
case CELL_ASSIGNED -> "You have been assigned to %s's cell";
case CELL_CREATED -> "Cell created successfully";
case CELL_DELETED -> "Cell deleted";
case CELL_RENAMED -> "Cell renamed to: %s";
// Generic
case INFO -> "%s";
case WARNING -> "%s";
case ERROR -> "%s";
};
public static String getTranslationKey(MessageCategory category) {
return "msg.tiedup.system." + category.name().toLowerCase();
}
/**
@@ -373,11 +270,11 @@ public class SystemMessageManager {
/**
* Send a system message to a player's action bar.
* Uses category template with entity name.
* Uses translatable category with entity name as argument.
*
* @param player The player to send to
* @param category The message category
* @param actor The entity performing the action (for %s replacement)
* @param actor The entity performing the action (for %1$s replacement)
*/
public static void sendToPlayer(
Player player,
@@ -387,14 +284,23 @@ public class SystemMessageManager {
if (player == null) return;
String actorName = actor != null ? getEntityName(actor) : "Someone";
String message = String.format(getMessageTemplate(category), actorName);
MutableComponent component = Component.translatable(
getTranslationKey(category), actorName
).withStyle(style -> style.withColor(getCategoryColor(category)));
sendToPlayer(player, message, getCategoryColor(category));
player.displayClientMessage(component, true);
TiedUpMod.LOGGER.debug(
"[SystemMessage] -> {}: {} ({})",
player.getName().getString(),
getTranslationKey(category),
actorName
);
}
/**
* Send a system message to a player's action bar.
* Uses category template without entity (for messages that don't need one).
* Uses translatable category without arguments.
*
* @param player The player to send to
* @param category The message category
@@ -402,12 +308,22 @@ public class SystemMessageManager {
public static void sendToPlayer(Player player, MessageCategory category) {
if (player == null) return;
String message = getMessageTemplate(category);
sendToPlayer(player, message, getCategoryColor(category));
MutableComponent component = Component.translatable(
getTranslationKey(category)
).withStyle(style -> style.withColor(getCategoryColor(category)));
player.displayClientMessage(component, true);
TiedUpMod.LOGGER.debug(
"[SystemMessage] -> {}: {}",
player.getName().getString(),
getTranslationKey(category)
);
}
/**
* Send a custom system message to a player's action bar.
* Uses literal text (for dynamic/non-translatable messages).
*
* @param player The player to send to
* @param message The message to send
@@ -420,12 +336,10 @@ public class SystemMessageManager {
) {
if (player == null || message == null) return;
// Works on both client and server
MutableComponent component = Component.literal(message).withStyle(
style -> style.withColor(color)
);
// true = action bar (above hotbar), false = chat
player.displayClientMessage(component, true);
TiedUpMod.LOGGER.debug(
@@ -437,6 +351,7 @@ public class SystemMessageManager {
/**
* Send a custom system message to a player's CHAT.
* Uses literal text (for dynamic/non-translatable messages).
*
* @param player The player to send to
* @param message The message to send
@@ -453,7 +368,6 @@ public class SystemMessageManager {
style -> style.withColor(color)
);
// false = chat
player.displayClientMessage(component, false);
TiedUpMod.LOGGER.debug(
@@ -464,19 +378,21 @@ public class SystemMessageManager {
}
/**
* Send a system message to a player's CHAT using a category.
* Send a system message to a player's CHAT using a translatable category.
*/
public static void sendChatToPlayer(
Player player,
MessageCategory category
) {
if (player == null) return;
String message = getMessageTemplate(category);
sendChatToPlayer(player, message, getCategoryColor(category));
MutableComponent component = Component.translatable(
getTranslationKey(category)
).withStyle(style -> style.withColor(getCategoryColor(category)));
player.displayClientMessage(component, false);
}
/**
* Send a system message to a player's CHAT using a category and actor.
* Send a system message to a player's CHAT using a translatable category and actor.
*/
public static void sendChatToPlayer(
Player player,
@@ -485,8 +401,10 @@ public class SystemMessageManager {
) {
if (player == null) return;
String actorName = actor != null ? getEntityName(actor) : "Someone";
String message = String.format(getMessageTemplate(category), actorName);
sendChatToPlayer(player, message, getCategoryColor(category));
MutableComponent component = Component.translatable(
getTranslationKey(category), actorName
).withStyle(style -> style.withColor(getCategoryColor(category)));
player.displayClientMessage(component, false);
}
/**
@@ -494,7 +412,7 @@ public class SystemMessageManager {
*
* @param player The player to send to
* @param category The category (for color)
* @param customMessage The custom message text
* @param customMessage The custom message text (literal, not translatable)
*/
public static void sendToPlayer(
Player player,
@@ -505,7 +423,27 @@ public class SystemMessageManager {
}
/**
* Send a message with resistance info appended.
* Send a translatable message with string arguments.
* Uses the category's translation key and color.
*
* @param player The player to send to
* @param category The message category
* @param args Arguments for the translation (replaces %1$s, %2$s, etc.)
*/
public static void sendTranslatable(
Player player,
MessageCategory category,
Object... args
) {
if (player == null) return;
MutableComponent component = Component.translatable(
getTranslationKey(category), args
).withStyle(style -> style.withColor(getCategoryColor(category)));
player.displayClientMessage(component, true);
}
/**
* Send a translatable message with resistance info appended.
*
* @param player The player to send to
* @param category The message category
@@ -518,9 +456,13 @@ public class SystemMessageManager {
) {
if (player == null) return;
String message =
getMessageTemplate(category) + " (Resistance: " + resistance + ")";
sendToPlayer(player, message, getCategoryColor(category));
MutableComponent component = Component.translatable(
getTranslationKey(category)
).append(
Component.translatable("msg.tiedup.system.resistance_suffix", resistance)
).withStyle(style -> style.withColor(getCategoryColor(category)));
player.displayClientMessage(component, true);
}
// SEND METHODS - TO NEARBY PLAYERS
@@ -695,15 +637,10 @@ public class SystemMessageManager {
*/
public static void sendJobAssigned(Player player, String itemName) {
if (player == null) return;
String message = String.format(
getMessageTemplate(MessageCategory.SLAVE_JOB_ASSIGNED),
itemName
);
sendToPlayer(
player,
message,
getCategoryColor(MessageCategory.SLAVE_JOB_ASSIGNED)
);
MutableComponent component = Component.translatable(
getTranslationKey(MessageCategory.SLAVE_JOB_ASSIGNED), itemName
).withStyle(style -> style.withColor(getCategoryColor(MessageCategory.SLAVE_JOB_ASSIGNED)));
player.displayClientMessage(component, true);
}
// UTILITY

View File

@@ -581,6 +581,14 @@ public class TiedUpMod {
LOGGER.info(
"Registered FurnitureServerReloadListener for data-driven furniture definitions"
);
// Data-driven room theme definitions (server-side, from data/<namespace>/tiedup_room_themes/)
event.addListener(
new com.tiedup.remake.worldgen.RoomThemeReloadListener()
);
LOGGER.info(
"Registered RoomThemeReloadListener for data-driven room themes"
);
}
}
}

View File

@@ -51,7 +51,7 @@ public class PetRequestManager {
double dist = master.distanceTo(pet);
if (dist > MAX_DISTANCE) {
pet.sendSystemMessage(
Component.literal("You are too far from your Master to talk.")
Component.translatable("entity.tiedup.pet.too_far_to_talk")
);
return;
}
@@ -95,7 +95,7 @@ public class PetRequestManager {
double dist = master.distanceTo(pet);
if (dist > MAX_DISTANCE) {
pet.sendSystemMessage(
Component.literal("You are too far from your Master.")
Component.translatable("entity.tiedup.pet.too_far_from_master")
);
return;
}
@@ -109,7 +109,7 @@ public class PetRequestManager {
// Display what the player "says"
pet.sendSystemMessage(
Component.literal("You: " + request.getPlayerText())
Component.translatable("entity.tiedup.pet.you_say", request.getPlayerText())
);
// Handle specific request

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.dialogue.EntityDialogueManager;
import java.util.UUID;
@@ -179,7 +179,7 @@ public class DamselRewardTracker {
// Thank the savior via dialogue
damsel.talkToPlayersInRadius(
EntityDialogueManager.DialogueCategory.DAMSEL_FREED,
ModConfig.SERVER.dialogueRadius.get()
SettingsAccessor.getDialogueRadius()
);
TiedUpMod.LOGGER.info(

View File

@@ -644,8 +644,8 @@ public class EntityDamsel
player instanceof net.minecraft.server.level.ServerPlayer sp
) {
sp.displayClientMessage(
Component.literal(
"This NPC needs a collar before you can feed them."
Component.translatable(
"entity.tiedup.damsel.needs_collar_to_feed"
).withStyle(ChatFormatting.RED),
true
);
@@ -660,8 +660,8 @@ public class EntityDamsel
net.minecraft.server.level.ServerPlayer sp
) {
sp.displayClientMessage(
Component.literal(
"You don't own this NPC's collar."
Component.translatable(
"entity.tiedup.damsel.not_collar_owner"
).withStyle(ChatFormatting.RED),
true
);
@@ -675,8 +675,8 @@ public class EntityDamsel
player instanceof net.minecraft.server.level.ServerPlayer sp
) {
sp.displayClientMessage(
Component.literal(
"This NPC can't eat that right now."
Component.translatable(
"entity.tiedup.damsel.cant_eat_now"
).withStyle(ChatFormatting.RED),
true
);

View File

@@ -1,7 +1,6 @@
package com.tiedup.remake.entities;
import com.tiedup.remake.blocks.entity.KidnapBombBlockEntity;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.util.KidnapExplosion;
import javax.annotation.Nullable;
@@ -56,7 +55,7 @@ public class EntityKidnapBomb extends PrimedTnt {
this.setPos(x, y, z);
double d0 = level.random.nextDouble() * (Math.PI * 2);
this.setDeltaMovement(-Math.sin(d0) * 0.02, 0.2, -Math.cos(d0) * 0.02);
this.setFuse(ModConfig.SERVER.kidnapBombFuse.get());
this.setFuse(SettingsAccessor.getKidnapBombFuse());
this.xo = x;
this.yo = y;

View File

@@ -335,9 +335,9 @@ public class EntityKidnapperArcher
public int getBindChanceForTarget(UUID targetUUID) {
int hitCount = targetHitCounts.getOrDefault(targetUUID, 0);
int baseChance =
com.tiedup.remake.core.ModConfig.SERVER.archerArrowBindChanceBase.get();
SettingsAccessor.getArcherArrowBindChanceBase();
int perHitChance =
com.tiedup.remake.core.ModConfig.SERVER.archerArrowBindChancePerHit.get();
SettingsAccessor.getArcherArrowBindChancePerHit();
int chance = baseChance + (hitCount * perHitChance);
return Math.min(chance, ARCHER_MAX_BIND_CHANCE);

View File

@@ -2,7 +2,6 @@ package com.tiedup.remake.entities;
import static com.tiedup.remake.util.GameConstants.*;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.dialogue.SpeakerType;
@@ -356,7 +355,7 @@ public class EntityKidnapperMerchant extends EntityKidnapperElite {
private void transitionToHostile(LivingEntity attacker) {
currentState = MerchantState.HOSTILE;
attackerUUID = attacker.getUUID();
hostileCooldownTicks = ModConfig.SERVER.merchantHostileDuration.get();
hostileCooldownTicks = SettingsAccessor.getMerchantHostileDuration();
entityData.set(DATA_MERCHANT_STATE, MerchantState.HOSTILE.getId());
// Equip kidnapper items
@@ -536,8 +535,8 @@ public class EntityKidnapperMerchant extends EntityKidnapperElite {
addGuaranteedUtilities();
// RANDOM TRADES
int min = ModConfig.SERVER.merchantMinTrades.get();
int max = ModConfig.SERVER.merchantMaxTrades.get();
int min = SettingsAccessor.getMerchantMinTrades();
int max = SettingsAccessor.getMerchantMaxTrades();
int count = min + this.random.nextInt(Math.max(1, max - min + 1));
// Collect all mod items
@@ -644,21 +643,21 @@ public class EntityKidnapperMerchant extends EntityKidnapperElite {
int minPrice, maxPrice;
switch (tier) {
case 4:
minPrice = ModConfig.SERVER.tier4PriceMin.get();
maxPrice = ModConfig.SERVER.tier4PriceMax.get();
minPrice = SettingsAccessor.getTier4PriceMin();
maxPrice = SettingsAccessor.getTier4PriceMax();
break;
case 3:
minPrice = ModConfig.SERVER.tier3PriceMin.get();
maxPrice = ModConfig.SERVER.tier3PriceMax.get();
minPrice = SettingsAccessor.getTier3PriceMin();
maxPrice = SettingsAccessor.getTier3PriceMax();
break;
case 2:
minPrice = ModConfig.SERVER.tier2PriceMin.get();
maxPrice = ModConfig.SERVER.tier2PriceMax.get();
minPrice = SettingsAccessor.getTier2PriceMin();
maxPrice = SettingsAccessor.getTier2PriceMax();
break;
case 1:
default:
minPrice = ModConfig.SERVER.tier1PriceMin.get();
maxPrice = ModConfig.SERVER.tier1PriceMax.get();
minPrice = SettingsAccessor.getTier1PriceMin();
maxPrice = SettingsAccessor.getTier1PriceMax();
break;
}

View File

@@ -341,7 +341,7 @@ public class EntityLaborGuard extends EntityDamsel {
}
prisoner.sendSystemMessage(
Component.literal("Attacking your guard is punished!").withStyle(
Component.translatable("entity.tiedup.guard.attack_punished").withStyle(
ChatFormatting.DARK_RED
)
);
@@ -529,8 +529,8 @@ public class EntityLaborGuard extends EntityDamsel {
.getPlayer(prisonerUUID);
if (prisoner != null) {
prisoner.sendSystemMessage(
Component.literal(
"Your guard has been eliminated! You are free!"
Component.translatable(
"entity.tiedup.guard.eliminated_free"
).withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD)
);
}

View File

@@ -447,8 +447,8 @@ public class EntityMaid extends EntityKidnapperElite {
player.position().distanceTo(this.position()) <= 50
) {
player.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"The maid has died. Work is paused. A replacement will arrive in 5 minutes."
net.minecraft.network.chat.Component.translatable(
"entity.tiedup.maid.died_work_paused"
).withStyle(net.minecraft.ChatFormatting.GOLD)
);
}

View File

@@ -606,8 +606,8 @@ public class EntityMaster extends EntityKidnapperElite {
// Send warning message to pet
pet.sendSystemMessage(
Component.literal(
this.getNpcName() + " caught you trying to escape!"
Component.translatable(
"entity.tiedup.master.caught_escaping", this.getNpcName()
).withStyle(Style.EMPTY.withColor(MASTER_NAME_COLOR))
);
}

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.ModItems;
import com.tiedup.remake.state.IBondageState;
@@ -87,7 +87,7 @@ public class EntityRopeArrow extends AbstractArrow {
bindChance = archer.getBindChanceForTarget(target.getUUID());
} else {
// Other shooters: default 50% chance
bindChance = ModConfig.SERVER.ropeArrowBindChance.get();
bindChance = SettingsAccessor.getRopeArrowBindChance();
}
// Roll for bind chance

View File

@@ -200,8 +200,8 @@ public class EntitySlaveTrader extends EntityKidnapperElite {
Component.literal("[" + this.getNpcName() + "] ")
.withStyle(Style.EMPTY.withColor(TRADER_NAME_COLOR))
.append(
Component.literal(
"You don't have a trader token. Leave now, or I'll make you leave."
Component.translatable(
"entity.tiedup.trader.no_token_warning"
).withStyle(ChatFormatting.RED)
)
);
@@ -711,8 +711,8 @@ public class EntitySlaveTrader extends EntityKidnapperElite {
ServerLevel level,
BlockPos campCenter
) {
Component message = Component.literal(
"A slave trader camp has been destroyed!"
Component message = Component.translatable(
"entity.tiedup.trader.camp_destroyed"
).withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD);
// Send to all players within 200 blocks

View File

@@ -93,15 +93,15 @@ public class MerchantTrade {
*/
public Component getPriceDisplay() {
if (ingotPrice > 0 && nuggetPrice > 0) {
return Component.literal(
ingotPrice + " gold + " + nuggetPrice + " nuggets"
return Component.translatable(
"entity.tiedup.trade.price_both", ingotPrice, nuggetPrice
);
} else if (ingotPrice > 0) {
return Component.literal(ingotPrice + " gold");
return Component.translatable("entity.tiedup.trade.price_gold", ingotPrice);
} else if (nuggetPrice > 0) {
return Component.literal(nuggetPrice + " nuggets");
return Component.translatable("entity.tiedup.trade.price_nuggets", nuggetPrice);
} else {
return Component.literal("Free");
return Component.translatable("entity.tiedup.trade.price_free");
}
}

View File

@@ -202,8 +202,8 @@ public class GuardMonitorGoal extends Goal {
);
prisoner.sendSystemMessage(
Component.literal(
"You are too far from your guard! Return within 15 seconds or escape will be triggered!"
Component.translatable(
"goal.tiedup.guard_monitor.too_far"
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
);
@@ -227,8 +227,8 @@ public class GuardMonitorGoal extends Goal {
);
prisoner.sendSystemMessage(
Component.literal(
"You returned to your guard. Stay close!"
Component.translatable(
"goal.tiedup.guard_monitor.returned"
).withStyle(ChatFormatting.YELLOW)
);
}

View File

@@ -604,8 +604,8 @@ public class KidnapperDecideNextActionGoal extends Goal {
);
player.sendSystemMessage(
Component.literal(
"You're still tied up - struggle to break free!"
Component.translatable(
"goal.tiedup.kidnapper_decide.still_tied"
).withStyle(ChatFormatting.YELLOW)
);

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities.ai.kidnapper;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.dialogue.EntityDialogueManager;
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
@@ -155,7 +155,7 @@ public class KidnapperWaitForBuyerGoal extends Goal {
// Check if Master should spawn immediately for solo player
IRestrainable captive = this.kidnapper.getCaptive();
boolean isMasterEnabled = ModConfig.SERVER.enableMasterSpawn.get();
boolean isMasterEnabled = SettingsAccessor.isEnableMasterSpawn();
boolean isPlayer =
captive != null && captive.asLivingEntity() instanceof Player;
@@ -171,12 +171,12 @@ public class KidnapperWaitForBuyerGoal extends Goal {
// Don't return - let the goal continue so kidnapper waits for Master
// The wait duration is set to allow Master to arrive
this.waitDuration = 6000; // 5 minutes max wait for Master to arrive
} else if (this.soloMode && ModConfig.SERVER.enableSoloFallback.get()) {
} else if (this.soloMode && SettingsAccessor.isEnableSoloFallback()) {
// Solo mode (non-player captive): use config timeout
this.waitDuration = ModConfig.SERVER.soloTimeoutSeconds.get() * 20;
this.waitDuration = SettingsAccessor.getSoloTimeoutSeconds() * 20;
TiedUpMod.LOGGER.debug(
"[KidnapperWaitForBuyerGoal] Solo mode detected, using {}s timeout",
ModConfig.SERVER.soloTimeoutSeconds.get()
SettingsAccessor.getSoloTimeoutSeconds()
);
} else {
// Normal mode: random 5-8 minutes
@@ -351,14 +351,14 @@ public class KidnapperWaitForBuyerGoal extends Goal {
);
Component announcement = Component.literal("")
.append(Component.literal("[SALE] ").withStyle(ChatFormatting.GOLD))
.append(Component.translatable("goal.tiedup.kidnapper_sale.tag").withStyle(ChatFormatting.GOLD))
.append(
Component.literal(this.kidnapper.getNpcName()).withStyle(
ChatFormatting.RED
)
)
.append(
Component.literal(" is selling ").withStyle(
Component.translatable("goal.tiedup.kidnapper_sale.is_selling").withStyle(
ChatFormatting.YELLOW
)
)
@@ -367,13 +367,13 @@ public class KidnapperWaitForBuyerGoal extends Goal {
ChatFormatting.AQUA
)
)
.append(Component.literal(" for ").withStyle(ChatFormatting.YELLOW))
.append(Component.translatable("goal.tiedup.kidnapper_sale.for").withStyle(ChatFormatting.YELLOW))
.append(
Component.literal(price.toDisplayString()).withStyle(
ChatFormatting.GREEN
)
)
.append(Component.literal(" at ").withStyle(ChatFormatting.YELLOW))
.append(Component.translatable("goal.tiedup.kidnapper_sale.at").withStyle(ChatFormatting.YELLOW))
.append(
Component.literal(location).withStyle(ChatFormatting.WHITE)
);
@@ -426,7 +426,7 @@ public class KidnapperWaitForBuyerGoal extends Goal {
}
// Handle solo mode fallback
if (this.soloMode && ModConfig.SERVER.enableSoloFallback.get()) {
if (this.soloMode && SettingsAccessor.isEnableSoloFallback()) {
handleSoloModeFallback(captive);
} else {
// Normal multiplayer mode: just flee
@@ -450,7 +450,7 @@ public class KidnapperWaitForBuyerGoal extends Goal {
}
// Check if Master spawn is enabled and captive is a player
boolean isMasterEnabled = ModConfig.SERVER.enableMasterSpawn.get();
boolean isMasterEnabled = SettingsAccessor.isEnableMasterSpawn();
boolean isPlayer = captive.asLivingEntity() instanceof Player;
if (isMasterEnabled && isPlayer) {
@@ -460,7 +460,7 @@ public class KidnapperWaitForBuyerGoal extends Goal {
}
// Fallback to original behavior
double keepChance = ModConfig.SERVER.soloKeepChance.get();
double keepChance = SettingsAccessor.getSoloKeepChance();
double roll = this.kidnapper.getRandom().nextDouble();
TiedUpMod.LOGGER.debug(

View File

@@ -331,9 +331,9 @@ public class MaidDeliverCaptiveGoal extends Goal {
buyerEntity.getName().getString()
);
buyerEntity.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
captiveEntity.getName().getString() +
" is now on your leash."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_deliver.on_leash",
captiveEntity.getName().getString()
).withStyle(net.minecraft.ChatFormatting.GREEN)
);
} else {
@@ -342,9 +342,9 @@ public class MaidDeliverCaptiveGoal extends Goal {
);
kidnappedState.free(true);
buyerEntity.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
captiveEntity.getName().getString() +
" has been delivered to you."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_deliver.delivered",
captiveEntity.getName().getString()
).withStyle(net.minecraft.ChatFormatting.GREEN)
);
}

View File

@@ -2,7 +2,7 @@ package com.tiedup.remake.entities.ai.maid.goals;
import com.tiedup.remake.cells.CellDataV2;
import com.tiedup.remake.cells.CellRegistryV2;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.EntityMaid;
import com.tiedup.remake.labor.LaborTask;
@@ -87,7 +87,7 @@ public class MaidAssignTaskGoal extends Goal {
if (phase == LaborRecord.WorkPhase.RESTING) {
// Check if rest is complete (config: laborRestSeconds, default 120s)
long restTicks = ModConfig.SERVER.laborRestSeconds.get() * 20L;
long restTicks = SettingsAccessor.getLaborRestSeconds() * 20L;
long elapsed = labor.getTimeInPhase(currentTime);
if (elapsed >= restTicks) {
labor.finishRest(currentTime);
@@ -200,13 +200,13 @@ public class MaidAssignTaskGoal extends Goal {
// Notify prisoner
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Task assigned: " + task.getDescription()
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_assign.task_assigned", task.getDescription()
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Reward: " + task.getValue() + " emeralds toward your debt."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_assign.task_reward", task.getValue()
).withStyle(net.minecraft.ChatFormatting.GRAY)
);
@@ -289,8 +289,8 @@ public class MaidAssignTaskGoal extends Goal {
}
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Your debt is paid. You are FREE!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid.debt_paid_free"
).withStyle(
net.minecraft.ChatFormatting.GREEN,
net.minecraft.ChatFormatting.BOLD

View File

@@ -346,9 +346,9 @@ public class MaidExtractGoal extends Goal {
// 7. Notify prisoner
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"You have been extracted for labor. Complete your task: " +
task.getDescription()
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_extract.extracted",
task.getDescription()
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);

View File

@@ -146,8 +146,8 @@ public class MaidIdleGoal extends Goal {
labor.completeTask(currentTime);
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Task complete! Walk back to camp."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_idle.task_complete"
).withStyle(net.minecraft.ChatFormatting.GREEN)
);
@@ -207,17 +207,16 @@ public class MaidIdleGoal extends Goal {
// Max punishment - fail task
labor.failTask(currentTime);
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Task failed due to inactivity! You will be returned to your cell."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_idle.task_failed"
).withStyle(net.minecraft.ChatFormatting.RED)
);
} else {
// Warning
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Warning: Work or face punishment! (" +
shockLevel +
"/3)"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_idle.inactivity_warning",
shockLevel
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);

View File

@@ -165,18 +165,16 @@ public class MaidInitPrisonerGoal extends Goal {
// 6. Notify prisoner
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
String.format(
"You have been imprisoned. Your debt: %d emeralds.",
totalRansom
)
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_init.imprisoned",
totalRansom
).withStyle(net.minecraft.ChatFormatting.RED)
);
if (!confiscated.isEmpty()) {
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Your valuables have been confiscated."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_init.confiscated"
).withStyle(net.minecraft.ChatFormatting.GRAY)
);
}

View File

@@ -671,8 +671,8 @@ public class MaidReturnGoal extends Goal {
}
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Your debt is paid. You are FREE!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid.debt_paid_free"
).withStyle(
net.minecraft.ChatFormatting.GREEN,
net.minecraft.ChatFormatting.BOLD

View File

@@ -124,11 +124,10 @@ public class MasterInventoryInspectGoal extends Goal {
ServerPlayer pet = master.getPetPlayer();
if (pet != null && !confiscatedItems.isEmpty()) {
pet.sendSystemMessage(
Component.literal(
master.getNpcName() +
" confiscated " +
confiscatedItems.size() +
" contraband item(s) from you!"
Component.translatable(
"goal.tiedup.master_inspect.confiscated",
master.getNpcName(),
confiscatedItems.size()
).withStyle(
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
)
@@ -180,8 +179,8 @@ public class MasterInventoryInspectGoal extends Goal {
*/
private void performInspection(ServerPlayer pet) {
pet.sendSystemMessage(
Component.literal(
master.getNpcName() + " is inspecting your inventory..."
Component.translatable(
"goal.tiedup.master_inspect.inspecting", master.getNpcName()
).withStyle(Style.EMPTY.withColor(0xFFFF00))
);

View File

@@ -331,8 +331,8 @@ public class MasterTaskAssignGoal extends Goal {
// FIX: Use MessageDispatcher for consistency with earplug system
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"" + message + "\""
Component.translatable(
"goal.tiedup.master_assign.task_speech", master.getNpcName(), message
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
);

View File

@@ -269,8 +269,8 @@ public class MasterTaskWatchGoal extends Goal {
if (remainingSec > 0) {
MessageDispatcher.sendActionBar(
pet,
Component.literal(
task.name() + " - " + remainingSec + "s remaining"
Component.translatable(
"goal.tiedup.master_watch.time_remaining", task.name(), remainingSec
).withStyle(Style.EMPTY.withColor(0xFFAA00))
);
}
@@ -357,8 +357,8 @@ public class MasterTaskWatchGoal extends Goal {
) {
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"I'm waiting...\""
Component.translatable(
"goal.tiedup.master_watch.speak_waiting", master.getNpcName()
).withStyle(
Style.EMPTY.withColor(
EntityMaster.MASTER_NAME_COLOR
@@ -384,8 +384,8 @@ public class MasterTaskWatchGoal extends Goal {
.nextInt(demandWarnings.length)];
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"" + warning + "\""
Component.translatable(
"goal.tiedup.master_watch.demand_warning", master.getNpcName(), warning
).withStyle(
Style.EMPTY.withColor(
EntityMaster.MASTER_NAME_COLOR
@@ -431,8 +431,8 @@ public class MasterTaskWatchGoal extends Goal {
String message = messages[master.getRandom().nextInt(messages.length)];
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"" + message + "\""
Component.translatable(
"goal.tiedup.master_watch.punishment", master.getNpcName(), message
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
);

View File

@@ -450,8 +450,8 @@ public class NpcGuardCommandGoal extends Goal {
if (player.getUUID().equals(commanderUUID)) {
String slaveName = slave.getNpcName();
player.displayClientMessage(
net.minecraft.network.chat.Component.literal(
npc.getNpcName() + " is chasing " + slaveName + "!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.guard_command.chasing", npc.getNpcName(), slaveName
).withStyle(net.minecraft.ChatFormatting.RED),
true // Action bar
);
@@ -545,8 +545,8 @@ public class NpcGuardCommandGoal extends Goal {
// Send alert message (could be enhanced with dialogue system)
String threatName = threat.getName().getString();
player.displayClientMessage(
net.minecraft.network.chat.Component.literal(
npc.getNpcName() + " spotted: " + threatName + "!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.guard_command.spotted", npc.getNpcName(), threatName
).withStyle(net.minecraft.ChatFormatting.YELLOW),
true // Action bar
);

View File

@@ -185,13 +185,13 @@ public class TraderSellGoal extends Goal {
);
potentialBuyer.sendSystemMessage(
Component.literal(
"[" + trader.getNpcName() + "] " + greeting
Component.translatable(
"goal.tiedup.trader_sell.greeting", trader.getNpcName(), greeting
).withStyle(net.minecraft.ChatFormatting.GOLD)
);
potentialBuyer.sendSystemMessage(
Component.literal("Right-click me to browse my stock.").withStyle(
Component.translatable("goal.tiedup.trader_sell.browse_hint").withStyle(
net.minecraft.ChatFormatting.GRAY
)
);

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities.damsel.components;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.EntityDamsel;
import com.tiedup.remake.entities.ai.damsel.*;
@@ -223,7 +223,7 @@ public class DamselAIController {
Player.class,
host
.getBoundingBox()
.inflate(ModConfig.SERVER.dialogueRadius.get())
.inflate(SettingsAccessor.getDialogueRadius())
);
// Get captor entity for comparison
@@ -258,7 +258,7 @@ public class DamselAIController {
}
// Reset cooldown
int baseCooldown = ModConfig.SERVER.dialogueCooldown.get();
int baseCooldown = SettingsAccessor.getDialogueCooldown();
if (foundTarget) {
// Full cooldown if we talked
this.callForHelpCooldown =

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities.damsel.components;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.dialogue.EntityDialogueManager;
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
import java.util.HashMap;
@@ -101,7 +101,7 @@ public class DamselDialogueHandler {
if (
lastUsed != null &&
(currentTick - lastUsed) < ModConfig.SERVER.dialogueCooldown.get()
(currentTick - lastUsed) < SettingsAccessor.getDialogueCooldown()
) {
return false; // Still on cooldown
}

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities.damsel.components;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.AbstractTiedUpNpc;
import com.tiedup.remake.state.ICaptor;
@@ -137,7 +137,7 @@ public class NpcCaptivityManager {
if (!entity.level().isClientSide()) {
host.talkToPlayersInRadius(
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory.DAMSEL_FREED,
ModConfig.SERVER.dialogueRadius.get()
SettingsAccessor.getDialogueRadius()
);
}
} else {

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.entities.damsel.components;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.AbstractTiedUpNpc;
import com.tiedup.remake.items.base.ILockable;
@@ -206,7 +206,7 @@ public class NpcEquipmentManager {
if (!wasAlreadyTied && !entity.level().isClientSide()) {
host.talkToPlayersInRadius(
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory.DAMSEL_CAPTURED,
ModConfig.SERVER.dialogueRadius.get()
SettingsAccessor.getDialogueRadius()
);
}

View File

@@ -1,7 +1,7 @@
package com.tiedup.remake.entities.kidnapper.components;
import com.tiedup.remake.cells.CellDataV2;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.dialogue.EntityDialogueManager;
import com.tiedup.remake.entities.EntityKidnapper;
@@ -628,7 +628,7 @@ public class KidnapperCaptiveManager {
// Apply blindfold if enabled in config
if (
com.tiedup.remake.core.ModConfig.SERVER.abandonKeepsBlindfold.get()
SettingsAccessor.isAbandonKeepsBlindfold()
) {
net.minecraft.world.item.ItemStack blindfold = getBlindfoldItem();
if (
@@ -652,7 +652,7 @@ public class KidnapperCaptiveManager {
// Remove restraints if NOT configured to keep them
boolean keepBinds =
com.tiedup.remake.core.ModConfig.SERVER.abandonKeepsBinds.get();
SettingsAccessor.isAbandonKeepsBinds();
if (!keepBinds) {
// Full release including binds
this.currentCaptive.untie(true);

View File

@@ -165,8 +165,8 @@ public class MaidPrisonInteraction {
sayToPlayer(player, "Very well. Here are your tools.");
player.sendSystemMessage(
Component.literal(
"The maid manually assigns you to: " + task.getDescription()
Component.translatable(
"entity.tiedup.maid.manual_assign", task.getDescription()
).withStyle(ChatFormatting.YELLOW)
);
@@ -206,8 +206,8 @@ public class MaidPrisonInteraction {
sayToPlayer(worker, "Good. You've completed your task.");
worker.sendSystemMessage(
Component.literal(
"A Maid will come to collect you shortly."
Component.translatable(
"entity.tiedup.maid.collect_shortly"
).withStyle(ChatFormatting.YELLOW)
);
@@ -229,13 +229,13 @@ public class MaidPrisonInteraction {
@Nullable LaborRecord laborRecord
) {
player.sendSystemMessage(
Component.literal("=== Labor Status ===").withStyle(
Component.translatable("entity.tiedup.maid.labor_status_header").withStyle(
ChatFormatting.GOLD
)
);
player.sendSystemMessage(
Component.literal("State: " + record.getState().name()).withStyle(
Component.translatable("entity.tiedup.maid.labor_status_state", record.getState().name()).withStyle(
ChatFormatting.GRAY
)
);
@@ -243,13 +243,13 @@ public class MaidPrisonInteraction {
if (laborRecord != null && laborRecord.getTask() != null) {
LaborTask task = laborRecord.getTask();
player.sendSystemMessage(
Component.literal("Task: " + task.getDescription()).withStyle(
Component.translatable("entity.tiedup.maid.labor_status_task", task.getDescription()).withStyle(
ChatFormatting.GRAY
)
);
player.sendSystemMessage(
Component.literal(
"Progress: " + task.getProgress() + "/" + task.getQuota()
Component.translatable(
"entity.tiedup.maid.labor_status_progress", task.getProgress(), task.getQuota()
).withStyle(ChatFormatting.GRAY)
);
}
@@ -262,8 +262,8 @@ public class MaidPrisonInteraction {
RansomRecord ransom = manager.getRansomRecord(player.getUUID());
int remaining = ransom != null ? ransom.getRemainingDebt() : 0;
player.sendSystemMessage(
Component.literal(
"Remaining debt: " + remaining + " emeralds"
Component.translatable(
"entity.tiedup.maid.labor_status_debt", remaining
).withStyle(ChatFormatting.GRAY)
);
@@ -273,8 +273,8 @@ public class MaidPrisonInteraction {
laborRecord.getPhase() == LaborRecord.WorkPhase.PENDING_EXTRACTION
) {
player.sendSystemMessage(
Component.literal(
"Shift+Right-Click to manually start task"
Component.translatable(
"entity.tiedup.maid.labor_hint_start_task"
).withStyle(ChatFormatting.YELLOW)
);
} else if (
@@ -283,8 +283,8 @@ public class MaidPrisonInteraction {
laborRecord.getTask().isComplete()
) {
player.sendSystemMessage(
Component.literal(
"Shift+Right-Click to manually turn in task"
Component.translatable(
"entity.tiedup.maid.labor_hint_turn_in"
).withStyle(ChatFormatting.GREEN)
);
}

View File

@@ -199,8 +199,8 @@ public class MasterPetManager {
// Send message to player
player.sendSystemMessage(
Component.literal(
"You are free! Your master " + master.getNpcName() + " is gone."
Component.translatable(
"entity.tiedup.master.pet_freed", master.getNpcName()
).withStyle(Style.EMPTY.withColor(0x00FF00))
);
}

View File

@@ -89,8 +89,8 @@ public class CampChestHandler {
if (entity instanceof Player player) {
player.displayClientMessage(
Component.literal(
"This chest is locked by the camp!"
Component.translatable(
"msg.tiedup.event.chest_locked_by_camp"
).withStyle(ChatFormatting.RED),
true
);

View File

@@ -286,10 +286,9 @@ public class CampManagementHandler {
.getPlayer(prisonerId);
if (player != null) {
player.sendSystemMessage(
Component.literal(
"A new maid, " +
maidName +
", has arrived. Work resumes."
Component.translatable(
"msg.tiedup.event.new_maid_arrived",
maidName
).withStyle(ChatFormatting.GOLD)
);
}

View File

@@ -75,10 +75,10 @@ public class CampNpcProtectionHandler {
// Send warning message to player
player.sendSystemMessage(
Component.literal(
Component.translatable(
isTrader
? "The camp defends their leader! You are now under attack!"
: "The camp defends their servant! You are now under attack!"
? "msg.tiedup.event.camp_defends_trader"
: "msg.tiedup.event.camp_defends_maid"
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
);
}

View File

@@ -48,8 +48,8 @@ public class GraceEventHandler {
record.setProtectionExpiry(0);
player.displayClientMessage(
Component.literal(
"You attacked a kidnapper - protection lost!"
Component.translatable(
"msg.tiedup.event.grace_lost"
).withStyle(ChatFormatting.RED),
true
);

View File

@@ -209,12 +209,10 @@ public class LaborAttackPunishmentHandler {
manager.increaseDebt(prisoner.getUUID(), DEBT_INCREASE_PER_ATTACK);
prisoner.sendSystemMessage(
Component.literal(
String.format(
"Your debt has increased by %d emeralds for attacking %s!",
DEBT_INCREASE_PER_ATTACK,
targetName
)
Component.translatable(
"msg.tiedup.event.debt_increased",
DEBT_INCREASE_PER_ATTACK,
targetName
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
);
}
@@ -282,8 +280,8 @@ public class LaborAttackPunishmentHandler {
// 4. Warning message
prisoner.sendSystemMessage(
Component.literal(
"Your task has been marked as failed. You will not be paid for your work."
Component.translatable(
"msg.tiedup.event.task_failed"
).withStyle(ChatFormatting.DARK_RED)
);
@@ -315,8 +313,8 @@ public class LaborAttackPunishmentHandler {
laborRecord.setEscortMaidId(null);
prisoner.sendSystemMessage(
Component.literal(
"You have been returned to your cell for your insolence!"
Component.translatable(
"msg.tiedup.event.returned_to_cell"
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
);

View File

@@ -363,8 +363,8 @@ public class PlayerStateEventHandler {
// Send death escape message if applicable
if (pendingDeathEscapeMessage.remove(player.getUUID())) {
player.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"You died and escaped captivity. Your items remain in the camp chest."
net.minecraft.network.chat.Component.translatable(
"msg.tiedup.event.death_escape"
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);
}

View File

@@ -1,5 +1,6 @@
package com.tiedup.remake.events.restriction;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
import com.tiedup.remake.core.TiedUpMod;
@@ -134,7 +135,7 @@ public class BondageItemRestrictionHandler {
Vec3 motion = player.getDeltaMovement();
player.setDeltaMovement(
motion.scale(
com.tiedup.remake.core.ModConfig.SERVER.tiedSwimSpeedMultiplier.get()
SettingsAccessor.getTiedSwimSpeedMultiplier()
)
);
}
@@ -473,7 +474,7 @@ public class BondageItemRestrictionHandler {
if (state != null && state.isGagged()) {
event.setCanceled(true);
player.displayClientMessage(
Component.literal("You can't eat with a gag on.").withStyle(
Component.translatable("msg.tiedup.event.cant_eat_gagged").withStyle(
ChatFormatting.RED
),
true

View File

@@ -79,7 +79,7 @@ public class LaborToolProtectionHandler {
);
} else {
player.displayClientMessage(
Component.literal("You cannot drop labor tools!"),
Component.translatable("msg.tiedup.event.cant_drop_labor_tools"),
true
);
}
@@ -124,7 +124,7 @@ public class LaborToolProtectionHandler {
);
} else {
player.displayClientMessage(
Component.literal("You cannot store labor tools!"),
Component.translatable("msg.tiedup.event.cant_store_labor_tools"),
true
);
}

View File

@@ -77,7 +77,7 @@ public class PetPlayRestrictionHandler {
sendThrottledMessage(
player,
"You cannot eat from your hand! Use a bowl."
"msg.tiedup.petplay.cannot_eat_hand"
);
TiedUpMod.LOGGER.debug(
@@ -175,7 +175,7 @@ public class PetPlayRestrictionHandler {
sendThrottledMessage(
player,
"You cannot sleep in a bed! Use your pet bed."
"msg.tiedup.petplay.cannot_sleep_bed"
);
TiedUpMod.LOGGER.debug(
@@ -222,8 +222,8 @@ public class PetPlayRestrictionHandler {
// Start sleeping (simplified - real implementation would need proper sleep mechanics)
serverPlayer.sendSystemMessage(
Component.literal(
"You curl up in your pet bed..."
Component.translatable(
"msg.tiedup.petplay.curl_up_bed"
).withStyle(Style.EMPTY.withColor(0x888888))
);
@@ -242,7 +242,7 @@ public class PetPlayRestrictionHandler {
} else {
sendThrottledMessage(
player,
"You can only sleep at night or during thunderstorms."
"msg.tiedup.petplay.sleep_time_only"
);
}
}
@@ -325,14 +325,14 @@ public class PetPlayRestrictionHandler {
/**
* Send a message with cooldown to prevent spam.
*/
private static void sendThrottledMessage(Player player, String message) {
private static void sendThrottledMessage(Player player, String translationKey) {
long now = System.currentTimeMillis();
Long lastTime = lastMessageTime.get(player.getUUID());
if (lastTime == null || now - lastTime > MESSAGE_COOLDOWN_MS) {
lastMessageTime.put(player.getUUID(), now);
player.sendSystemMessage(
Component.literal(message).withStyle(
Component.translatable(translationKey).withStyle(
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
)
);

View File

@@ -63,7 +63,7 @@ public class ChatEventHandler {
if (!gagStack.isEmpty() && isGagItem) {
String originalMessage = event.getRawText();
// V2: get material from component, V1 fallback: from ItemGag
// V2: get material from GaggingComponent
GagMaterial material = null;
if (gaggingComp != null) {
material = gaggingComp.getMaterial();

View File

@@ -75,20 +75,14 @@ public class GenericKnife extends Item implements IKnife {
// Show cutting speed
tooltip.add(
Component.literal("Cutting speed: " + speed + " res/s").withStyle(
ChatFormatting.GRAY
)
Component.translatable("item.tiedup.knife.cutting_speed", speed)
.withStyle(ChatFormatting.GRAY)
);
// Show cutting time remaining
tooltip.add(
Component.literal(
"Cutting time: " +
cuttingSeconds +
"s (" +
remaining +
" total res)"
).withStyle(ChatFormatting.DARK_GRAY)
Component.translatable("item.tiedup.knife.cutting_time", cuttingSeconds, remaining)
.withStyle(ChatFormatting.DARK_GRAY)
);
}

View File

@@ -36,12 +36,12 @@ public class ItemCellKey extends Item {
TooltipFlag flag
) {
tooltip.add(
Component.literal("Unlocks any Iron Bar Door").withStyle(
Component.translatable("item.tiedup.cell_key.desc").withStyle(
ChatFormatting.GRAY
)
);
tooltip.add(
Component.literal("Does not work on bondage items").withStyle(
Component.translatable("item.tiedup.cell_key.restriction").withStyle(
ChatFormatting.DARK_GRAY
)
);

View File

@@ -1,6 +1,5 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.TiedUpMod;
import net.minecraft.network.chat.Component;

View File

@@ -39,13 +39,8 @@ public class ItemGpsLocator extends ItemOwnerTarget {
if (hasTarget(stack)) {
String displayName = resolveTargetDisplayName(stack, level);
tooltip.add(
Component.literal("Target: ")
Component.translatable("item.tiedup.gps_locator.target", displayName)
.withStyle(ChatFormatting.BLUE)
.append(
Component.literal(displayName).withStyle(
ChatFormatting.WHITE
)
)
);
}
}

View File

@@ -85,36 +85,25 @@ public class ItemKey extends ItemOwnerTarget {
if (hasOwner(stack)) {
tooltip.add(
Component.literal("Owner: ")
Component.translatable("item.tiedup.key.owner", getOwnerName(stack))
.withStyle(ChatFormatting.GOLD)
.append(
Component.literal(getOwnerName(stack)).withStyle(
ChatFormatting.WHITE
)
)
);
} else {
tooltip.add(
Component.literal(
"Unclaimed (Right-click a collar wearer to claim)"
).withStyle(ChatFormatting.GRAY)
Component.translatable("item.tiedup.key.unclaimed")
.withStyle(ChatFormatting.GRAY)
);
}
if (hasTarget(stack)) {
tooltip.add(
Component.literal("Target: ")
Component.translatable("item.tiedup.key.target", getTargetName(stack))
.withStyle(ChatFormatting.BLUE)
.append(
Component.literal(getTargetName(stack)).withStyle(
ChatFormatting.WHITE
)
)
);
}
tooltip.add(
Component.literal("Right-click a collared player to toggle LOCK")
Component.translatable("item.tiedup.key.hint")
.withStyle(ChatFormatting.DARK_GRAY)
.withStyle(ChatFormatting.ITALIC)
);

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.ILockable;
@@ -63,16 +63,15 @@ public class ItemLockpick extends Item {
int remaining = stack.getMaxDamage() - stack.getDamageValue();
tooltip.add(
Component.literal(
"Uses: " + remaining + "/" + stack.getMaxDamage()
).withStyle(ChatFormatting.DARK_GRAY)
Component.translatable("item.tiedup.lockpick.uses", remaining, stack.getMaxDamage())
.withStyle(ChatFormatting.DARK_GRAY)
);
// LOW FIX: Removed server config access from client tooltip (desync issue)
// Success/break chances depend on server config, not client config
// Displaying client config values here would be misleading in multiplayer
tooltip.add(
Component.literal("Success/break chances: Check server config")
Component.translatable("item.tiedup.lockpick.chances_hint")
.withStyle(ChatFormatting.GRAY)
.withStyle(ChatFormatting.ITALIC)
);
@@ -209,7 +208,7 @@ public class ItemLockpick extends Item {
// Roll for success
boolean success =
random.nextInt(100) < ModConfig.SERVER.lockpickSuccessChance.get();
random.nextInt(100) < SettingsAccessor.getLockpickSuccessChance();
if (success) {
// SUCCESS: Unlock the item, PRESERVE the padlock
@@ -242,7 +241,7 @@ public class ItemLockpick extends Item {
// 2. Check for jam
boolean jammed =
random.nextDouble() * 100 <
ModConfig.SERVER.lockpickJamChance.get();
SettingsAccessor.getLockpickJamChance();
if (jammed) {
lockable.setJammed(targetStack, true);
SystemMessageManager.sendToPlayer(
@@ -266,7 +265,7 @@ public class ItemLockpick extends Item {
// 3. Check for break
boolean broke =
random.nextInt(100) <
ModConfig.SERVER.lockpickBreakChance.get();
SettingsAccessor.getLockpickBreakChance();
if (broke) {
lockpickStack.shrink(1);
SystemMessageManager.sendToPlayer(
@@ -354,11 +353,11 @@ public class ItemLockpick extends Item {
) {
if (player.getServer() == null) return;
Component warning = Component.literal("ALERT: ")
Component warning = Component.translatable("item.tiedup.lockpick.alert_prefix")
.withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
.append(
Component.literal(
player.getName().getString() + " tried to pick a lock!"
Component.translatable(
"item.tiedup.lockpick.alert_attempt", player.getName().getString()
).withStyle(ChatFormatting.GOLD)
);

View File

@@ -1,6 +1,5 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.TiedUpMod;
@@ -60,20 +59,17 @@ public class ItemRag extends Item {
int ticksRemaining = getWetTime(stack);
int secondsRemaining = ticksRemaining / 20;
tooltip.add(
Component.literal("Soaked with chloroform").withStyle(
ChatFormatting.GREEN
)
Component.translatable("item.tiedup.rag.soaked")
.withStyle(ChatFormatting.GREEN)
);
tooltip.add(
Component.literal(
"Evaporates in: " + secondsRemaining + "s"
).withStyle(ChatFormatting.GRAY)
Component.translatable("item.tiedup.rag.evaporates", secondsRemaining)
.withStyle(ChatFormatting.GRAY)
);
} else {
tooltip.add(
Component.literal("Dry - needs chloroform").withStyle(
ChatFormatting.GRAY
)
Component.translatable("item.tiedup.rag.dry")
.withStyle(ChatFormatting.GRAY)
);
}
}
@@ -283,6 +279,6 @@ public class ItemRag extends Item {
* @return Default wet time in ticks
*/
public static int getDefaultWetTime() {
return ModConfig.SERVER.ragWetTime.get();
return SettingsAccessor.getRagWetTime();
}
}

View File

@@ -47,20 +47,18 @@ public class ItemShockerController extends ItemOwnerTarget {
if (isBroadcastEnabled(stack)) {
tooltip.add(
Component.literal("MODE: BROADCAST").withStyle(
ChatFormatting.DARK_RED
)
Component.translatable("item.tiedup.shocker.mode_broadcast")
.withStyle(ChatFormatting.DARK_RED)
);
tooltip.add(
Component.literal("(Affects ALL your slaves in radius)")
Component.translatable("item.tiedup.shocker.broadcast_desc")
.withStyle(ChatFormatting.GRAY)
.withStyle(ChatFormatting.ITALIC)
);
} else {
tooltip.add(
Component.literal("MODE: TARGETED").withStyle(
ChatFormatting.BLUE
)
Component.translatable("item.tiedup.shocker.mode_targeted")
.withStyle(ChatFormatting.BLUE)
);
if (hasTarget(stack)) {
String displayName = getTargetName(stack);
@@ -102,7 +100,7 @@ public class ItemShockerController extends ItemOwnerTarget {
if (isDisconnected) {
targetComp.append(
Component.literal(" [FREED]")
Component.translatable("item.tiedup.shocker.freed")
.withStyle(ChatFormatting.RED)
.withStyle(ChatFormatting.BOLD)
);
@@ -110,20 +108,18 @@ public class ItemShockerController extends ItemOwnerTarget {
tooltip.add(targetComp);
} else {
tooltip.add(
Component.literal(" > No target connected").withStyle(
ChatFormatting.GRAY
)
Component.translatable("item.tiedup.shocker.no_target")
.withStyle(ChatFormatting.GRAY)
);
}
}
tooltip.add(
Component.literal("Radius: " + getRadius(stack) + "m").withStyle(
ChatFormatting.GREEN
)
Component.translatable("item.tiedup.shocker.radius", getRadius(stack))
.withStyle(ChatFormatting.GREEN)
);
tooltip.add(
Component.literal("Shift + Right-click to toggle Broadcast mode")
Component.translatable("item.tiedup.shocker.hint")
.withStyle(ChatFormatting.DARK_GRAY)
.withStyle(ChatFormatting.ITALIC)
);

View File

@@ -2,7 +2,7 @@ package com.tiedup.remake.items;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.ModSounds;
import java.util.UUID;
import net.minecraft.sounds.SoundSource;
@@ -74,7 +74,7 @@ public class ItemTaser extends Item {
1.0f
);
int duration = ModConfig.SERVER.taserStunDuration.get();
int duration = SettingsAccessor.getTaserStunDuration();
// Apply Slowness I
target.addEffect(

View File

@@ -1,6 +1,7 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.TiedUpMod;
import net.minecraft.ChatFormatting;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
@@ -38,9 +39,8 @@ public class ItemTiedUpGuide extends Item {
// Check if Patchouli is installed
if (!ModList.get().isLoaded("patchouli")) {
player.displayClientMessage(
Component.literal(
"§cPatchouli is not installed! Install it to use this guide."
),
Component.translatable("item.tiedup.guide.no_patchouli")
.withStyle(ChatFormatting.RED),
false
);
return InteractionResultHolder.fail(stack);
@@ -52,9 +52,8 @@ public class ItemTiedUpGuide extends Item {
);
if (guideBookItem == null) {
player.displayClientMessage(
Component.literal(
"§cFailed to find Patchouli guide_book item."
),
Component.translatable("item.tiedup.guide.book_not_found")
.withStyle(ChatFormatting.RED),
false
);
return InteractionResultHolder.fail(stack);
@@ -76,7 +75,8 @@ public class ItemTiedUpGuide extends Item {
stack.shrink(1);
player.displayClientMessage(
Component.literal("§aReceived TiedUp! Guide Book!"),
Component.translatable("item.tiedup.guide.received")
.withStyle(ChatFormatting.GREEN),
true
);
}

View File

@@ -39,25 +39,25 @@ public class ItemToken extends Item {
TooltipFlag flag
) {
tooltip.add(
Component.literal("Camp Access Token").withStyle(
Component.translatable("item.tiedup.token.title").withStyle(
ChatFormatting.GOLD,
ChatFormatting.BOLD
)
);
tooltip.add(Component.literal(""));
tooltip.add(
Component.literal("Kidnappers won't target you").withStyle(
Component.translatable("item.tiedup.token.effect_no_target").withStyle(
ChatFormatting.GREEN
)
);
tooltip.add(
Component.literal("Allows trading with Slave Traders").withStyle(
Component.translatable("item.tiedup.token.effect_trading").withStyle(
ChatFormatting.GREEN
)
);
tooltip.add(Component.literal(""));
tooltip.add(
Component.literal("Keep in your inventory for effect").withStyle(
Component.translatable("item.tiedup.token.hint").withStyle(
ChatFormatting.GRAY,
ChatFormatting.ITALIC
)

View File

@@ -1,6 +1,6 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.ModConfig;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.EntityDamsel;
import com.tiedup.remake.entities.EntityKidnapper;
@@ -92,8 +92,8 @@ public class ItemWhip extends Item {
return InteractionResult.PASS;
}
float damage = ModConfig.SERVER.whipDamage.get().floatValue();
int resistanceDecrease = ModConfig.SERVER.whipResistanceDecrease.get();
float damage = SettingsAccessor.getWhipDamage();
int resistanceDecrease = SettingsAccessor.getWhipResistanceDecrease();
// 1. Play whip sound
TiedUpSounds.playWhipSound(target);

View File

@@ -157,7 +157,7 @@ public abstract class ItemOwnerTarget extends Item {
) {
if (hasOwner(stack)) {
tooltip.add(
Component.literal("Owner: ")
Component.translatable("item.tiedup.owner_target.owner")
.withStyle(ChatFormatting.GOLD)
.append(
Component.literal(getOwnerName(stack)).withStyle(
@@ -167,8 +167,8 @@ public abstract class ItemOwnerTarget extends Item {
);
} else {
tooltip.add(
Component.literal(
"Unclaimed (" + unclaimedHint + ")"
Component.translatable(
"item.tiedup.owner_target.unclaimed", unclaimedHint
).withStyle(ChatFormatting.GRAY)
);
}

View File

@@ -1,13 +0,0 @@
package com.tiedup.remake.items.bondage3d;
/**
* Interface for items that have a 3D model configuration.
* Implement this to provide custom position, scale, and rotation for 3D rendering.
*/
public interface IHas3DModelConfig {
/**
* Get the 3D model configuration for rendering.
* @return The Model3DConfig with position, scale, and rotation offsets
*/
Model3DConfig getModelConfig();
}

View File

@@ -1,67 +0,0 @@
package com.tiedup.remake.items.bondage3d;
import java.util.Set;
/**
* Configuration immutable for a 3D item.
* Contains all parameters necessary for rendering.
*/
public record Model3DConfig(
String objPath, // "tiedup:models/obj/ball_gag/model.obj"
String texturePath, // "tiedup:models/obj/ball_gag/texture.png" (or null = use MTL)
float posOffsetX, // Horizontal offset
float posOffsetY, // Vertical offset (negative = lower)
float posOffsetZ, // Depth offset (positive = forward)
float scale, // Scale (1.0 = normal size)
float rotOffsetX, // Additional X rotation
float rotOffsetY, // Additional Y rotation
float rotOffsetZ, // Additional Z rotation
Set<String> tintMaterials // Material names to apply color tint (e.g., "Ball")
) {
/** Config without tinting */
public static Model3DConfig simple(String objPath, String texturePath) {
return new Model3DConfig(
objPath,
texturePath,
0,
0,
0,
1.0f,
0,
0,
0,
Set.of()
);
}
/** Config with position/rotation but no tinting */
public Model3DConfig(
String objPath,
String texturePath,
float posOffsetX,
float posOffsetY,
float posOffsetZ,
float scale,
float rotOffsetX,
float rotOffsetY,
float rotOffsetZ
) {
this(
objPath,
texturePath,
posOffsetX,
posOffsetY,
posOffsetZ,
scale,
rotOffsetX,
rotOffsetY,
rotOffsetZ,
Set.of()
);
}
/** Check if this item supports color tinting */
public boolean supportsTinting() {
return tintMaterials != null && !tintMaterials.isEmpty();
}
}

View File

@@ -46,8 +46,8 @@ public class StruggleSessionManager {
> continuousSessions = new ConcurrentHashMap<>();
/**
* Mapping from legacy V1 slot indices to V2 BodyRegionV2.
* Used to convert V1 session targetSlot ordinals to V2 regions.
* Mapping from legacy slot indices to V2 BodyRegionV2.
* Used to convert legacy session targetSlot ordinals to V2 regions.
* Index: 0=ARMS, 1=MOUTH, 2=EYES, 3=EARS, 4=NECK, 5=TORSO, 6=HANDS.
*/
private static final BodyRegionV2[] SLOT_TO_REGION = {
@@ -83,16 +83,16 @@ public class StruggleSessionManager {
) {
UUID playerId = player.getUUID();
// Remove any existing continuous session
// RISK-002 fix: reject if active session exists (prevents direction re-roll exploit)
ContinuousStruggleMiniGameState existing = continuousSessions.get(
playerId
);
if (existing != null) {
TiedUpMod.LOGGER.debug(
"[StruggleSessionManager] Replacing existing continuous struggle session for {}",
"[StruggleSessionManager] Rejected continuous session: active session already exists for {}",
player.getName().getString()
);
continuousSessions.remove(playerId);
return null;
}
// Create new session with configurable rate
@@ -146,12 +146,16 @@ public class StruggleSessionManager {
) {
UUID playerId = player.getUUID();
// Remove any existing session
// RISK-002 fix: reject if active session exists (prevents direction re-roll exploit)
ContinuousStruggleMiniGameState existing = continuousSessions.get(
playerId
);
if (existing != null) {
continuousSessions.remove(playerId);
TiedUpMod.LOGGER.debug(
"[StruggleSessionManager] Rejected accessory session: active session already exists for {}",
player.getName().getString()
);
return null;
}
// Create new session with target slot and configurable rate
@@ -607,7 +611,7 @@ public class StruggleSessionManager {
}
if (session.isAccessoryStruggle()) {
// Handle accessory resistance update (V1 path -- slot index is legacy ordinal)
// Handle accessory resistance update (legacy slot-index path)
Integer slotIndex = session.getTargetSlot();
if (
slotIndex == null ||
@@ -676,7 +680,7 @@ public class StruggleSessionManager {
if (session.isV2Struggle()) {
com.tiedup.remake.v2.BodyRegionV2 region =
session.getTargetRegion();
// BUG-001 fix: break lock before unequip (consistent with V1 accessory escape)
// BUG-001 fix: break lock before unequip (consistent with legacy accessory escape)
ItemStack stackInRegion =
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getInRegion(
player,
@@ -714,7 +718,7 @@ public class StruggleSessionManager {
}
}
} else {
// Handle accessory escape (V1 path -- slot index is legacy ordinal)
// Handle accessory escape (legacy slot-index path)
Integer slotIndex = session.getTargetSlot();
if (
slotIndex != null &&

Some files were not shown because too many files have changed in this diff Show More