Compare commits
22 Commits
chore/quic
...
chore/audi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e136cff96 | ||
| 683eeec11f | |||
|
|
fd60086322 | ||
|
|
9b2c5dec8e | ||
|
|
371a138b71 | ||
|
|
d75b74f9f9 | ||
| bce0598059 | |||
|
|
6d56024c7e | ||
|
|
8823c671d7 | ||
|
|
6d9d6b4b81 | ||
|
|
706172fb9a | ||
|
|
3aaf92b788 | ||
|
|
69f52eacf3 | ||
| a4fc05b503 | |||
|
|
7444853840 | ||
|
|
22d79a452b | ||
| 70f85b58a6 | |||
|
|
c34bac11b0 | ||
|
|
fa5cfb913c | ||
|
|
70965c2dda | ||
|
|
0662739fe0 | ||
| ac72f6aae7 |
@@ -104,6 +104,7 @@ minecraft {
|
|||||||
|
|
||||||
// Mixin config arg
|
// Mixin config arg
|
||||||
args '-mixin.config=tiedup.mixins.json'
|
args '-mixin.config=tiedup.mixins.json'
|
||||||
|
args '-mixin.config=tiedup-compat.mixins.json'
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -116,6 +117,7 @@ minecraft {
|
|||||||
|
|
||||||
// Mixin config arg
|
// Mixin config arg
|
||||||
args '-mixin.config=tiedup.mixins.json'
|
args '-mixin.config=tiedup.mixins.json'
|
||||||
|
args '-mixin.config=tiedup-compat.mixins.json'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional client instances for multiplayer testing
|
// Additional client instances for multiplayer testing
|
||||||
@@ -155,6 +157,7 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }
|
|||||||
mixin {
|
mixin {
|
||||||
add sourceSets.main, 'tiedup.refmap.json'
|
add sourceSets.main, 'tiedup.refmap.json'
|
||||||
config 'tiedup.mixins.json'
|
config 'tiedup.mixins.json'
|
||||||
|
config 'tiedup-compat.mixins.json'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -263,7 +266,7 @@ tasks.named('jar', Jar).configure {
|
|||||||
'Implementation-Version' : project.jar.archiveVersion,
|
'Implementation-Version' : project.jar.archiveVersion,
|
||||||
'Implementation-Vendor' : mod_authors,
|
'Implementation-Vendor' : mod_authors,
|
||||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||||
'MixinConfigs' : 'tiedup.mixins.json'
|
'MixinConfigs' : 'tiedup.mixins.json,tiedup-compat.mixins.json'
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ public class BlockKidnapBomb
|
|||||||
beTag.contains("collar")
|
beTag.contains("collar")
|
||||||
) {
|
) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Loaded:").withStyle(
|
Component.translatable("block.tiedup.kidnap_bomb.loaded").withStyle(
|
||||||
ChatFormatting.YELLOW
|
ChatFormatting.YELLOW
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -282,12 +282,12 @@ public class BlockKidnapBomb
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Empty").withStyle(ChatFormatting.GREEN)
|
Component.translatable("block.tiedup.kidnap_bomb.empty").withStyle(ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Empty").withStyle(ChatFormatting.GREEN)
|
Component.translatable("block.tiedup.kidnap_bomb.empty").withStyle(ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ public class BlockRopeTrap extends Block implements EntityBlock, ICanBeLoaded {
|
|||||||
// Check if armed
|
// Check if armed
|
||||||
if (beTag.contains("bind")) {
|
if (beTag.contains("bind")) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Armed").withStyle(
|
Component.translatable("block.tiedup.trap.armed").withStyle(
|
||||||
ChatFormatting.DARK_RED
|
ChatFormatting.DARK_RED
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -366,14 +366,14 @@ public class BlockRopeTrap extends Block implements EntityBlock, ICanBeLoaded {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Disarmed").withStyle(
|
Component.translatable("block.tiedup.trap.disarmed").withStyle(
|
||||||
ChatFormatting.GREEN
|
ChatFormatting.GREEN
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Disarmed").withStyle(ChatFormatting.GREEN)
|
Component.translatable("block.tiedup.trap.disarmed").withStyle(ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class BlockTrappedChest extends ChestBlock implements ICanBeLoaded {
|
|||||||
beTag.contains("collar")
|
beTag.contains("collar")
|
||||||
) {
|
) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Armed").withStyle(
|
Component.translatable("block.tiedup.trap.armed").withStyle(
|
||||||
ChatFormatting.DARK_RED
|
ChatFormatting.DARK_RED
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -231,14 +231,14 @@ public class BlockTrappedChest extends ChestBlock implements ICanBeLoaded {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Disarmed").withStyle(
|
Component.translatable("block.tiedup.trap.disarmed").withStyle(
|
||||||
ChatFormatting.GREEN
|
ChatFormatting.GREEN
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Disarmed").withStyle(ChatFormatting.GREEN)
|
Component.translatable("block.tiedup.trap.disarmed").withStyle(ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -382,9 +382,8 @@ public class BountyManager extends SavedData {
|
|||||||
server
|
server
|
||||||
.getPlayerList()
|
.getPlayerList()
|
||||||
.broadcastSystemMessage(
|
.broadcastSystemMessage(
|
||||||
Component.literal("[Bounty] " + message).withStyle(
|
Component.translatable("msg.tiedup.bounty.broadcast", message)
|
||||||
ChatFormatting.GOLD
|
.withStyle(ChatFormatting.GOLD),
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,10 +250,8 @@ public final class CampLifecycleManager {
|
|||||||
|
|
||||||
// Notify prisoner
|
// Notify prisoner
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal("Your captor has died. You are FREE!").withStyle(
|
Component.translatable("msg.tiedup.camp.captor_died")
|
||||||
ChatFormatting.GREEN,
|
.withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD)
|
||||||
ChatFormatting.BOLD
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Grant grace period (5 minutes = 6000 ticks)
|
// Grant grace period (5 minutes = 6000 ticks)
|
||||||
@@ -261,9 +259,8 @@ public final class CampLifecycleManager {
|
|||||||
manager.release(prisoner.getUUID(), level.getGameTime(), 6000);
|
manager.release(prisoner.getUUID(), level.getGameTime(), 6000);
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable("msg.tiedup.camp.grace_period")
|
||||||
"You have 5 minutes of protection from kidnappers."
|
.withStyle(ChatFormatting.AQUA)
|
||||||
).withStyle(ChatFormatting.AQUA)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
TiedUpMod.LOGGER.info(
|
TiedUpMod.LOGGER.info(
|
||||||
|
|||||||
@@ -670,13 +670,7 @@ public class CellRegistryV2 extends SavedData {
|
|||||||
if (server == null || ownerId == null) return;
|
if (server == null || ownerId == null) return;
|
||||||
ServerPlayer owner = server.getPlayerList().getPlayer(ownerId);
|
ServerPlayer owner = server.getPlayerList().getPlayer(ownerId);
|
||||||
if (owner != null) {
|
if (owner != null) {
|
||||||
String template = SystemMessageManager.getTemplate(category);
|
SystemMessageManager.sendTranslatable(owner, category, prisonerName);
|
||||||
String formattedMessage = String.format(template, prisonerName);
|
|
||||||
SystemMessageManager.sendToPlayer(
|
|
||||||
owner,
|
|
||||||
category,
|
|
||||||
formattedMessage
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.tiedup.remake.client;
|
|||||||
import com.mojang.blaze3d.platform.InputConstants;
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
import com.tiedup.remake.client.gui.screens.AdjustmentScreen;
|
import com.tiedup.remake.client.gui.screens.AdjustmentScreen;
|
||||||
import com.tiedup.remake.client.gui.screens.UnifiedBondageScreen;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.items.base.ILockable;
|
import com.tiedup.remake.items.base.ILockable;
|
||||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||||
@@ -315,7 +315,7 @@ public class ModKeybindings {
|
|||||||
// Check if player has bind equipped
|
// Check if player has bind equipped
|
||||||
if (state.isTiedUp()) {
|
if (state.isTiedUp()) {
|
||||||
// Has bind - struggle against it
|
// Has bind - struggle against it
|
||||||
if (ModConfig.SERVER.struggleMiniGameEnabled.get()) {
|
if (SettingsAccessor.isStruggleMiniGameEnabled()) {
|
||||||
// New: Start struggle mini-game
|
// New: Start struggle mini-game
|
||||||
ModNetwork.sendToServer(
|
ModNetwork.sendToServer(
|
||||||
new PacketV2StruggleStart(BodyRegionV2.ARMS)
|
new PacketV2StruggleStart(BodyRegionV2.ARMS)
|
||||||
|
|||||||
@@ -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.AnimationContext;
|
||||||
import com.tiedup.remake.client.animation.context.AnimationContextResolver;
|
import com.tiedup.remake.client.animation.context.AnimationContextResolver;
|
||||||
import com.tiedup.remake.client.animation.context.RegionBoneMapper;
|
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.CellHighlightHandler;
|
||||||
import com.tiedup.remake.client.events.LeashProxyClientHandler;
|
import com.tiedup.remake.client.events.LeashProxyClientHandler;
|
||||||
import com.tiedup.remake.client.gltf.GltfAnimationApplier;
|
import com.tiedup.remake.client.gltf.GltfAnimationApplier;
|
||||||
import com.tiedup.remake.client.state.ClothesClientCache;
|
import com.tiedup.remake.client.state.ClothesClientCache;
|
||||||
import com.tiedup.remake.client.state.MovementStyleClientState;
|
import com.tiedup.remake.client.state.MovementStyleClientState;
|
||||||
import com.tiedup.remake.client.state.PetBedClientState;
|
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.util.HumanChairHelper;
|
||||||
import com.tiedup.remake.state.PlayerBindState;
|
import com.tiedup.remake.state.PlayerBindState;
|
||||||
import com.tiedup.remake.v2.BodyRegionV2;
|
import com.tiedup.remake.v2.BodyRegionV2;
|
||||||
@@ -205,30 +201,11 @@ public class AnimationTickHandler {
|
|||||||
context,
|
context,
|
||||||
allOwnedParts
|
allOwnedParts
|
||||||
);
|
);
|
||||||
// Clear V1 tracking so transition back works
|
// Clear legacy tracking so transition back works
|
||||||
AnimationStateRegistry.getLastAnimId().remove(uuid);
|
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) {
|
} else if (wasTied) {
|
||||||
// Was tied, now free - stop all animations
|
// Was tied, now free - stop all animations
|
||||||
if (GltfAnimationApplier.hasActiveState(player)) {
|
if (GltfAnimationApplier.hasActiveState(player)) {
|
||||||
@@ -242,53 +219,6 @@ public class AnimationTickHandler {
|
|||||||
AnimationStateRegistry.getLastTiedState().put(uuid, isTied);
|
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.
|
* Player logout event - cleanup animation data.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class NpcAnimationTickHandler {
|
|||||||
* (base posture) and an item layer (GLB-driven bones). Sitting and kneeling are
|
* (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.
|
* 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}.
|
* PlayerAnimator animations via {@link BondageAnimationManager}.
|
||||||
*/
|
*/
|
||||||
private static void updateNpcAnimation(AbstractTiedUpNpc entity) {
|
private static void updateNpcAnimation(AbstractTiedUpNpc entity) {
|
||||||
@@ -120,7 +120,7 @@ public class NpcAnimationTickHandler {
|
|||||||
);
|
);
|
||||||
lastNpcAnimId.remove(uuid);
|
lastNpcAnimId.remove(uuid);
|
||||||
} else {
|
} else {
|
||||||
// V1 fallback: JSON-based PlayerAnimator animations
|
// Legacy fallback: JSON-based PlayerAnimator animations
|
||||||
if (GltfAnimationApplier.hasActiveState(entity)) {
|
if (GltfAnimationApplier.hasActiveState(entity)) {
|
||||||
GltfAnimationApplier.clearV2Animation(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) {
|
private static String buildNpcAnimationId(AbstractTiedUpNpc entity) {
|
||||||
// Determine position prefix for SIT/KNEEL poses
|
// Determine position prefix for SIT/KNEEL poses
|
||||||
@@ -175,7 +175,7 @@ public class NpcAnimationTickHandler {
|
|||||||
BodyRegionV2.LEGS
|
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)) {
|
if (!armsBound && !legsBound && BindModeHelper.isBindItem(bind)) {
|
||||||
armsBound = BindModeHelper.hasArmsBound(bind);
|
armsBound = BindModeHelper.hasArmsBound(bind);
|
||||||
legsBound = BindModeHelper.hasLegsBound(bind);
|
legsBound = BindModeHelper.hasLegsBound(bind);
|
||||||
|
|||||||
@@ -198,12 +198,12 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
|
|||||||
int totalWidth = buttonWidth * 3 + MARGIN_S * 2;
|
int totalWidth = buttonWidth * 3 + MARGIN_S * 2;
|
||||||
int actionStartX = this.leftPos + (this.imageWidth - totalWidth) / 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)
|
.bounds(actionStartX, actionY, buttonWidth, BUTTON_HEIGHT)
|
||||||
.build();
|
.build();
|
||||||
this.addRenderableWidget(resetButton);
|
this.addRenderableWidget(resetButton);
|
||||||
|
|
||||||
decrementButton = Button.builder(Component.literal("-0.25"), b ->
|
decrementButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.decrement"), b ->
|
||||||
slider.decrement()
|
slider.decrement()
|
||||||
)
|
)
|
||||||
.bounds(
|
.bounds(
|
||||||
@@ -215,7 +215,7 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
|
|||||||
.build();
|
.build();
|
||||||
this.addRenderableWidget(decrementButton);
|
this.addRenderableWidget(decrementButton);
|
||||||
|
|
||||||
incrementButton = Button.builder(Component.literal("+0.25"), b ->
|
incrementButton = Button.builder(Component.translatable("gui.tiedup.adjustment.btn.increment"), b ->
|
||||||
slider.increment()
|
slider.increment()
|
||||||
)
|
)
|
||||||
.bounds(
|
.bounds(
|
||||||
@@ -235,14 +235,14 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
|
|||||||
int totalWidth = buttonWidth * 3 + MARGIN_S * 2;
|
int totalWidth = buttonWidth * 3 + MARGIN_S * 2;
|
||||||
int scaleStartX = this.leftPos + (this.imageWidth - totalWidth) / 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)
|
applyScale(AdjustmentHelper.DEFAULT_SCALE)
|
||||||
)
|
)
|
||||||
.bounds(scaleStartX, scaleY, buttonWidth, BUTTON_HEIGHT)
|
.bounds(scaleStartX, scaleY, buttonWidth, BUTTON_HEIGHT)
|
||||||
.build();
|
.build();
|
||||||
this.addRenderableWidget(scaleResetButton);
|
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)
|
applyScale(currentScaleValue - AdjustmentHelper.SCALE_STEP)
|
||||||
)
|
)
|
||||||
.bounds(
|
.bounds(
|
||||||
@@ -254,7 +254,7 @@ public abstract class BaseAdjustmentScreen extends BaseScreen {
|
|||||||
.build();
|
.build();
|
||||||
this.addRenderableWidget(scaleDecrementButton);
|
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)
|
applyScale(currentScaleValue + AdjustmentHelper.SCALE_STEP)
|
||||||
)
|
)
|
||||||
.bounds(
|
.bounds(
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ public class CellManagerScreen extends BaseScreen {
|
|||||||
if (cell.prisoners.isEmpty()) {
|
if (cell.prisoners.isEmpty()) {
|
||||||
graphics.drawString(
|
graphics.drawString(
|
||||||
this.font,
|
this.font,
|
||||||
Component.literal(" \u2514\u2500 ")
|
Component.translatable("gui.tiedup.cell_manager.tree_prefix")
|
||||||
.append(
|
.append(
|
||||||
Component.translatable(
|
Component.translatable(
|
||||||
"gui.tiedup.cell_manager.label.empty"
|
"gui.tiedup.cell_manager.label.empty"
|
||||||
|
|||||||
@@ -548,12 +548,9 @@ public class CommandWandScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addFollowDistanceCycleButton(int x, int y, int width) {
|
private void addFollowDistanceCycleButton(int x, int y, int width) {
|
||||||
String modeText = switch (followDistanceMode) {
|
Component modeLabel = Component.translatable(
|
||||||
case "HEEL" -> "H";
|
"gui.tiedup.command_wand.follow_distance.abbrev." + followDistanceMode.toLowerCase()
|
||||||
case "CLOSE" -> "C";
|
);
|
||||||
case "FAR" -> "F";
|
|
||||||
default -> "?";
|
|
||||||
};
|
|
||||||
|
|
||||||
Component tooltip = Component.translatable(
|
Component tooltip = Component.translatable(
|
||||||
"gui.tiedup.command_wand.follow_distance.tooltip"
|
"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()
|
cycleFollowDistance()
|
||||||
)
|
)
|
||||||
.bounds(x, y, width, BUTTON_HEIGHT)
|
.bounds(x, y, width, BUTTON_HEIGHT)
|
||||||
@@ -857,7 +854,7 @@ public class CommandWandScreen extends Screen {
|
|||||||
) {
|
) {
|
||||||
graphics.renderTooltip(
|
graphics.renderTooltip(
|
||||||
this.font,
|
this.font,
|
||||||
Component.literal((int) hunger + "%"),
|
Component.translatable("gui.tiedup.command_wand.percent", (int) hunger),
|
||||||
mouseX,
|
mouseX,
|
||||||
mouseY
|
mouseY
|
||||||
);
|
);
|
||||||
@@ -871,7 +868,7 @@ public class CommandWandScreen extends Screen {
|
|||||||
) {
|
) {
|
||||||
graphics.renderTooltip(
|
graphics.renderTooltip(
|
||||||
this.font,
|
this.font,
|
||||||
Component.literal((int) rest + "%"),
|
Component.translatable("gui.tiedup.command_wand.percent", (int) rest),
|
||||||
mouseX,
|
mouseX,
|
||||||
mouseY
|
mouseY
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -216,24 +216,24 @@ public class MerchantTradingScreen extends BaseScreen {
|
|||||||
int goldIngots = countItemInInventory(player, Items.GOLD_INGOT);
|
int goldIngots = countItemInInventory(player, Items.GOLD_INGOT);
|
||||||
int goldNuggets = countItemInInventory(player, Items.GOLD_NUGGET);
|
int goldNuggets = countItemInInventory(player, Items.GOLD_NUGGET);
|
||||||
|
|
||||||
Component goldText = Component.literal("Your Gold: ")
|
Component goldText = Component.translatable("gui.tiedup.merchant.your_gold")
|
||||||
.append(
|
.append(
|
||||||
Component.literal(goldIngots + "x ").withStyle(style ->
|
Component.translatable("gui.tiedup.merchant.gold_amount", goldIngots).withStyle(style ->
|
||||||
style.withColor(0xFFFFD700)
|
style.withColor(0xFFFFD700)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
Component.literal("⚜ ").withStyle(style ->
|
Component.translatable("gui.tiedup.merchant.gold_icon").withStyle(style ->
|
||||||
style.withColor(0xFFFFD700)
|
style.withColor(0xFFFFD700)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
Component.literal("+ " + goldNuggets + "x ").withStyle(
|
Component.translatable("gui.tiedup.merchant.nugget_amount", goldNuggets).withStyle(
|
||||||
style -> style.withColor(0xFFFFA500)
|
style -> style.withColor(0xFFFFA500)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
Component.literal("✦").withStyle(style ->
|
Component.translatable("gui.tiedup.merchant.nugget_icon").withStyle(style ->
|
||||||
style.withColor(0xFFFFA500)
|
style.withColor(0xFFFFA500)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class NpcInventoryScreen
|
|||||||
Inventory playerInventory,
|
Inventory playerInventory,
|
||||||
Component title
|
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
|
// Calculate rows from NPC inventory size
|
||||||
this.npcRows = (menu.getNpcSlotCount() + 8) / 9;
|
this.npcRows = (menu.getNpcSlotCount() + 8) / 9;
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class ActionPanel extends AbstractWidget {
|
|||||||
private int hoveredIndex = -1;
|
private int hoveredIndex = -1;
|
||||||
|
|
||||||
public ActionPanel(int x, int y, int width, int height) {
|
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) {
|
public void setMode(ScreenMode mode) {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class ItemPickerOverlay extends AbstractWidget {
|
|||||||
private int screenHeight;
|
private int screenHeight;
|
||||||
|
|
||||||
public ItemPickerOverlay() {
|
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.active = false;
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class RegionTabBar extends AbstractWidget {
|
|||||||
private LivingEntity targetEntity;
|
private LivingEntity targetEntity;
|
||||||
|
|
||||||
public RegionTabBar(int x, int y, int width) {
|
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) {
|
public void setOnTabChanged(Consumer<BodyTab> callback) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class StatusBarWidget extends AbstractWidget {
|
|||||||
private static final int CLOSE_BTN_HEIGHT = 22;
|
private static final int CLOSE_BTN_HEIGHT = 22;
|
||||||
|
|
||||||
public StatusBarWidget(int x, int y, int width, int height) {
|
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) {
|
public void setMode(ActionPanel.ScreenMode mode) {
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ public class BountyCommand {
|
|||||||
// Cannot bounty yourself
|
// Cannot bounty yourself
|
||||||
if (player.getUUID().equals(target.getUUID())) {
|
if (player.getUUID().equals(target.getUUID())) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You cannot put a bounty on yourself!"
|
"command.tiedup.bounty.cannot_self"
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -80,8 +80,8 @@ public class BountyCommand {
|
|||||||
IBondageState playerState = KidnappedHelper.getKidnappedState(player);
|
IBondageState playerState = KidnappedHelper.getKidnappedState(player);
|
||||||
if (playerState != null && playerState.isTiedUp()) {
|
if (playerState != null && playerState.isTiedUp()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You cannot create bounties while tied up!"
|
"command.tiedup.bounty.tied_up"
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -96,8 +96,8 @@ public class BountyCommand {
|
|||||||
player.serverLevel().getGameRules()
|
player.serverLevel().getGameRules()
|
||||||
);
|
);
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Maximum number (" + max + ") of active bounties reached!"
|
"command.tiedup.bounty.max_reached", max
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -107,8 +107,8 @@ public class BountyCommand {
|
|||||||
ItemStack heldItem = player.getMainHandItem();
|
ItemStack heldItem = player.getMainHandItem();
|
||||||
if (heldItem.isEmpty()) {
|
if (heldItem.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You must hold an item as the reward!"
|
"command.tiedup.bounty.must_hold_item"
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -143,8 +143,8 @@ public class BountyCommand {
|
|||||||
// Notify player
|
// Notify player
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Bounty created on " + target.getName().getString() + "!"
|
"command.tiedup.bounty.created", target.getName().getString()
|
||||||
).withStyle(ChatFormatting.GREEN),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@@ -153,12 +153,10 @@ public class BountyCommand {
|
|||||||
player.server
|
player.server
|
||||||
.getPlayerList()
|
.getPlayerList()
|
||||||
.broadcastSystemMessage(
|
.broadcastSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"[Bounty] " +
|
"command.tiedup.bounty.broadcast",
|
||||||
player.getName().getString() +
|
player.getName().getString(),
|
||||||
" has put a bounty on " +
|
target.getName().getString()
|
||||||
target.getName().getString() +
|
|
||||||
"!"
|
|
||||||
).withStyle(ChatFormatting.GOLD),
|
).withStyle(ChatFormatting.GOLD),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -117,9 +117,9 @@ public class CaptivityDebugCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"=== Captivity Debug Info ===\n" + debugInfo
|
"command.tiedup.debug.prisoner_header"
|
||||||
).withStyle(ChatFormatting.YELLOW),
|
).append(Component.literal("\n" + debugInfo)).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ public class CaptivityDebugCommand {
|
|||||||
ctx
|
ctx
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("Error: " + e.getMessage()).withStyle(
|
Component.translatable("command.tiedup.debug.error", e.getMessage()).withStyle(
|
||||||
ChatFormatting.RED
|
ChatFormatting.RED
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -149,8 +149,8 @@ public class CaptivityDebugCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Checking captivity system..."
|
"command.tiedup.debug.validate_checking"
|
||||||
).withStyle(ChatFormatting.YELLOW),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -163,9 +163,7 @@ public class CaptivityDebugCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(debugInfo).withStyle(
|
Component.literal(debugInfo).withStyle(ChatFormatting.GREEN),
|
||||||
ChatFormatting.GREEN
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -174,8 +172,8 @@ public class CaptivityDebugCommand {
|
|||||||
ctx
|
ctx
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Error during validation: " + e.getMessage()
|
"command.tiedup.debug.error", e.getMessage()
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
return 0; // Failure
|
return 0; // Failure
|
||||||
@@ -193,8 +191,8 @@ public class CaptivityDebugCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Repair functionality has been simplified with the new PrisonerManager system."
|
"command.tiedup.debug.repair_simplified"
|
||||||
).withStyle(ChatFormatting.YELLOW),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -203,8 +201,8 @@ public class CaptivityDebugCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"The new system maintains consistency automatically."
|
"command.tiedup.debug.repair_auto"
|
||||||
).withStyle(ChatFormatting.GREEN),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -214,7 +212,7 @@ public class CaptivityDebugCommand {
|
|||||||
ctx
|
ctx
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("Error: " + e.getMessage()).withStyle(
|
Component.translatable("command.tiedup.debug.error", e.getMessage()).withStyle(
|
||||||
ChatFormatting.RED
|
ChatFormatting.RED
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -251,8 +249,8 @@ public class CaptivityDebugCommand {
|
|||||||
ctx
|
ctx
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"No camp found with ID prefix: " + campIdPrefix
|
"command.tiedup.debug.camp_not_found", campIdPrefix
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -322,7 +320,7 @@ public class CaptivityDebugCommand {
|
|||||||
ctx
|
ctx
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("Error: " + e.getMessage()).withStyle(
|
Component.translatable("command.tiedup.debug.error", e.getMessage()).withStyle(
|
||||||
ChatFormatting.RED
|
ChatFormatting.RED
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.tiedup.remake.items.ItemAdminWand;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
@@ -110,7 +111,7 @@ public class CellCommand {
|
|||||||
|
|
||||||
// Must be a player
|
// Must be a player
|
||||||
if (!(source.getEntity() instanceof ServerPlayer 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,9 +122,7 @@ public class CellCommand {
|
|||||||
UUID selectedCellId = getSelectedCellFromWand(player);
|
UUID selectedCellId = getSelectedCellFromWand(player);
|
||||||
if (selectedCellId == null) {
|
if (selectedCellId == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.cell.no_selection")
|
||||||
"No cell selected. Use the Admin Wand on a Cell Core first."
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -131,7 +130,7 @@ public class CellCommand {
|
|||||||
CellDataV2 cell = registry.getCell(selectedCellId);
|
CellDataV2 cell = registry.getCell(selectedCellId);
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Selected cell no longer exists")
|
Component.translatable("command.tiedup.cell.no_longer_exists")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -142,7 +141,7 @@ public class CellCommand {
|
|||||||
existingCell != null && !existingCell.getId().equals(selectedCellId)
|
existingCell != null && !existingCell.getId().equals(selectedCellId)
|
||||||
) {
|
) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Cell name '" + name + "' already exists")
|
Component.translatable("command.tiedup.cell.name_exists", name)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -161,9 +160,7 @@ public class CellCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.cell.named", name).withStyle(ChatFormatting.GREEN),
|
||||||
"Named cell '" + name + "' and linked to you"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -182,20 +179,20 @@ public class CellCommand {
|
|||||||
Collection<CellDataV2> cells = registry.getAllCells();
|
Collection<CellDataV2> cells = registry.getAllCells();
|
||||||
if (cells.isEmpty()) {
|
if (cells.isEmpty()) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("No cells registered"),
|
() -> Component.translatable("command.tiedup.cell.none_registered"),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("=== Cells (" + cells.size() + ") ==="),
|
() -> Component.translatable("command.tiedup.cell.list_header", cells.size()).withStyle(ChatFormatting.GOLD),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
for (CellDataV2 cell : cells) {
|
for (CellDataV2 cell : cells) {
|
||||||
String info = formatCellInfo(cell, serverLevel);
|
String info = formatCellInfo(cell, serverLevel);
|
||||||
source.sendSuccess(() -> Component.literal(info), false);
|
source.sendSuccess(() -> Component.literal(info).withStyle(ChatFormatting.GRAY), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -217,9 +214,7 @@ public class CellCommand {
|
|||||||
if (cells.isEmpty()) {
|
if (cells.isEmpty()) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.cell.no_cells_for_owner", owner.getName().getString()),
|
||||||
owner.getName().getString() + " has no cells"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -227,19 +222,17 @@ public class CellCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"=== Cells owned by " +
|
"command.tiedup.cell.list_owner_header",
|
||||||
owner.getName().getString() +
|
owner.getName().getString(),
|
||||||
" (" +
|
cells.size()
|
||||||
cells.size() +
|
).withStyle(ChatFormatting.GOLD),
|
||||||
") ==="
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
for (CellDataV2 cell : cells) {
|
for (CellDataV2 cell : cells) {
|
||||||
String info = formatCellInfo(cell, serverLevel);
|
String info = formatCellInfo(cell, serverLevel);
|
||||||
source.sendSuccess(() -> Component.literal(info), false);
|
source.sendSuccess(() -> Component.literal(info).withStyle(ChatFormatting.GRAY), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -257,7 +250,7 @@ public class CellCommand {
|
|||||||
|
|
||||||
// Must be a player
|
// Must be a player
|
||||||
if (!(source.getEntity() instanceof ServerPlayer 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,9 +260,7 @@ public class CellCommand {
|
|||||||
UUID selectedCellId = getSelectedCellFromWand(player);
|
UUID selectedCellId = getSelectedCellFromWand(player);
|
||||||
if (selectedCellId == null) {
|
if (selectedCellId == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.cell.no_selection")
|
||||||
"No cell selected. Use the Admin Wand on a Cell Core first."
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -277,7 +268,7 @@ public class CellCommand {
|
|||||||
CellDataV2 cell = registry.getCell(selectedCellId);
|
CellDataV2 cell = registry.getCell(selectedCellId);
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Selected cell no longer exists")
|
Component.translatable("command.tiedup.cell.no_longer_exists")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -300,7 +291,7 @@ public class CellCommand {
|
|||||||
CellDataV2 cell = registry.getCellByName(name);
|
CellDataV2 cell = registry.getCellByName(name);
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Cell '" + name + "' not found")
|
Component.translatable("command.tiedup.cell.not_found", name)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -321,7 +312,7 @@ public class CellCommand {
|
|||||||
|
|
||||||
// Must be a player
|
// Must be a player
|
||||||
if (!(source.getEntity() instanceof ServerPlayer 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,9 +322,7 @@ public class CellCommand {
|
|||||||
UUID selectedCellId = getSelectedCellFromWand(player);
|
UUID selectedCellId = getSelectedCellFromWand(player);
|
||||||
if (selectedCellId == null) {
|
if (selectedCellId == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.cell.no_selection")
|
||||||
"No cell selected. Use the Admin Wand on a Cell Core first."
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -341,7 +330,7 @@ public class CellCommand {
|
|||||||
CellDataV2 cell = registry.getCell(selectedCellId);
|
CellDataV2 cell = registry.getCell(selectedCellId);
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Selected cell no longer exists")
|
Component.translatable("command.tiedup.cell.no_longer_exists")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -365,7 +354,7 @@ public class CellCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("Deleted cell '" + cellName + "'"),
|
() -> Component.translatable("command.tiedup.cell.deleted", cellName).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -438,24 +427,16 @@ public class CellCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Reset " +
|
"command.tiedup.cell.reset_spawns", finalResetCount, finalSpawnMarkerCount, radius
|
||||||
finalResetCount +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
" spawn markers (found " +
|
|
||||||
finalSpawnMarkerCount +
|
|
||||||
" total spawn markers in " +
|
|
||||||
radius +
|
|
||||||
" block radius)"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
if (resetCount > 0) {
|
if (resetCount > 0) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.cell.reset_spawns_hint").withStyle(ChatFormatting.GRAY),
|
||||||
"You can now save the structure - NPCs will spawn when it's placed."
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -541,25 +522,25 @@ public class CellCommand {
|
|||||||
String nameDisplay =
|
String nameDisplay =
|
||||||
cell.getName() != null ? cell.getName() : "(unnamed)";
|
cell.getName() != null ? cell.getName() : "(unnamed)";
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("=== Cell: " + nameDisplay + " ==="),
|
() -> Component.translatable("command.tiedup.cell.info_header", nameDisplay).withStyle(ChatFormatting.GOLD),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("ID: " + cell.getId().toString()),
|
() -> Component.translatable("command.tiedup.cell.info_id", cell.getId().toString()).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("State: " + cell.getState()),
|
() -> Component.translatable("command.tiedup.cell.info_state", cell.getState().toString()).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Core Position: " + cell.getCorePos().toShortString()
|
"command.tiedup.cell.info_core_pos", cell.getCorePos().toShortString()
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -567,9 +548,9 @@ public class CellCommand {
|
|||||||
if (cell.getSpawnPoint() != null) {
|
if (cell.getSpawnPoint() != null) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Spawn Point: " + cell.getSpawnPoint().toShortString()
|
"command.tiedup.cell.info_spawn_point", cell.getSpawnPoint().toShortString()
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -584,18 +565,16 @@ public class CellCommand {
|
|||||||
owner != null ? owner.getName().getString() : "(offline)";
|
owner != null ? owner.getName().getString() : "(offline)";
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Owner: " +
|
"command.tiedup.cell.info_owner",
|
||||||
ownerName +
|
ownerName,
|
||||||
" (" +
|
cell.getOwnerId().toString().substring(0, 8) + "..."
|
||||||
cell.getOwnerId().toString().substring(0, 8) +
|
).withStyle(ChatFormatting.GRAY),
|
||||||
"...)"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("Owner: (world-generated)"),
|
() -> Component.translatable("command.tiedup.cell.info_owner_world").withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -603,16 +582,16 @@ public class CellCommand {
|
|||||||
// Geometry
|
// Geometry
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Interior blocks: " + cell.getInteriorBlocks().size()
|
"command.tiedup.cell.info_interior", cell.getInteriorBlocks().size()
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Wall blocks: " + cell.getWallBlocks().size()
|
"command.tiedup.cell.info_walls", cell.getWallBlocks().size()
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -620,16 +599,11 @@ public class CellCommand {
|
|||||||
if (!cell.getBreachedPositions().isEmpty()) {
|
if (!cell.getBreachedPositions().isEmpty()) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Breaches: " +
|
"command.tiedup.cell.info_breaches",
|
||||||
cell.getBreachedPositions().size() +
|
cell.getBreachedPositions().size(),
|
||||||
" (" +
|
String.format("%.1f", cell.getBreachPercentage() * 100)
|
||||||
String.format(
|
).withStyle(ChatFormatting.RED),
|
||||||
"%.1f",
|
|
||||||
cell.getBreachPercentage() * 100
|
|
||||||
) +
|
|
||||||
"%)"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -637,19 +611,19 @@ public class CellCommand {
|
|||||||
// Features
|
// Features
|
||||||
if (!cell.getBeds().isEmpty()) {
|
if (!cell.getBeds().isEmpty()) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("Beds: " + cell.getBeds().size()),
|
() -> Component.translatable("command.tiedup.cell.info_beds", cell.getBeds().size()).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!cell.getAnchors().isEmpty()) {
|
if (!cell.getAnchors().isEmpty()) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("Anchors: " + cell.getAnchors().size()),
|
() -> Component.translatable("command.tiedup.cell.info_anchors", cell.getAnchors().size()).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!cell.getDoors().isEmpty()) {
|
if (!cell.getDoors().isEmpty()) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("Doors: " + cell.getDoors().size()),
|
() -> Component.translatable("command.tiedup.cell.info_doors", cell.getDoors().size()).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -657,9 +631,9 @@ public class CellCommand {
|
|||||||
// Prisoners
|
// Prisoners
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Prisoners: " + cell.getPrisonerCount() + "/4"
|
"command.tiedup.cell.info_prisoners", cell.getPrisonerCount()
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
for (UUID prisonerId : cell.getPrisonerIds()) {
|
for (UUID prisonerId : cell.getPrisonerIds()) {
|
||||||
@@ -670,7 +644,7 @@ public class CellCommand {
|
|||||||
String prisonerName =
|
String prisonerName =
|
||||||
prisoner != null ? prisoner.getName().getString() : "(offline)";
|
prisoner != null ? prisoner.getName().getString() : "(offline)";
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal(" - " + prisonerName),
|
() -> Component.literal(" - " + prisonerName).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.tiedup.remake.v2.bondage.CollarHelper;
|
|||||||
import com.tiedup.remake.util.teleport.Position;
|
import com.tiedup.remake.util.teleport.Position;
|
||||||
import com.tiedup.remake.util.teleport.TeleportHelper;
|
import com.tiedup.remake.util.teleport.TeleportHelper;
|
||||||
import com.tiedup.remake.v2.BodyRegionV2;
|
import com.tiedup.remake.v2.BodyRegionV2;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
@@ -152,9 +153,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -164,18 +163,16 @@ public class CollarCommand {
|
|||||||
CollarHelper.addOwner(collar, executor);
|
CollarHelper.addOwner(collar, executor);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aClaimed " +
|
"command.tiedup.collar_cmd.claimed", target.getName().getString()
|
||||||
target.getName().getString() +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
"'s collar"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendFailure(Component.literal("Failed to claim collar"));
|
source.sendFailure(Component.translatable("command.tiedup.collar_cmd.claim_failed"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,9 +184,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -199,18 +194,16 @@ public class CollarCommand {
|
|||||||
CollarHelper.removeOwner(collar, executor.getUUID());
|
CollarHelper.removeOwner(collar, executor.getUUID());
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aRemoved your ownership from " +
|
"command.tiedup.collar_cmd.unclaimed", target.getName().getString()
|
||||||
target.getName().getString() +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
"'s collar"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendFailure(Component.literal("Failed to unclaim collar"));
|
source.sendFailure(Component.translatable("command.tiedup.collar_cmd.unclaim_failed"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,9 +216,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -234,9 +225,9 @@ public class CollarCommand {
|
|||||||
CollarHelper.setNickname(collar, name);
|
CollarHelper.setNickname(collar, name);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aSet collar nickname to '" + name + "'"
|
"command.tiedup.collar_cmd.renamed", name
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -254,9 +245,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -265,13 +254,11 @@ public class CollarCommand {
|
|||||||
CollarHelper.addOwner(collar, owner);
|
CollarHelper.addOwner(collar, owner);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aAdded " +
|
"command.tiedup.collar_cmd.owner_added",
|
||||||
owner.getName().getString() +
|
owner.getName().getString(),
|
||||||
" as owner of " +
|
target.getName().getString()
|
||||||
target.getName().getString() +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
"'s collar"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -289,9 +276,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -300,13 +285,11 @@ public class CollarCommand {
|
|||||||
CollarHelper.removeOwner(collar, owner.getUUID());
|
CollarHelper.removeOwner(collar, owner.getUUID());
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aRemoved " +
|
"command.tiedup.collar_cmd.owner_removed",
|
||||||
owner.getName().getString() +
|
owner.getName().getString(),
|
||||||
" as owner of " +
|
target.getName().getString()
|
||||||
target.getName().getString() +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
"'s collar"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -329,9 +312,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -343,7 +324,7 @@ public class CollarCommand {
|
|||||||
|
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Cell '" + cellName + "' not found")
|
Component.translatable("command.tiedup.collar_cmd.cell_not_found", cellName)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -352,13 +333,11 @@ public class CollarCommand {
|
|||||||
CollarHelper.setCellId(collar, cell.getId());
|
CollarHelper.setCellId(collar, cell.getId());
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aAssigned cell '" +
|
"command.tiedup.collar_cmd.cell_assigned",
|
||||||
cellName +
|
cellName,
|
||||||
"' to " +
|
target.getName().getString()
|
||||||
target.getName().getString() +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
"'s collar"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -381,9 +360,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -391,7 +368,7 @@ public class CollarCommand {
|
|||||||
if (CollarHelper.isCollar(collar)) {
|
if (CollarHelper.isCollar(collar)) {
|
||||||
if (!CollarHelper.hasCellAssigned(collar)) {
|
if (!CollarHelper.hasCellAssigned(collar)) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("No cell assigned to collar")
|
Component.translatable("command.tiedup.collar_cmd.no_cell_assigned")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -403,7 +380,7 @@ public class CollarCommand {
|
|||||||
|
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Assigned cell no longer exists")
|
Component.translatable("command.tiedup.collar_cmd.cell_deleted")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -420,12 +397,11 @@ public class CollarCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aTeleported " +
|
"command.tiedup.collar_cmd.teleported",
|
||||||
target.getName().getString() +
|
target.getName().getString(),
|
||||||
" to cell at " +
|
cell.getCorePos().toShortString()
|
||||||
cell.getCorePos().toShortString()
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -442,9 +418,7 @@ public class CollarCommand {
|
|||||||
ItemStack collar = getPlayerCollar(target);
|
ItemStack collar = getPlayerCollar(target);
|
||||||
if (collar.isEmpty()) {
|
if (collar.isEmpty()) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.no_collar", target.getName().getString())
|
||||||
target.getName().getString() + " does not have a collar"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -452,28 +426,23 @@ public class CollarCommand {
|
|||||||
if (CollarHelper.isCollar(collar)) {
|
if (CollarHelper.isCollar(collar)) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§6=== Collar Info for " +
|
"command.tiedup.collar_cmd.info_header",
|
||||||
target.getName().getString() +
|
target.getName().getString()
|
||||||
" ==="
|
).withStyle(ChatFormatting.GOLD),
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
String nickname = CollarHelper.getNickname(collar);
|
String nickname = CollarHelper.getNickname(collar);
|
||||||
|
String nicknameDisplay = (nickname == null || nickname.isEmpty()) ? "None" : nickname;
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.info_nickname", nicknameDisplay).withStyle(ChatFormatting.GRAY),
|
||||||
"§7Nickname: §f" +
|
|
||||||
(nickname == null || nickname.isEmpty() ? "None" : nickname)
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.collar_cmd.info_has_owner", String.valueOf(CollarHelper.hasOwner(collar))).withStyle(ChatFormatting.GRAY),
|
||||||
"§7Has Owner: §f" + CollarHelper.hasOwner(collar)
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
// Cell assignment
|
// Cell assignment
|
||||||
@@ -489,23 +458,22 @@ public class CollarCommand {
|
|||||||
: cellId.toString().substring(0, 8) + "...";
|
: cellId.toString().substring(0, 8) + "...";
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§7Assigned Cell: §a" +
|
"command.tiedup.collar_cmd.info_cell",
|
||||||
cellDisplay +
|
cellDisplay,
|
||||||
" §7@ " +
|
cell.getCorePos().toShortString()
|
||||||
cell.getCorePos().toShortString()
|
).withStyle(ChatFormatting.GRAY),
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§7Assigned Cell: §c(deleted)"),
|
() -> Component.translatable("command.tiedup.collar_cmd.info_cell_deleted").withStyle(ChatFormatting.RED),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§7Assigned Cell: §fNone"),
|
() -> Component.translatable("command.tiedup.collar_cmd.info_cell_none").withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -514,9 +482,9 @@ public class CollarCommand {
|
|||||||
&& lockable.isLocked(collar);
|
&& lockable.isLocked(collar);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§7Locked: §f" + locked
|
"command.tiedup.collar_cmd.info_locked", String.valueOf(locked)
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public final class CommandHelper {
|
|||||||
if (source.getEntity() instanceof ServerPlayer player) {
|
if (source.getEntity() instanceof ServerPlayer player) {
|
||||||
return Optional.of(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();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.mojang.brigadier.context.CommandContext;
|
|||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import com.tiedup.remake.items.ModItems;
|
import com.tiedup.remake.items.ModItems;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
@@ -89,7 +90,7 @@ public class KeyCommand {
|
|||||||
|
|
||||||
ItemStack key = getHeldKey(player);
|
ItemStack key = getHeldKey(player);
|
||||||
if (key.isEmpty()) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +102,7 @@ public class KeyCommand {
|
|||||||
!tag.getUUID(TAG_OWNER).equals(player.getUUID())
|
!tag.getUUID(TAG_OWNER).equals(player.getUUID())
|
||||||
) {
|
) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("This key is already claimed by someone else")
|
Component.translatable("command.tiedup.key.already_claimed")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -110,7 +111,7 @@ public class KeyCommand {
|
|||||||
tag.putString(TAG_OWNER_NAME, player.getName().getString());
|
tag.putString(TAG_OWNER_NAME, player.getName().getString());
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§aYou have claimed this key"),
|
() -> Component.translatable("command.tiedup.key.claimed").withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -129,19 +130,19 @@ public class KeyCommand {
|
|||||||
|
|
||||||
ItemStack key = getHeldKey(player);
|
ItemStack key = getHeldKey(player);
|
||||||
if (key.isEmpty()) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundTag tag = key.getOrCreateTag();
|
CompoundTag tag = key.getOrCreateTag();
|
||||||
|
|
||||||
if (!tag.hasUUID(TAG_OWNER)) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tag.getUUID(TAG_OWNER).equals(player.getUUID())) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +150,7 @@ public class KeyCommand {
|
|||||||
tag.remove(TAG_OWNER_NAME);
|
tag.remove(TAG_OWNER_NAME);
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§aYou have unclaimed this key"),
|
() -> Component.translatable("command.tiedup.key.unclaimed").withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -170,7 +171,7 @@ public class KeyCommand {
|
|||||||
|
|
||||||
ItemStack key = getHeldKey(player);
|
ItemStack key = getHeldKey(player);
|
||||||
if (key.isEmpty()) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +182,7 @@ public class KeyCommand {
|
|||||||
tag.hasUUID(TAG_OWNER) &&
|
tag.hasUUID(TAG_OWNER) &&
|
||||||
!tag.getUUID(TAG_OWNER).equals(player.getUUID())
|
!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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,9 +191,9 @@ public class KeyCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aAssigned key to " + target.getName().getString()
|
"command.tiedup.key.assigned", target.getName().getString()
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -211,7 +212,7 @@ public class KeyCommand {
|
|||||||
|
|
||||||
ItemStack key = getHeldKey(player);
|
ItemStack key = getHeldKey(player);
|
||||||
if (key.isEmpty()) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +223,7 @@ public class KeyCommand {
|
|||||||
tag.hasUUID(TAG_OWNER) &&
|
tag.hasUUID(TAG_OWNER) &&
|
||||||
!tag.getUUID(TAG_OWNER).equals(player.getUUID())
|
!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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,9 +232,9 @@ public class KeyCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aKey is now " + (isPublic ? "public" : "private")
|
isPublic ? "command.tiedup.key.now_public" : "command.tiedup.key.now_private"
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -252,40 +253,40 @@ public class KeyCommand {
|
|||||||
|
|
||||||
ItemStack key = getHeldKey(player);
|
ItemStack key = getHeldKey(player);
|
||||||
if (key.isEmpty()) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundTag tag = key.getOrCreateTag();
|
CompoundTag tag = key.getOrCreateTag();
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§6=== Key Info ==="),
|
() -> Component.translatable("command.tiedup.key.info_header").withStyle(ChatFormatting.GOLD),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
String ownerName = tag.getString(TAG_OWNER_NAME);
|
String ownerName = tag.getString(TAG_OWNER_NAME);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§7Owner: §f" +
|
"command.tiedup.key.info_owner",
|
||||||
(ownerName.isEmpty() ? "Not claimed" : ownerName)
|
ownerName.isEmpty() ? "Not claimed" : ownerName
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
String targetName = tag.getString(TAG_TARGET_NAME);
|
String targetName = tag.getString(TAG_TARGET_NAME);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§7Assigned to: §f" +
|
"command.tiedup.key.info_assigned",
|
||||||
(targetName.isEmpty() ? "Not assigned" : targetName)
|
targetName.isEmpty() ? "Not assigned" : targetName
|
||||||
),
|
).withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
boolean isPublic = tag.getBoolean(TAG_PUBLIC);
|
boolean isPublic = tag.getBoolean(TAG_PUBLIC);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§7Public: §f" + (isPublic ? "Yes" : "No")),
|
() -> Component.translatable("command.tiedup.key.info_public", isPublic ? "Yes" : "No").withStyle(ChatFormatting.GRAY),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.tiedup.remake.items.base.KnifeVariant;
|
|||||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
@@ -147,9 +148,9 @@ public class KidnapSetCommand {
|
|||||||
int finalGiven = given;
|
int finalGiven = given;
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aGave kidnap set (" + finalGiven + " item stacks)"
|
"command.tiedup.kidnapset.gave", finalGiven
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -205,13 +206,11 @@ public class KidnapSetCommand {
|
|||||||
int finalReloaded = reloaded;
|
int finalReloaded = reloaded;
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aReloaded " +
|
"command.tiedup.kidnapreload.reloaded",
|
||||||
(type.equals("all") ? "all data files" : type) +
|
type.equals("all") ? "all data files" : type,
|
||||||
" (" +
|
finalReloaded
|
||||||
finalReloaded +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
" files)"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.resources.ResourceLocation;
|
|||||||
import com.tiedup.remake.v2.BodyRegionV2;
|
import com.tiedup.remake.v2.BodyRegionV2;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
@@ -199,7 +200,7 @@ public class NPCCommand {
|
|||||||
z = player.getZ();
|
z = player.getZ();
|
||||||
} else {
|
} else {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Must specify a player or be a player")
|
Component.translatable("command.tiedup.error.must_be_player")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -219,15 +220,15 @@ public class NPCCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aSpawned Kidnapper at " + formatPos(x, y, z)
|
"command.tiedup.npc.spawned_kidnapper", formatPos(x, y, z)
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendFailure(Component.literal("Failed to spawn Kidnapper"));
|
source.sendFailure(Component.translatable("command.tiedup.npc.spawn_failed_kidnapper"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,11 +246,7 @@ public class NPCCommand {
|
|||||||
);
|
);
|
||||||
if (variant == null) {
|
if (variant == null) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.unknown_variant", name)
|
||||||
"Unknown elite variant: " +
|
|
||||||
name +
|
|
||||||
". Available: suki, carol, athena, evelyn"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -266,7 +263,7 @@ public class NPCCommand {
|
|||||||
z = player.getZ();
|
z = player.getZ();
|
||||||
} else {
|
} else {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Must specify a player or be a player")
|
Component.translatable("command.tiedup.error.must_be_player")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -289,19 +286,16 @@ public class NPCCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aSpawned Elite Kidnapper '" +
|
"command.tiedup.npc.spawned_elite", variant.defaultName(), formatPos(x, y, z)
|
||||||
variant.defaultName() +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
"' at " +
|
|
||||||
formatPos(x, y, z)
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Failed to spawn Elite Kidnapper")
|
Component.translatable("command.tiedup.npc.spawn_failed_elite")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -325,7 +319,7 @@ public class NPCCommand {
|
|||||||
z = player.getZ();
|
z = player.getZ();
|
||||||
} else {
|
} else {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Must specify a player or be a player")
|
Component.translatable("command.tiedup.error.must_be_player")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -346,16 +340,16 @@ public class NPCCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aSpawned Archer Kidnapper at " + formatPos(x, y, z)
|
"command.tiedup.npc.spawned_archer", formatPos(x, y, z)
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Failed to spawn Archer Kidnapper")
|
Component.translatable("command.tiedup.npc.spawn_failed_archer")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -379,7 +373,7 @@ public class NPCCommand {
|
|||||||
z = player.getZ();
|
z = player.getZ();
|
||||||
} else {
|
} else {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("Must specify a player or be a player")
|
Component.translatable("command.tiedup.error.must_be_player")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -399,15 +393,15 @@ public class NPCCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aSpawned Damsel at " + formatPos(x, y, z)
|
"command.tiedup.npc.spawned_damsel", formatPos(x, y, z)
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendFailure(Component.literal("Failed to spawn Damsel"));
|
source.sendFailure(Component.translatable("command.tiedup.npc.spawn_failed_damsel"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,9 +435,9 @@ public class NPCCommand {
|
|||||||
int finalKilled = killed;
|
int finalKilled = killed;
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aKilled " + finalKilled + " mod NPCs in radius " + radius
|
"command.tiedup.npc.killed", finalKilled, radius
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -491,7 +485,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -499,7 +493,7 @@ public class NPCCommand {
|
|||||||
if (npc.isTiedUp()) {
|
if (npc.isTiedUp()) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("NPC is already tied up"));
|
.sendFailure(Component.translatable("command.tiedup.npc.already_tied"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,7 +504,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() -> Component.literal("§aTied up " + npc.getKidnappedName()),
|
() -> Component.translatable("command.tiedup.npc.tied", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -522,7 +516,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -530,7 +524,7 @@ public class NPCCommand {
|
|||||||
if (npc.isGagged()) {
|
if (npc.isGagged()) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("NPC is already gagged"));
|
.sendFailure(Component.translatable("command.tiedup.npc.already_gagged"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -541,7 +535,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() -> Component.literal("§aGagged " + npc.getKidnappedName()),
|
() -> Component.translatable("command.tiedup.npc.gagged", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -555,7 +549,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -563,7 +557,7 @@ public class NPCCommand {
|
|||||||
if (npc.isBlindfolded()) {
|
if (npc.isBlindfolded()) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("NPC is already blindfolded"));
|
.sendFailure(Component.translatable("command.tiedup.npc.already_blindfolded"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,9 +569,8 @@ public class NPCCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.blindfolded", npc.getKidnappedName()
|
||||||
"§aBlindfolded " + npc.getKidnappedName()
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -589,7 +582,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -597,7 +590,7 @@ public class NPCCommand {
|
|||||||
if (npc.hasCollar()) {
|
if (npc.hasCollar()) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("NPC already has a collar"));
|
.sendFailure(Component.translatable("command.tiedup.npc.already_collared"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,7 +601,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() -> Component.literal("§aCollared " + npc.getKidnappedName()),
|
() -> Component.translatable("command.tiedup.npc.collared", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -620,7 +613,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -629,7 +622,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() -> Component.literal("§aUntied " + npc.getKidnappedName()),
|
() -> Component.translatable("command.tiedup.npc.untied", npc.getKidnappedName()).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -643,7 +636,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -667,9 +660,9 @@ public class NPCCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§aFully restrained " + npc.getKidnappedName()
|
"command.tiedup.npc.fully_restrained", npc.getKidnappedName()
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -683,7 +676,7 @@ public class NPCCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No mod NPC found within 10 blocks")
|
Component.translatable("command.tiedup.npc.no_npc_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -692,68 +685,67 @@ public class NPCCommand {
|
|||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"§6=== NPC State: " + npc.getKidnappedName() + " ==="
|
"command.tiedup.npc.state_header", npc.getKidnappedName()
|
||||||
),
|
).withStyle(ChatFormatting.GOLD),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (npc instanceof EntityDamsel damsel) {
|
if (npc instanceof EntityDamsel damsel) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal("§eVariant: §f" + damsel.getVariantId()),
|
Component.translatable("command.tiedup.npc.state_variant", damsel.getVariantId()).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_slim_arms",
|
||||||
"§eSlim Arms: " +
|
Component.translatable(damsel.hasSlimArms() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
(damsel.hasSlimArms() ? "§aYes" : "§7No")
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_tied",
|
||||||
"§eTied Up: " + (npc.isTiedUp() ? "§aYes" : "§7No")
|
Component.translatable(npc.isTiedUp() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_gagged",
|
||||||
"§eGagged: " + (npc.isGagged() ? "§aYes" : "§7No")
|
Component.translatable(npc.isGagged() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_blindfolded",
|
||||||
"§eBlindfolded: " + (npc.isBlindfolded() ? "§aYes" : "§7No")
|
Component.translatable(npc.isBlindfolded() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_collar",
|
||||||
"§eHas Collar: " + (npc.hasCollar() ? "§aYes" : "§7No")
|
Component.translatable(npc.hasCollar() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_earplugs",
|
||||||
"§eHas Earplugs: " + (npc.hasEarplugs() ? "§aYes" : "§7No")
|
Component.translatable(npc.hasEarplugs() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.npc.state_captive",
|
||||||
"§eIs Captive: " + (npc.isCaptive() ? "§aYes" : "§7No")
|
Component.translatable(npc.isCaptive() ? "command.tiedup.yes" : "command.tiedup.no")
|
||||||
),
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class SocialCommand {
|
|||||||
ServerPlayer target = EntityArgument.getPlayer(context, "player");
|
ServerPlayer target = EntityArgument.getPlayer(context, "player");
|
||||||
|
|
||||||
if (player.getUUID().equals(target.getUUID())) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,9 +170,7 @@ public class SocialCommand {
|
|||||||
|
|
||||||
if (data.isBlocked(player.getUUID(), target.getUUID())) {
|
if (data.isBlocked(player.getUUID(), target.getUUID())) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.already_blocked", target.getName().getString())
|
||||||
target.getName().getString() + " is already blocked"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -180,7 +178,7 @@ public class SocialCommand {
|
|||||||
data.addBlock(player.getUUID(), target.getUUID());
|
data.addBlock(player.getUUID(), target.getUUID());
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal("§aBlocked " + target.getName().getString()),
|
Component.translatable("command.tiedup.social.blocked", target.getName().getString()).withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -208,9 +206,7 @@ public class SocialCommand {
|
|||||||
|
|
||||||
if (!data.isBlocked(player.getUUID(), target.getUUID())) {
|
if (!data.isBlocked(player.getUUID(), target.getUUID())) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.not_blocked", target.getName().getString())
|
||||||
target.getName().getString() + " is not blocked"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -218,9 +214,7 @@ public class SocialCommand {
|
|||||||
data.removeBlock(player.getUUID(), target.getUUID());
|
data.removeBlock(player.getUUID(), target.getUUID());
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.unblocked", target.getName().getString()).withStyle(ChatFormatting.GREEN),
|
||||||
"§aUnblocked " + target.getName().getString()
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -245,19 +239,13 @@ public class SocialCommand {
|
|||||||
if (blocked) {
|
if (blocked) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.has_blocked_you", target.getName().getString()).withStyle(ChatFormatting.RED),
|
||||||
"§c" + target.getName().getString() + " has blocked you"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.has_not_blocked_you", target.getName().getString()).withStyle(ChatFormatting.GREEN),
|
||||||
"§a" +
|
|
||||||
target.getName().getString() +
|
|
||||||
" has not blocked you"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -300,11 +288,7 @@ public class SocialCommand {
|
|||||||
if (lastUse != null && now - lastUse < NORP_COOLDOWN_MS) {
|
if (lastUse != null && now - lastUse < NORP_COOLDOWN_MS) {
|
||||||
long remaining = (NORP_COOLDOWN_MS - (now - lastUse)) / 1000;
|
long remaining = (NORP_COOLDOWN_MS - (now - lastUse)) / 1000;
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.norp_cooldown", remaining)
|
||||||
"Please wait " +
|
|
||||||
remaining +
|
|
||||||
" seconds before using /norp again"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -315,7 +299,7 @@ public class SocialCommand {
|
|||||||
// Broadcast to all players
|
// Broadcast to all players
|
||||||
Component message = Component.literal("")
|
Component message = Component.literal("")
|
||||||
.append(
|
.append(
|
||||||
Component.literal("[NoRP] ").withStyle(
|
Component.translatable("command.tiedup.social.norp_prefix").withStyle(
|
||||||
ChatFormatting.RED,
|
ChatFormatting.RED,
|
||||||
ChatFormatting.BOLD
|
ChatFormatting.BOLD
|
||||||
)
|
)
|
||||||
@@ -326,8 +310,8 @@ public class SocialCommand {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
" has announced non-consent to current RP"
|
"command.tiedup.social.norp_announcement"
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -411,7 +395,7 @@ public class SocialCommand {
|
|||||||
SocialData data = SocialData.get(sender.serverLevel());
|
SocialData data = SocialData.get(sender.serverLevel());
|
||||||
if (data.isBlocked(target.getUUID(), sender.getUUID())) {
|
if (data.isBlocked(target.getUUID(), sender.getUUID())) {
|
||||||
source.sendFailure(
|
source.sendFailure(
|
||||||
Component.literal("This player has blocked you")
|
Component.translatable("command.tiedup.social.pm_blocked")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -419,8 +403,8 @@ public class SocialCommand {
|
|||||||
// Send to target (earplug-aware)
|
// Send to target (earplug-aware)
|
||||||
Component toTarget = Component.literal("")
|
Component toTarget = Component.literal("")
|
||||||
.append(
|
.append(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"[PM from " + sender.getName().getString() + "] "
|
"command.tiedup.social.pm_from", sender.getName().getString()
|
||||||
).withStyle(ChatFormatting.LIGHT_PURPLE)
|
).withStyle(ChatFormatting.LIGHT_PURPLE)
|
||||||
)
|
)
|
||||||
.append(Component.literal(message).withStyle(ChatFormatting.WHITE));
|
.append(Component.literal(message).withStyle(ChatFormatting.WHITE));
|
||||||
@@ -429,8 +413,8 @@ public class SocialCommand {
|
|||||||
// Confirm to sender (always show - they're the one sending)
|
// Confirm to sender (always show - they're the one sending)
|
||||||
Component toSender = Component.literal("")
|
Component toSender = Component.literal("")
|
||||||
.append(
|
.append(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"[PM to " + target.getName().getString() + "] "
|
"command.tiedup.social.pm_to", target.getName().getString()
|
||||||
).withStyle(ChatFormatting.GRAY)
|
).withStyle(ChatFormatting.GRAY)
|
||||||
)
|
)
|
||||||
.append(Component.literal(message).withStyle(ChatFormatting.WHITE));
|
.append(Component.literal(message).withStyle(ChatFormatting.WHITE));
|
||||||
@@ -458,15 +442,13 @@ public class SocialCommand {
|
|||||||
|
|
||||||
if (distance == 0) {
|
if (distance == 0) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("§aTalk area disabled (global chat)"),
|
() -> Component.translatable("command.tiedup.social.talkarea_disabled").withStyle(ChatFormatting.GREEN),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.social.talkarea_set", distance).withStyle(ChatFormatting.GREEN),
|
||||||
"§aTalk area set to " + distance + " blocks"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -490,12 +472,12 @@ public class SocialCommand {
|
|||||||
if (talkArea == 0) {
|
if (talkArea == 0) {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal("Talk area: §edisabled §7(global chat)"),
|
Component.translatable("command.tiedup.social.talkinfo_disabled").withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
source.sendSuccess(
|
source.sendSuccess(
|
||||||
() -> Component.literal("Talk area: §e" + talkArea + " blocks"),
|
() -> Component.translatable("command.tiedup.social.talkinfo_distance", talkArea).withStyle(ChatFormatting.YELLOW),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.tiedup.remake.commands.CommandHelper;
|
|||||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import com.tiedup.remake.state.PlayerBindState;
|
import com.tiedup.remake.state.PlayerBindState;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
@@ -111,7 +112,7 @@ public class AccessoryCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,9 +120,9 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.accessory.already_earplugs",
|
||||||
" already has earplugs"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -135,11 +136,10 @@ public class AccessoryCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.accessory.earplugs_on",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been given earplugs"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToTarget(
|
SystemMessageManager.sendToTarget(
|
||||||
@@ -159,7 +159,7 @@ public class AccessoryCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,9 +167,9 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.accessory.no_earplugs",
|
||||||
" does not have earplugs"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -182,11 +182,10 @@ public class AccessoryCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.accessory.earplugs_removed",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
"'s earplugs have been removed"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToPlayer(
|
SystemMessageManager.sendToPlayer(
|
||||||
@@ -206,7 +205,7 @@ public class AccessoryCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,9 +213,9 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.accessory.already_clothes",
|
||||||
" already has clothes"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -230,11 +229,10 @@ public class AccessoryCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.accessory.clothes_on",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been given clothes"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -249,7 +247,7 @@ public class AccessoryCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,9 +255,9 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.accessory.no_clothes",
|
||||||
" is not wearing clothes"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -276,10 +274,10 @@ public class AccessoryCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Removed clothes from " +
|
"command.tiedup.accessory.clothes_removed",
|
||||||
targetPlayer.getName().getString()
|
targetPlayer.getName().getString()
|
||||||
),
|
).withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -293,7 +291,7 @@ public class AccessoryCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,9 +336,9 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.accessory.already_restrained",
|
||||||
" is already fully restrained"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -353,13 +351,11 @@ public class AccessoryCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.accessory.fully_restrained",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString(),
|
||||||
" has been fully restrained (" +
|
finalApplied
|
||||||
finalApplied +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
" items applied)"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToPlayer(
|
SystemMessageManager.sendToPlayer(
|
||||||
@@ -381,7 +377,7 @@ public class AccessoryCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,9 +412,7 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.accessory.adjust_invalid_type")
|
||||||
"Invalid type. Use: gag, blindfold, or all"
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -427,11 +421,10 @@ public class AccessoryCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.accessory.nothing_to_adjust",
|
||||||
" has no " +
|
targetPlayer.getName().getString(),
|
||||||
type +
|
type
|
||||||
" to adjust"
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -451,15 +444,12 @@ public class AccessoryCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7aAdjusted " +
|
"command.tiedup.accessory.adjusted",
|
||||||
items +
|
items,
|
||||||
" for " +
|
targetPlayer.getName().getString(),
|
||||||
targetPlayer.getName().getString() +
|
valueStr
|
||||||
" to " +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
valueStr +
|
|
||||||
" pixels"
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import com.tiedup.remake.commands.CommandHelper;
|
import com.tiedup.remake.commands.CommandHelper;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import com.tiedup.remake.state.PlayerBindState;
|
import com.tiedup.remake.state.PlayerBindState;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
@@ -51,7 +52,7 @@ public class BindCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,9 +60,9 @@ public class BindCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.bind.already_tied",
|
||||||
" is already tied up"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -76,11 +77,10 @@ public class BindCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.bind.tied",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been tied up"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendTiedUp(
|
SystemMessageManager.sendTiedUp(
|
||||||
@@ -99,7 +99,7 @@ public class BindCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,9 +112,9 @@ public class BindCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.bind.not_restrained",
|
||||||
" is not restrained"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -149,11 +149,10 @@ public class BindCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.bind.freed",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been freed from all restraints"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendFreed(targetPlayer);
|
SystemMessageManager.sendFreed(targetPlayer);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import com.tiedup.remake.commands.CommandHelper;
|
import com.tiedup.remake.commands.CommandHelper;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import com.tiedup.remake.state.PlayerBindState;
|
import com.tiedup.remake.state.PlayerBindState;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
@@ -51,7 +52,7 @@ public class BlindfoldCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,9 +60,9 @@ public class BlindfoldCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.blindfold.already_blindfolded",
|
||||||
" is already blindfolded"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -76,11 +77,10 @@ public class BlindfoldCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.blindfold.blindfolded",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been blindfolded"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToTarget(
|
SystemMessageManager.sendToTarget(
|
||||||
@@ -100,7 +100,7 @@ public class BlindfoldCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,9 +108,9 @@ public class BlindfoldCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.blindfold.not_blindfolded",
|
||||||
" is not blindfolded"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -123,11 +123,10 @@ public class BlindfoldCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.blindfold.removed",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
"'s blindfold has been removed"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToTarget(
|
SystemMessageManager.sendToTarget(
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import com.tiedup.remake.commands.CommandHelper;
|
import com.tiedup.remake.commands.CommandHelper;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import com.tiedup.remake.state.PlayerBindState;
|
import com.tiedup.remake.state.PlayerBindState;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
@@ -76,7 +77,7 @@ public class CollarCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,9 +85,9 @@ public class CollarCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.collar.already_collared",
|
||||||
" already has a collar"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -106,11 +107,10 @@ public class CollarCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.collar.collared",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been collared"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToTarget(
|
SystemMessageManager.sendToTarget(
|
||||||
@@ -130,7 +130,7 @@ public class CollarCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,9 +138,9 @@ public class CollarCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.collar.no_collar",
|
||||||
" does not have a collar"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -153,11 +153,10 @@ public class CollarCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.collar.removed",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
"'s collar has been removed"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToTarget(
|
SystemMessageManager.sendToTarget(
|
||||||
@@ -177,7 +176,7 @@ public class CollarCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,11 +221,10 @@ public class CollarCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.collar.enslaved",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been enslaved"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendEnslaved(
|
SystemMessageManager.sendEnslaved(
|
||||||
@@ -245,7 +243,7 @@ public class CollarCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,8 +251,9 @@ public class CollarCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() + " is not captured"
|
"command.tiedup.collar.not_captured",
|
||||||
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -273,11 +272,10 @@ public class CollarCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.collar.freed",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been freed from slavery"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendFreed(targetPlayer);
|
SystemMessageManager.sendFreed(targetPlayer);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import com.tiedup.remake.commands.CommandHelper;
|
import com.tiedup.remake.commands.CommandHelper;
|
||||||
import com.tiedup.remake.prison.PrisonerManager;
|
import com.tiedup.remake.prison.PrisonerManager;
|
||||||
import com.tiedup.remake.prison.RansomRecord;
|
import com.tiedup.remake.prison.RansomRecord;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
@@ -77,9 +78,8 @@ public class DebtSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
target.getName().getString() +
|
"command.tiedup.debt.no_record", target.getName().getString()
|
||||||
" has no debt record."
|
|
||||||
),
|
),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@@ -94,16 +94,11 @@ public class DebtSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
target.getName().getString() +
|
"command.tiedup.debt.show",
|
||||||
" \u2014 Debt: " +
|
target.getName().getString(),
|
||||||
total +
|
total, paid, remaining
|
||||||
" | Paid: " +
|
).withStyle(ChatFormatting.YELLOW),
|
||||||
paid +
|
|
||||||
" | Remaining: " +
|
|
||||||
remaining +
|
|
||||||
" emeralds"
|
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -121,9 +116,7 @@ public class DebtSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.debt.no_record", target.getName().getString())
|
||||||
target.getName().getString() + " has no debt record."
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -133,13 +126,10 @@ public class DebtSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Set " +
|
"command.tiedup.debt.set",
|
||||||
target.getName().getString() +
|
target.getName().getString(), amount
|
||||||
"'s total debt to " +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
amount +
|
|
||||||
" emeralds."
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -157,9 +147,7 @@ public class DebtSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.debt.no_record", target.getName().getString())
|
||||||
target.getName().getString() + " has no debt record."
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -169,14 +157,10 @@ public class DebtSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Added " +
|
"command.tiedup.debt.added",
|
||||||
amount +
|
amount, target.getName().getString(), ransom.getRemainingDebt()
|
||||||
" emeralds to " +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
target.getName().getString() +
|
|
||||||
"'s debt. Remaining: " +
|
|
||||||
ransom.getRemainingDebt()
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -194,9 +178,7 @@ public class DebtSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable("command.tiedup.debt.no_record", target.getName().getString())
|
||||||
target.getName().getString() + " has no debt record."
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -207,15 +189,10 @@ public class DebtSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Removed " +
|
paid ? "command.tiedup.debt.removed_paid" : "command.tiedup.debt.removed",
|
||||||
amount +
|
amount, target.getName().getString(), ransom.getRemainingDebt()
|
||||||
" emeralds from " +
|
).withStyle(ChatFormatting.GREEN),
|
||||||
target.getName().getString() +
|
|
||||||
"'s debt. Remaining: " +
|
|
||||||
ransom.getRemainingDebt() +
|
|
||||||
(paid ? " (PAID OFF!)" : "")
|
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import com.tiedup.remake.commands.CommandHelper;
|
import com.tiedup.remake.commands.CommandHelper;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import com.tiedup.remake.state.PlayerBindState;
|
import com.tiedup.remake.state.PlayerBindState;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
@@ -51,7 +52,7 @@ public class GagCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,9 +60,9 @@ public class GagCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.gag.already_gagged",
|
||||||
" is already gagged"
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -76,11 +77,10 @@ public class GagCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.gag.gagged",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
" has been gagged"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendGagged(
|
SystemMessageManager.sendGagged(
|
||||||
@@ -99,7 +99,7 @@ public class GagCommands {
|
|||||||
if (state == null) {
|
if (state == null) {
|
||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(Component.literal("Failed to get player state"));
|
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +107,9 @@ public class GagCommands {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() + " is not gagged"
|
"command.tiedup.gag.not_gagged",
|
||||||
|
targetPlayer.getName().getString()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -121,11 +122,10 @@ public class GagCommands {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7a" +
|
"command.tiedup.gag.removed",
|
||||||
targetPlayer.getName().getString() +
|
targetPlayer.getName().getString()
|
||||||
"'s gag has been removed"
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToTarget(
|
SystemMessageManager.sendToTarget(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import com.tiedup.remake.cells.ConfiscatedInventoryRegistry;
|
import com.tiedup.remake.cells.ConfiscatedInventoryRegistry;
|
||||||
import com.tiedup.remake.commands.CommandHelper;
|
import com.tiedup.remake.commands.CommandHelper;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
@@ -56,9 +57,8 @@ public class InventorySubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
targetPlayer.getName().getString() +
|
"command.tiedup.inventory.no_confiscated", targetPlayer.getName().getString()
|
||||||
" has no confiscated inventory to restore"
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -71,10 +71,9 @@ public class InventorySubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"\u00a7aRestored confiscated inventory to " +
|
"command.tiedup.inventory.restored", targetPlayer.getName().getString()
|
||||||
targetPlayer.getName().getString()
|
).withStyle(ChatFormatting.GREEN),
|
||||||
),
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
SystemMessageManager.sendToPlayer(
|
SystemMessageManager.sendToPlayer(
|
||||||
@@ -88,9 +87,8 @@ public class InventorySubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Failed to restore inventory for " +
|
"command.tiedup.inventory.restore_failed", targetPlayer.getName().getString()
|
||||||
targetPlayer.getName().getString()
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class MasterTestSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("Failed to create Master entity")
|
Component.translatable("command.tiedup.master.spawn_failed")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -108,10 +108,8 @@ public class MasterTestSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Spawned Master '" +
|
"command.tiedup.master.spawned", finalName
|
||||||
finalName +
|
|
||||||
"' \u2014 you are now their pet."
|
|
||||||
),
|
),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -133,7 +131,7 @@ public class MasterTestSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No Master NPC found within 20 blocks")
|
Component.translatable("command.tiedup.master.no_master_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -157,8 +155,8 @@ public class MasterTestSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Forced " + finalName + " into HUMAN_CHAIR state"
|
"command.tiedup.master.forced_state", finalName, "HUMAN_CHAIR"
|
||||||
),
|
),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -183,7 +181,7 @@ public class MasterTestSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("Unknown MasterState: " + taskName)
|
Component.translatable("command.tiedup.master.unknown_state", taskName)
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -193,7 +191,7 @@ public class MasterTestSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendFailure(
|
.sendFailure(
|
||||||
Component.literal("No Master NPC found within 20 blocks")
|
Component.translatable("command.tiedup.master.no_master_nearby")
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -217,12 +215,8 @@ public class MasterTestSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Forced " +
|
"command.tiedup.master.forced_state", finalName, targetState.name()
|
||||||
finalName +
|
|
||||||
" into " +
|
|
||||||
targetState.name() +
|
|
||||||
" state"
|
|
||||||
),
|
),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ public class TestAnimSubCommand {
|
|||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() ->
|
() ->
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Playing animation '" + anim + "' on " + name
|
"command.tiedup.testanim.playing", anim, name
|
||||||
),
|
),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@@ -116,7 +116,7 @@ public class TestAnimSubCommand {
|
|||||||
context
|
context
|
||||||
.getSource()
|
.getSource()
|
||||||
.sendSuccess(
|
.sendSuccess(
|
||||||
() -> Component.literal("Stopped animation on " + name),
|
() -> Component.translatable("command.tiedup.testanim.stopped", name),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public class MCACompatEvents {
|
|||||||
IBondageState state = MCACompat.getKidnappedState(livingTarget);
|
IBondageState state = MCACompat.getKidnappedState(livingTarget);
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
// Priority: Untie > Ungag > Unblindfold > etc.
|
// 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
|
// No collar ownership check — any player can untie MCA villagers by design
|
||||||
// (MCA villagers use a separate relationship system, not TiedUp collars)
|
// (MCA villagers use a separate relationship system, not TiedUp collars)
|
||||||
|
|||||||
@@ -9,16 +9,32 @@ import net.minecraftforge.common.ForgeConfigSpec;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
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:
|
* <h2>Three-Tier Resolution</h2>
|
||||||
* 1. GameRules (if a world is loaded and rules are available) - these are per-world overrides
|
* <ul>
|
||||||
* 2. ModConfig (if config is loaded) - these are the user's intended defaults
|
* <li><b>Tier 1 — GameRules</b> (per-world, overridable via {@code /gamerule}): ~24 settings.
|
||||||
* 3. Hardcoded fallback - safe defaults if neither system is available yet
|
* 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)
|
* <h2>Rule</h2>
|
||||||
* can diverge from ModConfig defaults. Without this accessor, ModConfig spawn rate values
|
* <p><b>All game code should read settings through this class, never directly from
|
||||||
* were completely ignored (BUG-001).
|
* {@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 {
|
public class SettingsAccessor {
|
||||||
|
|
||||||
@@ -160,7 +176,7 @@ public class SettingsAccessor {
|
|||||||
* <p><b>BUG-003 fix:</b> Previously, {@code IHasResistance.getBaseResistance()}
|
* <p><b>BUG-003 fix:</b> Previously, {@code IHasResistance.getBaseResistance()}
|
||||||
* called {@code ModGameRules.getResistance()} which only knew 4 types (rope, gag,
|
* called {@code ModGameRules.getResistance()} which only knew 4 types (rope, gag,
|
||||||
* blindfold, collar) and returned hardcoded 100 for the other 10 types. Meanwhile
|
* 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).
|
* This caused a display-vs-struggle desync (display: 250, struggle: 100).
|
||||||
* Now both paths use this method.
|
* 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 ====================
|
// ==================== Helpers ====================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -138,120 +138,17 @@ public class SystemMessageManager {
|
|||||||
ERROR, // Generic error
|
ERROR, // Generic error
|
||||||
}
|
}
|
||||||
|
|
||||||
// MESSAGE TEMPLATES
|
// TRANSLATION KEYS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the raw message template for a category.
|
* Get the translation key for a category.
|
||||||
* Use this when you need to customize the message.
|
* Keys follow the pattern: msg.tiedup.system.<category_lowercase>
|
||||||
*
|
*
|
||||||
* @param category The message category
|
* @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) {
|
public static String getTranslationKey(MessageCategory category) {
|
||||||
return getMessageTemplate(category);
|
return "msg.tiedup.system." + category.name().toLowerCase();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -373,11 +270,11 @@ public class SystemMessageManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a system message to a player's action bar.
|
* 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 player The player to send to
|
||||||
* @param category The message category
|
* @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(
|
public static void sendToPlayer(
|
||||||
Player player,
|
Player player,
|
||||||
@@ -387,14 +284,23 @@ public class SystemMessageManager {
|
|||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
|
||||||
String actorName = actor != null ? getEntityName(actor) : "Someone";
|
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.
|
* 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 player The player to send to
|
||||||
* @param category The message category
|
* @param category The message category
|
||||||
@@ -402,12 +308,22 @@ public class SystemMessageManager {
|
|||||||
public static void sendToPlayer(Player player, MessageCategory category) {
|
public static void sendToPlayer(Player player, MessageCategory category) {
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
|
||||||
String message = getMessageTemplate(category);
|
MutableComponent component = Component.translatable(
|
||||||
sendToPlayer(player, message, getCategoryColor(category));
|
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.
|
* 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 player The player to send to
|
||||||
* @param message The message to send
|
* @param message The message to send
|
||||||
@@ -420,12 +336,10 @@ public class SystemMessageManager {
|
|||||||
) {
|
) {
|
||||||
if (player == null || message == null) return;
|
if (player == null || message == null) return;
|
||||||
|
|
||||||
// Works on both client and server
|
|
||||||
MutableComponent component = Component.literal(message).withStyle(
|
MutableComponent component = Component.literal(message).withStyle(
|
||||||
style -> style.withColor(color)
|
style -> style.withColor(color)
|
||||||
);
|
);
|
||||||
|
|
||||||
// true = action bar (above hotbar), false = chat
|
|
||||||
player.displayClientMessage(component, true);
|
player.displayClientMessage(component, true);
|
||||||
|
|
||||||
TiedUpMod.LOGGER.debug(
|
TiedUpMod.LOGGER.debug(
|
||||||
@@ -437,6 +351,7 @@ public class SystemMessageManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a custom system message to a player's CHAT.
|
* 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 player The player to send to
|
||||||
* @param message The message to send
|
* @param message The message to send
|
||||||
@@ -453,7 +368,6 @@ public class SystemMessageManager {
|
|||||||
style -> style.withColor(color)
|
style -> style.withColor(color)
|
||||||
);
|
);
|
||||||
|
|
||||||
// false = chat
|
|
||||||
player.displayClientMessage(component, false);
|
player.displayClientMessage(component, false);
|
||||||
|
|
||||||
TiedUpMod.LOGGER.debug(
|
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(
|
public static void sendChatToPlayer(
|
||||||
Player player,
|
Player player,
|
||||||
MessageCategory category
|
MessageCategory category
|
||||||
) {
|
) {
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
String message = getMessageTemplate(category);
|
MutableComponent component = Component.translatable(
|
||||||
sendChatToPlayer(player, message, getCategoryColor(category));
|
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(
|
public static void sendChatToPlayer(
|
||||||
Player player,
|
Player player,
|
||||||
@@ -485,8 +401,10 @@ public class SystemMessageManager {
|
|||||||
) {
|
) {
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
String actorName = actor != null ? getEntityName(actor) : "Someone";
|
String actorName = actor != null ? getEntityName(actor) : "Someone";
|
||||||
String message = String.format(getMessageTemplate(category), actorName);
|
MutableComponent component = Component.translatable(
|
||||||
sendChatToPlayer(player, message, getCategoryColor(category));
|
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 player The player to send to
|
||||||
* @param category The category (for color)
|
* @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(
|
public static void sendToPlayer(
|
||||||
Player player,
|
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 player The player to send to
|
||||||
* @param category The message category
|
* @param category The message category
|
||||||
@@ -518,9 +456,13 @@ public class SystemMessageManager {
|
|||||||
) {
|
) {
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
|
||||||
String message =
|
MutableComponent component = Component.translatable(
|
||||||
getMessageTemplate(category) + " (Resistance: " + resistance + ")";
|
getTranslationKey(category)
|
||||||
sendToPlayer(player, message, getCategoryColor(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
|
// SEND METHODS - TO NEARBY PLAYERS
|
||||||
@@ -695,15 +637,10 @@ public class SystemMessageManager {
|
|||||||
*/
|
*/
|
||||||
public static void sendJobAssigned(Player player, String itemName) {
|
public static void sendJobAssigned(Player player, String itemName) {
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
String message = String.format(
|
MutableComponent component = Component.translatable(
|
||||||
getMessageTemplate(MessageCategory.SLAVE_JOB_ASSIGNED),
|
getTranslationKey(MessageCategory.SLAVE_JOB_ASSIGNED), itemName
|
||||||
itemName
|
).withStyle(style -> style.withColor(getCategoryColor(MessageCategory.SLAVE_JOB_ASSIGNED)));
|
||||||
);
|
player.displayClientMessage(component, true);
|
||||||
sendToPlayer(
|
|
||||||
player,
|
|
||||||
message,
|
|
||||||
getCategoryColor(MessageCategory.SLAVE_JOB_ASSIGNED)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// UTILITY
|
// UTILITY
|
||||||
|
|||||||
@@ -581,6 +581,14 @@ public class TiedUpMod {
|
|||||||
LOGGER.info(
|
LOGGER.info(
|
||||||
"Registered FurnitureServerReloadListener for data-driven furniture definitions"
|
"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"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class PetRequestManager {
|
|||||||
double dist = master.distanceTo(pet);
|
double dist = master.distanceTo(pet);
|
||||||
if (dist > MAX_DISTANCE) {
|
if (dist > MAX_DISTANCE) {
|
||||||
pet.sendSystemMessage(
|
pet.sendSystemMessage(
|
||||||
Component.literal("You are too far from your Master to talk.")
|
Component.translatable("entity.tiedup.pet.too_far_to_talk")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ public class PetRequestManager {
|
|||||||
double dist = master.distanceTo(pet);
|
double dist = master.distanceTo(pet);
|
||||||
if (dist > MAX_DISTANCE) {
|
if (dist > MAX_DISTANCE) {
|
||||||
pet.sendSystemMessage(
|
pet.sendSystemMessage(
|
||||||
Component.literal("You are too far from your Master.")
|
Component.translatable("entity.tiedup.pet.too_far_from_master")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ public class PetRequestManager {
|
|||||||
|
|
||||||
// Display what the player "says"
|
// Display what the player "says"
|
||||||
pet.sendSystemMessage(
|
pet.sendSystemMessage(
|
||||||
Component.literal("You: " + request.getPlayerText())
|
Component.translatable("entity.tiedup.pet.you_say", request.getPlayerText())
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handle specific request
|
// Handle specific request
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -179,7 +179,7 @@ public class DamselRewardTracker {
|
|||||||
// Thank the savior via dialogue
|
// Thank the savior via dialogue
|
||||||
damsel.talkToPlayersInRadius(
|
damsel.talkToPlayersInRadius(
|
||||||
EntityDialogueManager.DialogueCategory.DAMSEL_FREED,
|
EntityDialogueManager.DialogueCategory.DAMSEL_FREED,
|
||||||
ModConfig.SERVER.dialogueRadius.get()
|
SettingsAccessor.getDialogueRadius()
|
||||||
);
|
);
|
||||||
|
|
||||||
TiedUpMod.LOGGER.info(
|
TiedUpMod.LOGGER.info(
|
||||||
|
|||||||
@@ -644,8 +644,8 @@ public class EntityDamsel
|
|||||||
player instanceof net.minecraft.server.level.ServerPlayer sp
|
player instanceof net.minecraft.server.level.ServerPlayer sp
|
||||||
) {
|
) {
|
||||||
sp.displayClientMessage(
|
sp.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"This NPC needs a collar before you can feed them."
|
"entity.tiedup.damsel.needs_collar_to_feed"
|
||||||
).withStyle(ChatFormatting.RED),
|
).withStyle(ChatFormatting.RED),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -660,8 +660,8 @@ public class EntityDamsel
|
|||||||
net.minecraft.server.level.ServerPlayer sp
|
net.minecraft.server.level.ServerPlayer sp
|
||||||
) {
|
) {
|
||||||
sp.displayClientMessage(
|
sp.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You don't own this NPC's collar."
|
"entity.tiedup.damsel.not_collar_owner"
|
||||||
).withStyle(ChatFormatting.RED),
|
).withStyle(ChatFormatting.RED),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -675,8 +675,8 @@ public class EntityDamsel
|
|||||||
player instanceof net.minecraft.server.level.ServerPlayer sp
|
player instanceof net.minecraft.server.level.ServerPlayer sp
|
||||||
) {
|
) {
|
||||||
sp.displayClientMessage(
|
sp.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"This NPC can't eat that right now."
|
"entity.tiedup.damsel.cant_eat_now"
|
||||||
).withStyle(ChatFormatting.RED),
|
).withStyle(ChatFormatting.RED),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.tiedup.remake.entities;
|
package com.tiedup.remake.entities;
|
||||||
|
|
||||||
import com.tiedup.remake.blocks.entity.KidnapBombBlockEntity;
|
import com.tiedup.remake.blocks.entity.KidnapBombBlockEntity;
|
||||||
import com.tiedup.remake.core.ModConfig;
|
|
||||||
import com.tiedup.remake.core.SettingsAccessor;
|
import com.tiedup.remake.core.SettingsAccessor;
|
||||||
import com.tiedup.remake.util.KidnapExplosion;
|
import com.tiedup.remake.util.KidnapExplosion;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@@ -56,7 +55,7 @@ public class EntityKidnapBomb extends PrimedTnt {
|
|||||||
this.setPos(x, y, z);
|
this.setPos(x, y, z);
|
||||||
double d0 = level.random.nextDouble() * (Math.PI * 2);
|
double d0 = level.random.nextDouble() * (Math.PI * 2);
|
||||||
this.setDeltaMovement(-Math.sin(d0) * 0.02, 0.2, -Math.cos(d0) * 0.02);
|
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.xo = x;
|
||||||
this.yo = y;
|
this.yo = y;
|
||||||
|
|||||||
@@ -335,9 +335,9 @@ public class EntityKidnapperArcher
|
|||||||
public int getBindChanceForTarget(UUID targetUUID) {
|
public int getBindChanceForTarget(UUID targetUUID) {
|
||||||
int hitCount = targetHitCounts.getOrDefault(targetUUID, 0);
|
int hitCount = targetHitCounts.getOrDefault(targetUUID, 0);
|
||||||
int baseChance =
|
int baseChance =
|
||||||
com.tiedup.remake.core.ModConfig.SERVER.archerArrowBindChanceBase.get();
|
SettingsAccessor.getArcherArrowBindChanceBase();
|
||||||
int perHitChance =
|
int perHitChance =
|
||||||
com.tiedup.remake.core.ModConfig.SERVER.archerArrowBindChancePerHit.get();
|
SettingsAccessor.getArcherArrowBindChancePerHit();
|
||||||
|
|
||||||
int chance = baseChance + (hitCount * perHitChance);
|
int chance = baseChance + (hitCount * perHitChance);
|
||||||
return Math.min(chance, ARCHER_MAX_BIND_CHANCE);
|
return Math.min(chance, ARCHER_MAX_BIND_CHANCE);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.tiedup.remake.entities;
|
|||||||
|
|
||||||
import static com.tiedup.remake.util.GameConstants.*;
|
import static com.tiedup.remake.util.GameConstants.*;
|
||||||
|
|
||||||
import com.tiedup.remake.core.ModConfig;
|
|
||||||
import com.tiedup.remake.core.SettingsAccessor;
|
import com.tiedup.remake.core.SettingsAccessor;
|
||||||
import com.tiedup.remake.core.TiedUpMod;
|
import com.tiedup.remake.core.TiedUpMod;
|
||||||
import com.tiedup.remake.dialogue.SpeakerType;
|
import com.tiedup.remake.dialogue.SpeakerType;
|
||||||
@@ -356,7 +355,7 @@ public class EntityKidnapperMerchant extends EntityKidnapperElite {
|
|||||||
private void transitionToHostile(LivingEntity attacker) {
|
private void transitionToHostile(LivingEntity attacker) {
|
||||||
currentState = MerchantState.HOSTILE;
|
currentState = MerchantState.HOSTILE;
|
||||||
attackerUUID = attacker.getUUID();
|
attackerUUID = attacker.getUUID();
|
||||||
hostileCooldownTicks = ModConfig.SERVER.merchantHostileDuration.get();
|
hostileCooldownTicks = SettingsAccessor.getMerchantHostileDuration();
|
||||||
entityData.set(DATA_MERCHANT_STATE, MerchantState.HOSTILE.getId());
|
entityData.set(DATA_MERCHANT_STATE, MerchantState.HOSTILE.getId());
|
||||||
|
|
||||||
// Equip kidnapper items
|
// Equip kidnapper items
|
||||||
@@ -536,8 +535,8 @@ public class EntityKidnapperMerchant extends EntityKidnapperElite {
|
|||||||
addGuaranteedUtilities();
|
addGuaranteedUtilities();
|
||||||
|
|
||||||
// RANDOM TRADES
|
// RANDOM TRADES
|
||||||
int min = ModConfig.SERVER.merchantMinTrades.get();
|
int min = SettingsAccessor.getMerchantMinTrades();
|
||||||
int max = ModConfig.SERVER.merchantMaxTrades.get();
|
int max = SettingsAccessor.getMerchantMaxTrades();
|
||||||
int count = min + this.random.nextInt(Math.max(1, max - min + 1));
|
int count = min + this.random.nextInt(Math.max(1, max - min + 1));
|
||||||
|
|
||||||
// Collect all mod items
|
// Collect all mod items
|
||||||
@@ -644,21 +643,21 @@ public class EntityKidnapperMerchant extends EntityKidnapperElite {
|
|||||||
int minPrice, maxPrice;
|
int minPrice, maxPrice;
|
||||||
switch (tier) {
|
switch (tier) {
|
||||||
case 4:
|
case 4:
|
||||||
minPrice = ModConfig.SERVER.tier4PriceMin.get();
|
minPrice = SettingsAccessor.getTier4PriceMin();
|
||||||
maxPrice = ModConfig.SERVER.tier4PriceMax.get();
|
maxPrice = SettingsAccessor.getTier4PriceMax();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
minPrice = ModConfig.SERVER.tier3PriceMin.get();
|
minPrice = SettingsAccessor.getTier3PriceMin();
|
||||||
maxPrice = ModConfig.SERVER.tier3PriceMax.get();
|
maxPrice = SettingsAccessor.getTier3PriceMax();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
minPrice = ModConfig.SERVER.tier2PriceMin.get();
|
minPrice = SettingsAccessor.getTier2PriceMin();
|
||||||
maxPrice = ModConfig.SERVER.tier2PriceMax.get();
|
maxPrice = SettingsAccessor.getTier2PriceMax();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
default:
|
||||||
minPrice = ModConfig.SERVER.tier1PriceMin.get();
|
minPrice = SettingsAccessor.getTier1PriceMin();
|
||||||
maxPrice = ModConfig.SERVER.tier1PriceMax.get();
|
maxPrice = SettingsAccessor.getTier1PriceMax();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ public class EntityLaborGuard extends EntityDamsel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal("Attacking your guard is punished!").withStyle(
|
Component.translatable("entity.tiedup.guard.attack_punished").withStyle(
|
||||||
ChatFormatting.DARK_RED
|
ChatFormatting.DARK_RED
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -529,8 +529,8 @@ public class EntityLaborGuard extends EntityDamsel {
|
|||||||
.getPlayer(prisonerUUID);
|
.getPlayer(prisonerUUID);
|
||||||
if (prisoner != null) {
|
if (prisoner != null) {
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Your guard has been eliminated! You are free!"
|
"entity.tiedup.guard.eliminated_free"
|
||||||
).withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD)
|
).withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -447,8 +447,8 @@ public class EntityMaid extends EntityKidnapperElite {
|
|||||||
player.position().distanceTo(this.position()) <= 50
|
player.position().distanceTo(this.position()) <= 50
|
||||||
) {
|
) {
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"The maid has died. Work is paused. A replacement will arrive in 5 minutes."
|
"entity.tiedup.maid.died_work_paused"
|
||||||
).withStyle(net.minecraft.ChatFormatting.GOLD)
|
).withStyle(net.minecraft.ChatFormatting.GOLD)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -606,8 +606,8 @@ public class EntityMaster extends EntityKidnapperElite {
|
|||||||
|
|
||||||
// Send warning message to pet
|
// Send warning message to pet
|
||||||
pet.sendSystemMessage(
|
pet.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
this.getNpcName() + " caught you trying to escape!"
|
"entity.tiedup.master.caught_escaping", this.getNpcName()
|
||||||
).withStyle(Style.EMPTY.withColor(MASTER_NAME_COLOR))
|
).withStyle(Style.EMPTY.withColor(MASTER_NAME_COLOR))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.items.ModItems;
|
import com.tiedup.remake.items.ModItems;
|
||||||
import com.tiedup.remake.state.IBondageState;
|
import com.tiedup.remake.state.IBondageState;
|
||||||
@@ -87,7 +87,7 @@ public class EntityRopeArrow extends AbstractArrow {
|
|||||||
bindChance = archer.getBindChanceForTarget(target.getUUID());
|
bindChance = archer.getBindChanceForTarget(target.getUUID());
|
||||||
} else {
|
} else {
|
||||||
// Other shooters: default 50% chance
|
// Other shooters: default 50% chance
|
||||||
bindChance = ModConfig.SERVER.ropeArrowBindChance.get();
|
bindChance = SettingsAccessor.getRopeArrowBindChance();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Roll for bind chance
|
// Roll for bind chance
|
||||||
|
|||||||
@@ -200,8 +200,8 @@ public class EntitySlaveTrader extends EntityKidnapperElite {
|
|||||||
Component.literal("[" + this.getNpcName() + "] ")
|
Component.literal("[" + this.getNpcName() + "] ")
|
||||||
.withStyle(Style.EMPTY.withColor(TRADER_NAME_COLOR))
|
.withStyle(Style.EMPTY.withColor(TRADER_NAME_COLOR))
|
||||||
.append(
|
.append(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You don't have a trader token. Leave now, or I'll make you leave."
|
"entity.tiedup.trader.no_token_warning"
|
||||||
).withStyle(ChatFormatting.RED)
|
).withStyle(ChatFormatting.RED)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -711,8 +711,8 @@ public class EntitySlaveTrader extends EntityKidnapperElite {
|
|||||||
ServerLevel level,
|
ServerLevel level,
|
||||||
BlockPos campCenter
|
BlockPos campCenter
|
||||||
) {
|
) {
|
||||||
Component message = Component.literal(
|
Component message = Component.translatable(
|
||||||
"A slave trader camp has been destroyed!"
|
"entity.tiedup.trader.camp_destroyed"
|
||||||
).withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD);
|
).withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD);
|
||||||
|
|
||||||
// Send to all players within 200 blocks
|
// Send to all players within 200 blocks
|
||||||
|
|||||||
@@ -93,15 +93,15 @@ public class MerchantTrade {
|
|||||||
*/
|
*/
|
||||||
public Component getPriceDisplay() {
|
public Component getPriceDisplay() {
|
||||||
if (ingotPrice > 0 && nuggetPrice > 0) {
|
if (ingotPrice > 0 && nuggetPrice > 0) {
|
||||||
return Component.literal(
|
return Component.translatable(
|
||||||
ingotPrice + " gold + " + nuggetPrice + " nuggets"
|
"entity.tiedup.trade.price_both", ingotPrice, nuggetPrice
|
||||||
);
|
);
|
||||||
} else if (ingotPrice > 0) {
|
} else if (ingotPrice > 0) {
|
||||||
return Component.literal(ingotPrice + " gold");
|
return Component.translatable("entity.tiedup.trade.price_gold", ingotPrice);
|
||||||
} else if (nuggetPrice > 0) {
|
} else if (nuggetPrice > 0) {
|
||||||
return Component.literal(nuggetPrice + " nuggets");
|
return Component.translatable("entity.tiedup.trade.price_nuggets", nuggetPrice);
|
||||||
} else {
|
} else {
|
||||||
return Component.literal("Free");
|
return Component.translatable("entity.tiedup.trade.price_free");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -202,8 +202,8 @@ public class GuardMonitorGoal extends Goal {
|
|||||||
);
|
);
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You are too far from your guard! Return within 15 seconds or escape will be triggered!"
|
"goal.tiedup.guard_monitor.too_far"
|
||||||
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -227,8 +227,8 @@ public class GuardMonitorGoal extends Goal {
|
|||||||
);
|
);
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You returned to your guard. Stay close!"
|
"goal.tiedup.guard_monitor.returned"
|
||||||
).withStyle(ChatFormatting.YELLOW)
|
).withStyle(ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -604,8 +604,8 @@ public class KidnapperDecideNextActionGoal extends Goal {
|
|||||||
);
|
);
|
||||||
|
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You're still tied up - struggle to break free!"
|
"goal.tiedup.kidnapper_decide.still_tied"
|
||||||
).withStyle(ChatFormatting.YELLOW)
|
).withStyle(ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities.ai.kidnapper;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
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
|
// Check if Master should spawn immediately for solo player
|
||||||
IRestrainable captive = this.kidnapper.getCaptive();
|
IRestrainable captive = this.kidnapper.getCaptive();
|
||||||
boolean isMasterEnabled = ModConfig.SERVER.enableMasterSpawn.get();
|
boolean isMasterEnabled = SettingsAccessor.isEnableMasterSpawn();
|
||||||
boolean isPlayer =
|
boolean isPlayer =
|
||||||
captive != null && captive.asLivingEntity() instanceof Player;
|
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
|
// Don't return - let the goal continue so kidnapper waits for Master
|
||||||
// The wait duration is set to allow Master to arrive
|
// The wait duration is set to allow Master to arrive
|
||||||
this.waitDuration = 6000; // 5 minutes max wait for 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
|
// Solo mode (non-player captive): use config timeout
|
||||||
this.waitDuration = ModConfig.SERVER.soloTimeoutSeconds.get() * 20;
|
this.waitDuration = SettingsAccessor.getSoloTimeoutSeconds() * 20;
|
||||||
TiedUpMod.LOGGER.debug(
|
TiedUpMod.LOGGER.debug(
|
||||||
"[KidnapperWaitForBuyerGoal] Solo mode detected, using {}s timeout",
|
"[KidnapperWaitForBuyerGoal] Solo mode detected, using {}s timeout",
|
||||||
ModConfig.SERVER.soloTimeoutSeconds.get()
|
SettingsAccessor.getSoloTimeoutSeconds()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Normal mode: random 5-8 minutes
|
// Normal mode: random 5-8 minutes
|
||||||
@@ -351,14 +351,14 @@ public class KidnapperWaitForBuyerGoal extends Goal {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Component announcement = Component.literal("")
|
Component announcement = Component.literal("")
|
||||||
.append(Component.literal("[SALE] ").withStyle(ChatFormatting.GOLD))
|
.append(Component.translatable("goal.tiedup.kidnapper_sale.tag").withStyle(ChatFormatting.GOLD))
|
||||||
.append(
|
.append(
|
||||||
Component.literal(this.kidnapper.getNpcName()).withStyle(
|
Component.literal(this.kidnapper.getNpcName()).withStyle(
|
||||||
ChatFormatting.RED
|
ChatFormatting.RED
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
Component.literal(" is selling ").withStyle(
|
Component.translatable("goal.tiedup.kidnapper_sale.is_selling").withStyle(
|
||||||
ChatFormatting.YELLOW
|
ChatFormatting.YELLOW
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -367,13 +367,13 @@ public class KidnapperWaitForBuyerGoal extends Goal {
|
|||||||
ChatFormatting.AQUA
|
ChatFormatting.AQUA
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(Component.literal(" for ").withStyle(ChatFormatting.YELLOW))
|
.append(Component.translatable("goal.tiedup.kidnapper_sale.for").withStyle(ChatFormatting.YELLOW))
|
||||||
.append(
|
.append(
|
||||||
Component.literal(price.toDisplayString()).withStyle(
|
Component.literal(price.toDisplayString()).withStyle(
|
||||||
ChatFormatting.GREEN
|
ChatFormatting.GREEN
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(Component.literal(" at ").withStyle(ChatFormatting.YELLOW))
|
.append(Component.translatable("goal.tiedup.kidnapper_sale.at").withStyle(ChatFormatting.YELLOW))
|
||||||
.append(
|
.append(
|
||||||
Component.literal(location).withStyle(ChatFormatting.WHITE)
|
Component.literal(location).withStyle(ChatFormatting.WHITE)
|
||||||
);
|
);
|
||||||
@@ -426,7 +426,7 @@ public class KidnapperWaitForBuyerGoal extends Goal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle solo mode fallback
|
// Handle solo mode fallback
|
||||||
if (this.soloMode && ModConfig.SERVER.enableSoloFallback.get()) {
|
if (this.soloMode && SettingsAccessor.isEnableSoloFallback()) {
|
||||||
handleSoloModeFallback(captive);
|
handleSoloModeFallback(captive);
|
||||||
} else {
|
} else {
|
||||||
// Normal multiplayer mode: just flee
|
// 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
|
// 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;
|
boolean isPlayer = captive.asLivingEntity() instanceof Player;
|
||||||
|
|
||||||
if (isMasterEnabled && isPlayer) {
|
if (isMasterEnabled && isPlayer) {
|
||||||
@@ -460,7 +460,7 @@ public class KidnapperWaitForBuyerGoal extends Goal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to original behavior
|
// Fallback to original behavior
|
||||||
double keepChance = ModConfig.SERVER.soloKeepChance.get();
|
double keepChance = SettingsAccessor.getSoloKeepChance();
|
||||||
double roll = this.kidnapper.getRandom().nextDouble();
|
double roll = this.kidnapper.getRandom().nextDouble();
|
||||||
|
|
||||||
TiedUpMod.LOGGER.debug(
|
TiedUpMod.LOGGER.debug(
|
||||||
|
|||||||
@@ -331,9 +331,9 @@ public class MaidDeliverCaptiveGoal extends Goal {
|
|||||||
buyerEntity.getName().getString()
|
buyerEntity.getName().getString()
|
||||||
);
|
);
|
||||||
buyerEntity.sendSystemMessage(
|
buyerEntity.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
captiveEntity.getName().getString() +
|
"goal.tiedup.maid_deliver.on_leash",
|
||||||
" is now on your leash."
|
captiveEntity.getName().getString()
|
||||||
).withStyle(net.minecraft.ChatFormatting.GREEN)
|
).withStyle(net.minecraft.ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -342,9 +342,9 @@ public class MaidDeliverCaptiveGoal extends Goal {
|
|||||||
);
|
);
|
||||||
kidnappedState.free(true);
|
kidnappedState.free(true);
|
||||||
buyerEntity.sendSystemMessage(
|
buyerEntity.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
captiveEntity.getName().getString() +
|
"goal.tiedup.maid_deliver.delivered",
|
||||||
" has been delivered to you."
|
captiveEntity.getName().getString()
|
||||||
).withStyle(net.minecraft.ChatFormatting.GREEN)
|
).withStyle(net.minecraft.ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.tiedup.remake.entities.ai.maid.goals;
|
|||||||
|
|
||||||
import com.tiedup.remake.cells.CellDataV2;
|
import com.tiedup.remake.cells.CellDataV2;
|
||||||
import com.tiedup.remake.cells.CellRegistryV2;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.entities.EntityMaid;
|
import com.tiedup.remake.entities.EntityMaid;
|
||||||
import com.tiedup.remake.labor.LaborTask;
|
import com.tiedup.remake.labor.LaborTask;
|
||||||
@@ -87,7 +87,7 @@ public class MaidAssignTaskGoal extends Goal {
|
|||||||
|
|
||||||
if (phase == LaborRecord.WorkPhase.RESTING) {
|
if (phase == LaborRecord.WorkPhase.RESTING) {
|
||||||
// Check if rest is complete (config: laborRestSeconds, default 120s)
|
// 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);
|
long elapsed = labor.getTimeInPhase(currentTime);
|
||||||
if (elapsed >= restTicks) {
|
if (elapsed >= restTicks) {
|
||||||
labor.finishRest(currentTime);
|
labor.finishRest(currentTime);
|
||||||
@@ -200,13 +200,13 @@ public class MaidAssignTaskGoal extends Goal {
|
|||||||
|
|
||||||
// Notify prisoner
|
// Notify prisoner
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Task assigned: " + task.getDescription()
|
"goal.tiedup.maid_assign.task_assigned", task.getDescription()
|
||||||
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Reward: " + task.getValue() + " emeralds toward your debt."
|
"goal.tiedup.maid_assign.task_reward", task.getValue()
|
||||||
).withStyle(net.minecraft.ChatFormatting.GRAY)
|
).withStyle(net.minecraft.ChatFormatting.GRAY)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -289,8 +289,8 @@ public class MaidAssignTaskGoal extends Goal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Your debt is paid. You are FREE!"
|
"goal.tiedup.maid.debt_paid_free"
|
||||||
).withStyle(
|
).withStyle(
|
||||||
net.minecraft.ChatFormatting.GREEN,
|
net.minecraft.ChatFormatting.GREEN,
|
||||||
net.minecraft.ChatFormatting.BOLD
|
net.minecraft.ChatFormatting.BOLD
|
||||||
|
|||||||
@@ -346,9 +346,9 @@ public class MaidExtractGoal extends Goal {
|
|||||||
|
|
||||||
// 7. Notify prisoner
|
// 7. Notify prisoner
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"You have been extracted for labor. Complete your task: " +
|
"goal.tiedup.maid_extract.extracted",
|
||||||
task.getDescription()
|
task.getDescription()
|
||||||
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ public class MaidIdleGoal extends Goal {
|
|||||||
labor.completeTask(currentTime);
|
labor.completeTask(currentTime);
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Task complete! Walk back to camp."
|
"goal.tiedup.maid_idle.task_complete"
|
||||||
).withStyle(net.minecraft.ChatFormatting.GREEN)
|
).withStyle(net.minecraft.ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -207,17 +207,16 @@ public class MaidIdleGoal extends Goal {
|
|||||||
// Max punishment - fail task
|
// Max punishment - fail task
|
||||||
labor.failTask(currentTime);
|
labor.failTask(currentTime);
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Task failed due to inactivity! You will be returned to your cell."
|
"goal.tiedup.maid_idle.task_failed"
|
||||||
).withStyle(net.minecraft.ChatFormatting.RED)
|
).withStyle(net.minecraft.ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Warning
|
// Warning
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Warning: Work or face punishment! (" +
|
"goal.tiedup.maid_idle.inactivity_warning",
|
||||||
shockLevel +
|
shockLevel
|
||||||
"/3)"
|
|
||||||
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -165,18 +165,16 @@ public class MaidInitPrisonerGoal extends Goal {
|
|||||||
|
|
||||||
// 6. Notify prisoner
|
// 6. Notify prisoner
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
String.format(
|
"goal.tiedup.maid_init.imprisoned",
|
||||||
"You have been imprisoned. Your debt: %d emeralds.",
|
totalRansom
|
||||||
totalRansom
|
|
||||||
)
|
|
||||||
).withStyle(net.minecraft.ChatFormatting.RED)
|
).withStyle(net.minecraft.ChatFormatting.RED)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!confiscated.isEmpty()) {
|
if (!confiscated.isEmpty()) {
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Your valuables have been confiscated."
|
"goal.tiedup.maid_init.confiscated"
|
||||||
).withStyle(net.minecraft.ChatFormatting.GRAY)
|
).withStyle(net.minecraft.ChatFormatting.GRAY)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -671,8 +671,8 @@ public class MaidReturnGoal extends Goal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"Your debt is paid. You are FREE!"
|
"goal.tiedup.maid.debt_paid_free"
|
||||||
).withStyle(
|
).withStyle(
|
||||||
net.minecraft.ChatFormatting.GREEN,
|
net.minecraft.ChatFormatting.GREEN,
|
||||||
net.minecraft.ChatFormatting.BOLD
|
net.minecraft.ChatFormatting.BOLD
|
||||||
|
|||||||
@@ -124,11 +124,10 @@ public class MasterInventoryInspectGoal extends Goal {
|
|||||||
ServerPlayer pet = master.getPetPlayer();
|
ServerPlayer pet = master.getPetPlayer();
|
||||||
if (pet != null && !confiscatedItems.isEmpty()) {
|
if (pet != null && !confiscatedItems.isEmpty()) {
|
||||||
pet.sendSystemMessage(
|
pet.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
master.getNpcName() +
|
"goal.tiedup.master_inspect.confiscated",
|
||||||
" confiscated " +
|
master.getNpcName(),
|
||||||
confiscatedItems.size() +
|
confiscatedItems.size()
|
||||||
" contraband item(s) from you!"
|
|
||||||
).withStyle(
|
).withStyle(
|
||||||
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
|
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
|
||||||
)
|
)
|
||||||
@@ -180,8 +179,8 @@ public class MasterInventoryInspectGoal extends Goal {
|
|||||||
*/
|
*/
|
||||||
private void performInspection(ServerPlayer pet) {
|
private void performInspection(ServerPlayer pet) {
|
||||||
pet.sendSystemMessage(
|
pet.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
master.getNpcName() + " is inspecting your inventory..."
|
"goal.tiedup.master_inspect.inspecting", master.getNpcName()
|
||||||
).withStyle(Style.EMPTY.withColor(0xFFFF00))
|
).withStyle(Style.EMPTY.withColor(0xFFFF00))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -331,8 +331,8 @@ public class MasterTaskAssignGoal extends Goal {
|
|||||||
// FIX: Use MessageDispatcher for consistency with earplug system
|
// FIX: Use MessageDispatcher for consistency with earplug system
|
||||||
MessageDispatcher.sendChat(
|
MessageDispatcher.sendChat(
|
||||||
pet,
|
pet,
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
master.getNpcName() + ": \"" + message + "\""
|
"goal.tiedup.master_assign.task_speech", master.getNpcName(), message
|
||||||
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
|
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -269,8 +269,8 @@ public class MasterTaskWatchGoal extends Goal {
|
|||||||
if (remainingSec > 0) {
|
if (remainingSec > 0) {
|
||||||
MessageDispatcher.sendActionBar(
|
MessageDispatcher.sendActionBar(
|
||||||
pet,
|
pet,
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
task.name() + " - " + remainingSec + "s remaining"
|
"goal.tiedup.master_watch.time_remaining", task.name(), remainingSec
|
||||||
).withStyle(Style.EMPTY.withColor(0xFFAA00))
|
).withStyle(Style.EMPTY.withColor(0xFFAA00))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -357,8 +357,8 @@ public class MasterTaskWatchGoal extends Goal {
|
|||||||
) {
|
) {
|
||||||
MessageDispatcher.sendChat(
|
MessageDispatcher.sendChat(
|
||||||
pet,
|
pet,
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
master.getNpcName() + ": \"I'm waiting...\""
|
"goal.tiedup.master_watch.speak_waiting", master.getNpcName()
|
||||||
).withStyle(
|
).withStyle(
|
||||||
Style.EMPTY.withColor(
|
Style.EMPTY.withColor(
|
||||||
EntityMaster.MASTER_NAME_COLOR
|
EntityMaster.MASTER_NAME_COLOR
|
||||||
@@ -384,8 +384,8 @@ public class MasterTaskWatchGoal extends Goal {
|
|||||||
.nextInt(demandWarnings.length)];
|
.nextInt(demandWarnings.length)];
|
||||||
MessageDispatcher.sendChat(
|
MessageDispatcher.sendChat(
|
||||||
pet,
|
pet,
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
master.getNpcName() + ": \"" + warning + "\""
|
"goal.tiedup.master_watch.demand_warning", master.getNpcName(), warning
|
||||||
).withStyle(
|
).withStyle(
|
||||||
Style.EMPTY.withColor(
|
Style.EMPTY.withColor(
|
||||||
EntityMaster.MASTER_NAME_COLOR
|
EntityMaster.MASTER_NAME_COLOR
|
||||||
@@ -431,8 +431,8 @@ public class MasterTaskWatchGoal extends Goal {
|
|||||||
String message = messages[master.getRandom().nextInt(messages.length)];
|
String message = messages[master.getRandom().nextInt(messages.length)];
|
||||||
MessageDispatcher.sendChat(
|
MessageDispatcher.sendChat(
|
||||||
pet,
|
pet,
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
master.getNpcName() + ": \"" + message + "\""
|
"goal.tiedup.master_watch.punishment", master.getNpcName(), message
|
||||||
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
|
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -450,8 +450,8 @@ public class NpcGuardCommandGoal extends Goal {
|
|||||||
if (player.getUUID().equals(commanderUUID)) {
|
if (player.getUUID().equals(commanderUUID)) {
|
||||||
String slaveName = slave.getNpcName();
|
String slaveName = slave.getNpcName();
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
npc.getNpcName() + " is chasing " + slaveName + "!"
|
"goal.tiedup.guard_command.chasing", npc.getNpcName(), slaveName
|
||||||
).withStyle(net.minecraft.ChatFormatting.RED),
|
).withStyle(net.minecraft.ChatFormatting.RED),
|
||||||
true // Action bar
|
true // Action bar
|
||||||
);
|
);
|
||||||
@@ -545,8 +545,8 @@ public class NpcGuardCommandGoal extends Goal {
|
|||||||
// Send alert message (could be enhanced with dialogue system)
|
// Send alert message (could be enhanced with dialogue system)
|
||||||
String threatName = threat.getName().getString();
|
String threatName = threat.getName().getString();
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
npc.getNpcName() + " spotted: " + threatName + "!"
|
"goal.tiedup.guard_command.spotted", npc.getNpcName(), threatName
|
||||||
).withStyle(net.minecraft.ChatFormatting.YELLOW),
|
).withStyle(net.minecraft.ChatFormatting.YELLOW),
|
||||||
true // Action bar
|
true // Action bar
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -185,13 +185,13 @@ public class TraderSellGoal extends Goal {
|
|||||||
);
|
);
|
||||||
|
|
||||||
potentialBuyer.sendSystemMessage(
|
potentialBuyer.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"[" + trader.getNpcName() + "] " + greeting
|
"goal.tiedup.trader_sell.greeting", trader.getNpcName(), greeting
|
||||||
).withStyle(net.minecraft.ChatFormatting.GOLD)
|
).withStyle(net.minecraft.ChatFormatting.GOLD)
|
||||||
);
|
);
|
||||||
|
|
||||||
potentialBuyer.sendSystemMessage(
|
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
|
net.minecraft.ChatFormatting.GRAY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities.damsel.components;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.entities.EntityDamsel;
|
import com.tiedup.remake.entities.EntityDamsel;
|
||||||
import com.tiedup.remake.entities.ai.damsel.*;
|
import com.tiedup.remake.entities.ai.damsel.*;
|
||||||
@@ -223,7 +223,7 @@ public class DamselAIController {
|
|||||||
Player.class,
|
Player.class,
|
||||||
host
|
host
|
||||||
.getBoundingBox()
|
.getBoundingBox()
|
||||||
.inflate(ModConfig.SERVER.dialogueRadius.get())
|
.inflate(SettingsAccessor.getDialogueRadius())
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get captor entity for comparison
|
// Get captor entity for comparison
|
||||||
@@ -258,7 +258,7 @@ public class DamselAIController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset cooldown
|
// Reset cooldown
|
||||||
int baseCooldown = ModConfig.SERVER.dialogueCooldown.get();
|
int baseCooldown = SettingsAccessor.getDialogueCooldown();
|
||||||
if (foundTarget) {
|
if (foundTarget) {
|
||||||
// Full cooldown if we talked
|
// Full cooldown if we talked
|
||||||
this.callForHelpCooldown =
|
this.callForHelpCooldown =
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities.damsel.components;
|
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;
|
||||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -101,7 +101,7 @@ public class DamselDialogueHandler {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
lastUsed != null &&
|
lastUsed != null &&
|
||||||
(currentTick - lastUsed) < ModConfig.SERVER.dialogueCooldown.get()
|
(currentTick - lastUsed) < SettingsAccessor.getDialogueCooldown()
|
||||||
) {
|
) {
|
||||||
return false; // Still on cooldown
|
return false; // Still on cooldown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities.damsel.components;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.entities.AbstractTiedUpNpc;
|
import com.tiedup.remake.entities.AbstractTiedUpNpc;
|
||||||
import com.tiedup.remake.state.ICaptor;
|
import com.tiedup.remake.state.ICaptor;
|
||||||
@@ -137,7 +137,7 @@ public class NpcCaptivityManager {
|
|||||||
if (!entity.level().isClientSide()) {
|
if (!entity.level().isClientSide()) {
|
||||||
host.talkToPlayersInRadius(
|
host.talkToPlayersInRadius(
|
||||||
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory.DAMSEL_FREED,
|
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory.DAMSEL_FREED,
|
||||||
ModConfig.SERVER.dialogueRadius.get()
|
SettingsAccessor.getDialogueRadius()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.entities.damsel.components;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.entities.AbstractTiedUpNpc;
|
import com.tiedup.remake.entities.AbstractTiedUpNpc;
|
||||||
import com.tiedup.remake.items.base.ILockable;
|
import com.tiedup.remake.items.base.ILockable;
|
||||||
@@ -206,7 +206,7 @@ public class NpcEquipmentManager {
|
|||||||
if (!wasAlreadyTied && !entity.level().isClientSide()) {
|
if (!wasAlreadyTied && !entity.level().isClientSide()) {
|
||||||
host.talkToPlayersInRadius(
|
host.talkToPlayersInRadius(
|
||||||
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory.DAMSEL_CAPTURED,
|
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory.DAMSEL_CAPTURED,
|
||||||
ModConfig.SERVER.dialogueRadius.get()
|
SettingsAccessor.getDialogueRadius()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.tiedup.remake.entities.kidnapper.components;
|
package com.tiedup.remake.entities.kidnapper.components;
|
||||||
|
|
||||||
import com.tiedup.remake.cells.CellDataV2;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||||
import com.tiedup.remake.entities.EntityKidnapper;
|
import com.tiedup.remake.entities.EntityKidnapper;
|
||||||
@@ -628,7 +628,7 @@ public class KidnapperCaptiveManager {
|
|||||||
|
|
||||||
// Apply blindfold if enabled in config
|
// Apply blindfold if enabled in config
|
||||||
if (
|
if (
|
||||||
com.tiedup.remake.core.ModConfig.SERVER.abandonKeepsBlindfold.get()
|
SettingsAccessor.isAbandonKeepsBlindfold()
|
||||||
) {
|
) {
|
||||||
net.minecraft.world.item.ItemStack blindfold = getBlindfoldItem();
|
net.minecraft.world.item.ItemStack blindfold = getBlindfoldItem();
|
||||||
if (
|
if (
|
||||||
@@ -652,7 +652,7 @@ public class KidnapperCaptiveManager {
|
|||||||
|
|
||||||
// Remove restraints if NOT configured to keep them
|
// Remove restraints if NOT configured to keep them
|
||||||
boolean keepBinds =
|
boolean keepBinds =
|
||||||
com.tiedup.remake.core.ModConfig.SERVER.abandonKeepsBinds.get();
|
SettingsAccessor.isAbandonKeepsBinds();
|
||||||
if (!keepBinds) {
|
if (!keepBinds) {
|
||||||
// Full release including binds
|
// Full release including binds
|
||||||
this.currentCaptive.untie(true);
|
this.currentCaptive.untie(true);
|
||||||
|
|||||||
@@ -165,8 +165,8 @@ public class MaidPrisonInteraction {
|
|||||||
|
|
||||||
sayToPlayer(player, "Very well. Here are your tools.");
|
sayToPlayer(player, "Very well. Here are your tools.");
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"The maid manually assigns you to: " + task.getDescription()
|
"entity.tiedup.maid.manual_assign", task.getDescription()
|
||||||
).withStyle(ChatFormatting.YELLOW)
|
).withStyle(ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -206,8 +206,8 @@ public class MaidPrisonInteraction {
|
|||||||
|
|
||||||
sayToPlayer(worker, "Good. You've completed your task.");
|
sayToPlayer(worker, "Good. You've completed your task.");
|
||||||
worker.sendSystemMessage(
|
worker.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"A Maid will come to collect you shortly."
|
"entity.tiedup.maid.collect_shortly"
|
||||||
).withStyle(ChatFormatting.YELLOW)
|
).withStyle(ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -229,13 +229,13 @@ public class MaidPrisonInteraction {
|
|||||||
@Nullable LaborRecord laborRecord
|
@Nullable LaborRecord laborRecord
|
||||||
) {
|
) {
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal("=== Labor Status ===").withStyle(
|
Component.translatable("entity.tiedup.maid.labor_status_header").withStyle(
|
||||||
ChatFormatting.GOLD
|
ChatFormatting.GOLD
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal("State: " + record.getState().name()).withStyle(
|
Component.translatable("entity.tiedup.maid.labor_status_state", record.getState().name()).withStyle(
|
||||||
ChatFormatting.GRAY
|
ChatFormatting.GRAY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -243,13 +243,13 @@ public class MaidPrisonInteraction {
|
|||||||
if (laborRecord != null && laborRecord.getTask() != null) {
|
if (laborRecord != null && laborRecord.getTask() != null) {
|
||||||
LaborTask task = laborRecord.getTask();
|
LaborTask task = laborRecord.getTask();
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal("Task: " + task.getDescription()).withStyle(
|
Component.translatable("entity.tiedup.maid.labor_status_task", task.getDescription()).withStyle(
|
||||||
ChatFormatting.GRAY
|
ChatFormatting.GRAY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Progress: " + task.getProgress() + "/" + task.getQuota()
|
"entity.tiedup.maid.labor_status_progress", task.getProgress(), task.getQuota()
|
||||||
).withStyle(ChatFormatting.GRAY)
|
).withStyle(ChatFormatting.GRAY)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -262,8 +262,8 @@ public class MaidPrisonInteraction {
|
|||||||
RansomRecord ransom = manager.getRansomRecord(player.getUUID());
|
RansomRecord ransom = manager.getRansomRecord(player.getUUID());
|
||||||
int remaining = ransom != null ? ransom.getRemainingDebt() : 0;
|
int remaining = ransom != null ? ransom.getRemainingDebt() : 0;
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Remaining debt: " + remaining + " emeralds"
|
"entity.tiedup.maid.labor_status_debt", remaining
|
||||||
).withStyle(ChatFormatting.GRAY)
|
).withStyle(ChatFormatting.GRAY)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -273,8 +273,8 @@ public class MaidPrisonInteraction {
|
|||||||
laborRecord.getPhase() == LaborRecord.WorkPhase.PENDING_EXTRACTION
|
laborRecord.getPhase() == LaborRecord.WorkPhase.PENDING_EXTRACTION
|
||||||
) {
|
) {
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Shift+Right-Click to manually start task"
|
"entity.tiedup.maid.labor_hint_start_task"
|
||||||
).withStyle(ChatFormatting.YELLOW)
|
).withStyle(ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
} else if (
|
} else if (
|
||||||
@@ -283,8 +283,8 @@ public class MaidPrisonInteraction {
|
|||||||
laborRecord.getTask().isComplete()
|
laborRecord.getTask().isComplete()
|
||||||
) {
|
) {
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Shift+Right-Click to manually turn in task"
|
"entity.tiedup.maid.labor_hint_turn_in"
|
||||||
).withStyle(ChatFormatting.GREEN)
|
).withStyle(ChatFormatting.GREEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,8 +199,8 @@ public class MasterPetManager {
|
|||||||
|
|
||||||
// Send message to player
|
// Send message to player
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You are free! Your master " + master.getNpcName() + " is gone."
|
"entity.tiedup.master.pet_freed", master.getNpcName()
|
||||||
).withStyle(Style.EMPTY.withColor(0x00FF00))
|
).withStyle(Style.EMPTY.withColor(0x00FF00))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ public class CampChestHandler {
|
|||||||
|
|
||||||
if (entity instanceof Player player) {
|
if (entity instanceof Player player) {
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"This chest is locked by the camp!"
|
"msg.tiedup.event.chest_locked_by_camp"
|
||||||
).withStyle(ChatFormatting.RED),
|
).withStyle(ChatFormatting.RED),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -286,10 +286,9 @@ public class CampManagementHandler {
|
|||||||
.getPlayer(prisonerId);
|
.getPlayer(prisonerId);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"A new maid, " +
|
"msg.tiedup.event.new_maid_arrived",
|
||||||
maidName +
|
maidName
|
||||||
", has arrived. Work resumes."
|
|
||||||
).withStyle(ChatFormatting.GOLD)
|
).withStyle(ChatFormatting.GOLD)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ public class CampNpcProtectionHandler {
|
|||||||
|
|
||||||
// Send warning message to player
|
// Send warning message to player
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
isTrader
|
isTrader
|
||||||
? "The camp defends their leader! You are now under attack!"
|
? "msg.tiedup.event.camp_defends_trader"
|
||||||
: "The camp defends their servant! You are now under attack!"
|
: "msg.tiedup.event.camp_defends_maid"
|
||||||
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public class GraceEventHandler {
|
|||||||
record.setProtectionExpiry(0);
|
record.setProtectionExpiry(0);
|
||||||
|
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You attacked a kidnapper - protection lost!"
|
"msg.tiedup.event.grace_lost"
|
||||||
).withStyle(ChatFormatting.RED),
|
).withStyle(ChatFormatting.RED),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -209,12 +209,10 @@ public class LaborAttackPunishmentHandler {
|
|||||||
manager.increaseDebt(prisoner.getUUID(), DEBT_INCREASE_PER_ATTACK);
|
manager.increaseDebt(prisoner.getUUID(), DEBT_INCREASE_PER_ATTACK);
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
String.format(
|
"msg.tiedup.event.debt_increased",
|
||||||
"Your debt has increased by %d emeralds for attacking %s!",
|
DEBT_INCREASE_PER_ATTACK,
|
||||||
DEBT_INCREASE_PER_ATTACK,
|
targetName
|
||||||
targetName
|
|
||||||
)
|
|
||||||
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -282,8 +280,8 @@ public class LaborAttackPunishmentHandler {
|
|||||||
|
|
||||||
// 4. Warning message
|
// 4. Warning message
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Your task has been marked as failed. You will not be paid for your work."
|
"msg.tiedup.event.task_failed"
|
||||||
).withStyle(ChatFormatting.DARK_RED)
|
).withStyle(ChatFormatting.DARK_RED)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -315,8 +313,8 @@ public class LaborAttackPunishmentHandler {
|
|||||||
laborRecord.setEscortMaidId(null);
|
laborRecord.setEscortMaidId(null);
|
||||||
|
|
||||||
prisoner.sendSystemMessage(
|
prisoner.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You have been returned to your cell for your insolence!"
|
"msg.tiedup.event.returned_to_cell"
|
||||||
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -363,8 +363,8 @@ public class PlayerStateEventHandler {
|
|||||||
// Send death escape message if applicable
|
// Send death escape message if applicable
|
||||||
if (pendingDeathEscapeMessage.remove(player.getUUID())) {
|
if (pendingDeathEscapeMessage.remove(player.getUUID())) {
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
net.minecraft.network.chat.Component.literal(
|
net.minecraft.network.chat.Component.translatable(
|
||||||
"You died and escaped captivity. Your items remain in the camp chest."
|
"msg.tiedup.event.death_escape"
|
||||||
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
).withStyle(net.minecraft.ChatFormatting.YELLOW)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.tiedup.remake.events.restriction;
|
package com.tiedup.remake.events.restriction;
|
||||||
|
|
||||||
|
import com.tiedup.remake.core.SettingsAccessor;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
|
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
|
||||||
import com.tiedup.remake.core.TiedUpMod;
|
import com.tiedup.remake.core.TiedUpMod;
|
||||||
@@ -134,7 +135,7 @@ public class BondageItemRestrictionHandler {
|
|||||||
Vec3 motion = player.getDeltaMovement();
|
Vec3 motion = player.getDeltaMovement();
|
||||||
player.setDeltaMovement(
|
player.setDeltaMovement(
|
||||||
motion.scale(
|
motion.scale(
|
||||||
com.tiedup.remake.core.ModConfig.SERVER.tiedSwimSpeedMultiplier.get()
|
SettingsAccessor.getTiedSwimSpeedMultiplier()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -473,7 +474,7 @@ public class BondageItemRestrictionHandler {
|
|||||||
if (state != null && state.isGagged()) {
|
if (state != null && state.isGagged()) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal("You can't eat with a gag on.").withStyle(
|
Component.translatable("msg.tiedup.event.cant_eat_gagged").withStyle(
|
||||||
ChatFormatting.RED
|
ChatFormatting.RED
|
||||||
),
|
),
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class LaborToolProtectionHandler {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal("You cannot drop labor tools!"),
|
Component.translatable("msg.tiedup.event.cant_drop_labor_tools"),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ public class LaborToolProtectionHandler {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal("You cannot store labor tools!"),
|
Component.translatable("msg.tiedup.event.cant_store_labor_tools"),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class PetPlayRestrictionHandler {
|
|||||||
|
|
||||||
sendThrottledMessage(
|
sendThrottledMessage(
|
||||||
player,
|
player,
|
||||||
"You cannot eat from your hand! Use a bowl."
|
"msg.tiedup.petplay.cannot_eat_hand"
|
||||||
);
|
);
|
||||||
|
|
||||||
TiedUpMod.LOGGER.debug(
|
TiedUpMod.LOGGER.debug(
|
||||||
@@ -175,7 +175,7 @@ public class PetPlayRestrictionHandler {
|
|||||||
|
|
||||||
sendThrottledMessage(
|
sendThrottledMessage(
|
||||||
player,
|
player,
|
||||||
"You cannot sleep in a bed! Use your pet bed."
|
"msg.tiedup.petplay.cannot_sleep_bed"
|
||||||
);
|
);
|
||||||
|
|
||||||
TiedUpMod.LOGGER.debug(
|
TiedUpMod.LOGGER.debug(
|
||||||
@@ -222,8 +222,8 @@ public class PetPlayRestrictionHandler {
|
|||||||
|
|
||||||
// Start sleeping (simplified - real implementation would need proper sleep mechanics)
|
// Start sleeping (simplified - real implementation would need proper sleep mechanics)
|
||||||
serverPlayer.sendSystemMessage(
|
serverPlayer.sendSystemMessage(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"You curl up in your pet bed..."
|
"msg.tiedup.petplay.curl_up_bed"
|
||||||
).withStyle(Style.EMPTY.withColor(0x888888))
|
).withStyle(Style.EMPTY.withColor(0x888888))
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ public class PetPlayRestrictionHandler {
|
|||||||
} else {
|
} else {
|
||||||
sendThrottledMessage(
|
sendThrottledMessage(
|
||||||
player,
|
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.
|
* 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 now = System.currentTimeMillis();
|
||||||
Long lastTime = lastMessageTime.get(player.getUUID());
|
Long lastTime = lastMessageTime.get(player.getUUID());
|
||||||
|
|
||||||
if (lastTime == null || now - lastTime > MESSAGE_COOLDOWN_MS) {
|
if (lastTime == null || now - lastTime > MESSAGE_COOLDOWN_MS) {
|
||||||
lastMessageTime.put(player.getUUID(), now);
|
lastMessageTime.put(player.getUUID(), now);
|
||||||
player.sendSystemMessage(
|
player.sendSystemMessage(
|
||||||
Component.literal(message).withStyle(
|
Component.translatable(translationKey).withStyle(
|
||||||
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
|
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class ChatEventHandler {
|
|||||||
|
|
||||||
if (!gagStack.isEmpty() && isGagItem) {
|
if (!gagStack.isEmpty() && isGagItem) {
|
||||||
String originalMessage = event.getRawText();
|
String originalMessage = event.getRawText();
|
||||||
// V2: get material from component, V1 fallback: from ItemGag
|
// V2: get material from GaggingComponent
|
||||||
GagMaterial material = null;
|
GagMaterial material = null;
|
||||||
if (gaggingComp != null) {
|
if (gaggingComp != null) {
|
||||||
material = gaggingComp.getMaterial();
|
material = gaggingComp.getMaterial();
|
||||||
|
|||||||
@@ -75,20 +75,14 @@ public class GenericKnife extends Item implements IKnife {
|
|||||||
|
|
||||||
// Show cutting speed
|
// Show cutting speed
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Cutting speed: " + speed + " res/s").withStyle(
|
Component.translatable("item.tiedup.knife.cutting_speed", speed)
|
||||||
ChatFormatting.GRAY
|
.withStyle(ChatFormatting.GRAY)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Show cutting time remaining
|
// Show cutting time remaining
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal(
|
Component.translatable("item.tiedup.knife.cutting_time", cuttingSeconds, remaining)
|
||||||
"Cutting time: " +
|
.withStyle(ChatFormatting.DARK_GRAY)
|
||||||
cuttingSeconds +
|
|
||||||
"s (" +
|
|
||||||
remaining +
|
|
||||||
" total res)"
|
|
||||||
).withStyle(ChatFormatting.DARK_GRAY)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ public class ItemCellKey extends Item {
|
|||||||
TooltipFlag flag
|
TooltipFlag flag
|
||||||
) {
|
) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Unlocks any Iron Bar Door").withStyle(
|
Component.translatable("item.tiedup.cell_key.desc").withStyle(
|
||||||
ChatFormatting.GRAY
|
ChatFormatting.GRAY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Does not work on bondage items").withStyle(
|
Component.translatable("item.tiedup.cell_key.restriction").withStyle(
|
||||||
ChatFormatting.DARK_GRAY
|
ChatFormatting.DARK_GRAY
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.tiedup.remake.items;
|
package com.tiedup.remake.items;
|
||||||
|
|
||||||
import com.tiedup.remake.core.ModConfig;
|
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.core.TiedUpMod;
|
import com.tiedup.remake.core.TiedUpMod;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
|||||||
@@ -39,13 +39,8 @@ public class ItemGpsLocator extends ItemOwnerTarget {
|
|||||||
if (hasTarget(stack)) {
|
if (hasTarget(stack)) {
|
||||||
String displayName = resolveTargetDisplayName(stack, level);
|
String displayName = resolveTargetDisplayName(stack, level);
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Target: ")
|
Component.translatable("item.tiedup.gps_locator.target", displayName)
|
||||||
.withStyle(ChatFormatting.BLUE)
|
.withStyle(ChatFormatting.BLUE)
|
||||||
.append(
|
|
||||||
Component.literal(displayName).withStyle(
|
|
||||||
ChatFormatting.WHITE
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,36 +85,25 @@ public class ItemKey extends ItemOwnerTarget {
|
|||||||
|
|
||||||
if (hasOwner(stack)) {
|
if (hasOwner(stack)) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Owner: ")
|
Component.translatable("item.tiedup.key.owner", getOwnerName(stack))
|
||||||
.withStyle(ChatFormatting.GOLD)
|
.withStyle(ChatFormatting.GOLD)
|
||||||
.append(
|
|
||||||
Component.literal(getOwnerName(stack)).withStyle(
|
|
||||||
ChatFormatting.WHITE
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal(
|
Component.translatable("item.tiedup.key.unclaimed")
|
||||||
"Unclaimed (Right-click a collar wearer to claim)"
|
.withStyle(ChatFormatting.GRAY)
|
||||||
).withStyle(ChatFormatting.GRAY)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasTarget(stack)) {
|
if (hasTarget(stack)) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Target: ")
|
Component.translatable("item.tiedup.key.target", getTargetName(stack))
|
||||||
.withStyle(ChatFormatting.BLUE)
|
.withStyle(ChatFormatting.BLUE)
|
||||||
.append(
|
|
||||||
Component.literal(getTargetName(stack)).withStyle(
|
|
||||||
ChatFormatting.WHITE
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Right-click a collared player to toggle LOCK")
|
Component.translatable("item.tiedup.key.hint")
|
||||||
.withStyle(ChatFormatting.DARK_GRAY)
|
.withStyle(ChatFormatting.DARK_GRAY)
|
||||||
.withStyle(ChatFormatting.ITALIC)
|
.withStyle(ChatFormatting.ITALIC)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.items;
|
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.SystemMessageManager;
|
||||||
import com.tiedup.remake.core.TiedUpMod;
|
import com.tiedup.remake.core.TiedUpMod;
|
||||||
import com.tiedup.remake.items.base.ILockable;
|
import com.tiedup.remake.items.base.ILockable;
|
||||||
@@ -63,16 +63,15 @@ public class ItemLockpick extends Item {
|
|||||||
|
|
||||||
int remaining = stack.getMaxDamage() - stack.getDamageValue();
|
int remaining = stack.getMaxDamage() - stack.getDamageValue();
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal(
|
Component.translatable("item.tiedup.lockpick.uses", remaining, stack.getMaxDamage())
|
||||||
"Uses: " + remaining + "/" + stack.getMaxDamage()
|
.withStyle(ChatFormatting.DARK_GRAY)
|
||||||
).withStyle(ChatFormatting.DARK_GRAY)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// LOW FIX: Removed server config access from client tooltip (desync issue)
|
// LOW FIX: Removed server config access from client tooltip (desync issue)
|
||||||
// Success/break chances depend on server config, not client config
|
// Success/break chances depend on server config, not client config
|
||||||
// Displaying client config values here would be misleading in multiplayer
|
// Displaying client config values here would be misleading in multiplayer
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Success/break chances: Check server config")
|
Component.translatable("item.tiedup.lockpick.chances_hint")
|
||||||
.withStyle(ChatFormatting.GRAY)
|
.withStyle(ChatFormatting.GRAY)
|
||||||
.withStyle(ChatFormatting.ITALIC)
|
.withStyle(ChatFormatting.ITALIC)
|
||||||
);
|
);
|
||||||
@@ -209,7 +208,7 @@ public class ItemLockpick extends Item {
|
|||||||
|
|
||||||
// Roll for success
|
// Roll for success
|
||||||
boolean success =
|
boolean success =
|
||||||
random.nextInt(100) < ModConfig.SERVER.lockpickSuccessChance.get();
|
random.nextInt(100) < SettingsAccessor.getLockpickSuccessChance();
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
// SUCCESS: Unlock the item, PRESERVE the padlock
|
// SUCCESS: Unlock the item, PRESERVE the padlock
|
||||||
@@ -242,7 +241,7 @@ public class ItemLockpick extends Item {
|
|||||||
// 2. Check for jam
|
// 2. Check for jam
|
||||||
boolean jammed =
|
boolean jammed =
|
||||||
random.nextDouble() * 100 <
|
random.nextDouble() * 100 <
|
||||||
ModConfig.SERVER.lockpickJamChance.get();
|
SettingsAccessor.getLockpickJamChance();
|
||||||
if (jammed) {
|
if (jammed) {
|
||||||
lockable.setJammed(targetStack, true);
|
lockable.setJammed(targetStack, true);
|
||||||
SystemMessageManager.sendToPlayer(
|
SystemMessageManager.sendToPlayer(
|
||||||
@@ -266,7 +265,7 @@ public class ItemLockpick extends Item {
|
|||||||
// 3. Check for break
|
// 3. Check for break
|
||||||
boolean broke =
|
boolean broke =
|
||||||
random.nextInt(100) <
|
random.nextInt(100) <
|
||||||
ModConfig.SERVER.lockpickBreakChance.get();
|
SettingsAccessor.getLockpickBreakChance();
|
||||||
if (broke) {
|
if (broke) {
|
||||||
lockpickStack.shrink(1);
|
lockpickStack.shrink(1);
|
||||||
SystemMessageManager.sendToPlayer(
|
SystemMessageManager.sendToPlayer(
|
||||||
@@ -354,11 +353,11 @@ public class ItemLockpick extends Item {
|
|||||||
) {
|
) {
|
||||||
if (player.getServer() == null) return;
|
if (player.getServer() == null) return;
|
||||||
|
|
||||||
Component warning = Component.literal("ALERT: ")
|
Component warning = Component.translatable("item.tiedup.lockpick.alert_prefix")
|
||||||
.withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
.withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
|
||||||
.append(
|
.append(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
player.getName().getString() + " tried to pick a lock!"
|
"item.tiedup.lockpick.alert_attempt", player.getName().getString()
|
||||||
).withStyle(ChatFormatting.GOLD)
|
).withStyle(ChatFormatting.GOLD)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.tiedup.remake.items;
|
package com.tiedup.remake.items;
|
||||||
|
|
||||||
import com.tiedup.remake.core.ModConfig;
|
|
||||||
import com.tiedup.remake.core.SettingsAccessor;
|
import com.tiedup.remake.core.SettingsAccessor;
|
||||||
import com.tiedup.remake.core.SystemMessageManager;
|
import com.tiedup.remake.core.SystemMessageManager;
|
||||||
import com.tiedup.remake.core.TiedUpMod;
|
import com.tiedup.remake.core.TiedUpMod;
|
||||||
@@ -60,20 +59,17 @@ public class ItemRag extends Item {
|
|||||||
int ticksRemaining = getWetTime(stack);
|
int ticksRemaining = getWetTime(stack);
|
||||||
int secondsRemaining = ticksRemaining / 20;
|
int secondsRemaining = ticksRemaining / 20;
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Soaked with chloroform").withStyle(
|
Component.translatable("item.tiedup.rag.soaked")
|
||||||
ChatFormatting.GREEN
|
.withStyle(ChatFormatting.GREEN)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal(
|
Component.translatable("item.tiedup.rag.evaporates", secondsRemaining)
|
||||||
"Evaporates in: " + secondsRemaining + "s"
|
.withStyle(ChatFormatting.GRAY)
|
||||||
).withStyle(ChatFormatting.GRAY)
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Dry - needs chloroform").withStyle(
|
Component.translatable("item.tiedup.rag.dry")
|
||||||
ChatFormatting.GRAY
|
.withStyle(ChatFormatting.GRAY)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,6 +279,6 @@ public class ItemRag extends Item {
|
|||||||
* @return Default wet time in ticks
|
* @return Default wet time in ticks
|
||||||
*/
|
*/
|
||||||
public static int getDefaultWetTime() {
|
public static int getDefaultWetTime() {
|
||||||
return ModConfig.SERVER.ragWetTime.get();
|
return SettingsAccessor.getRagWetTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,20 +47,18 @@ public class ItemShockerController extends ItemOwnerTarget {
|
|||||||
|
|
||||||
if (isBroadcastEnabled(stack)) {
|
if (isBroadcastEnabled(stack)) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("MODE: BROADCAST").withStyle(
|
Component.translatable("item.tiedup.shocker.mode_broadcast")
|
||||||
ChatFormatting.DARK_RED
|
.withStyle(ChatFormatting.DARK_RED)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("(Affects ALL your slaves in radius)")
|
Component.translatable("item.tiedup.shocker.broadcast_desc")
|
||||||
.withStyle(ChatFormatting.GRAY)
|
.withStyle(ChatFormatting.GRAY)
|
||||||
.withStyle(ChatFormatting.ITALIC)
|
.withStyle(ChatFormatting.ITALIC)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("MODE: TARGETED").withStyle(
|
Component.translatable("item.tiedup.shocker.mode_targeted")
|
||||||
ChatFormatting.BLUE
|
.withStyle(ChatFormatting.BLUE)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
if (hasTarget(stack)) {
|
if (hasTarget(stack)) {
|
||||||
String displayName = getTargetName(stack);
|
String displayName = getTargetName(stack);
|
||||||
@@ -102,7 +100,7 @@ public class ItemShockerController extends ItemOwnerTarget {
|
|||||||
|
|
||||||
if (isDisconnected) {
|
if (isDisconnected) {
|
||||||
targetComp.append(
|
targetComp.append(
|
||||||
Component.literal(" [FREED]")
|
Component.translatable("item.tiedup.shocker.freed")
|
||||||
.withStyle(ChatFormatting.RED)
|
.withStyle(ChatFormatting.RED)
|
||||||
.withStyle(ChatFormatting.BOLD)
|
.withStyle(ChatFormatting.BOLD)
|
||||||
);
|
);
|
||||||
@@ -110,20 +108,18 @@ public class ItemShockerController extends ItemOwnerTarget {
|
|||||||
tooltip.add(targetComp);
|
tooltip.add(targetComp);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal(" > No target connected").withStyle(
|
Component.translatable("item.tiedup.shocker.no_target")
|
||||||
ChatFormatting.GRAY
|
.withStyle(ChatFormatting.GRAY)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Radius: " + getRadius(stack) + "m").withStyle(
|
Component.translatable("item.tiedup.shocker.radius", getRadius(stack))
|
||||||
ChatFormatting.GREEN
|
.withStyle(ChatFormatting.GREEN)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Shift + Right-click to toggle Broadcast mode")
|
Component.translatable("item.tiedup.shocker.hint")
|
||||||
.withStyle(ChatFormatting.DARK_GRAY)
|
.withStyle(ChatFormatting.DARK_GRAY)
|
||||||
.withStyle(ChatFormatting.ITALIC)
|
.withStyle(ChatFormatting.ITALIC)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.tiedup.remake.items;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
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 com.tiedup.remake.core.ModSounds;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
@@ -74,7 +74,7 @@ public class ItemTaser extends Item {
|
|||||||
1.0f
|
1.0f
|
||||||
);
|
);
|
||||||
|
|
||||||
int duration = ModConfig.SERVER.taserStunDuration.get();
|
int duration = SettingsAccessor.getTaserStunDuration();
|
||||||
|
|
||||||
// Apply Slowness I
|
// Apply Slowness I
|
||||||
target.addEffect(
|
target.addEffect(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.tiedup.remake.items;
|
package com.tiedup.remake.items;
|
||||||
|
|
||||||
import com.tiedup.remake.core.TiedUpMod;
|
import com.tiedup.remake.core.TiedUpMod;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -38,9 +39,8 @@ public class ItemTiedUpGuide extends Item {
|
|||||||
// Check if Patchouli is installed
|
// Check if Patchouli is installed
|
||||||
if (!ModList.get().isLoaded("patchouli")) {
|
if (!ModList.get().isLoaded("patchouli")) {
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable("item.tiedup.guide.no_patchouli")
|
||||||
"§cPatchouli is not installed! Install it to use this guide."
|
.withStyle(ChatFormatting.RED),
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
return InteractionResultHolder.fail(stack);
|
return InteractionResultHolder.fail(stack);
|
||||||
@@ -52,9 +52,8 @@ public class ItemTiedUpGuide extends Item {
|
|||||||
);
|
);
|
||||||
if (guideBookItem == null) {
|
if (guideBookItem == null) {
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal(
|
Component.translatable("item.tiedup.guide.book_not_found")
|
||||||
"§cFailed to find Patchouli guide_book item."
|
.withStyle(ChatFormatting.RED),
|
||||||
),
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
return InteractionResultHolder.fail(stack);
|
return InteractionResultHolder.fail(stack);
|
||||||
@@ -76,7 +75,8 @@ public class ItemTiedUpGuide extends Item {
|
|||||||
stack.shrink(1);
|
stack.shrink(1);
|
||||||
|
|
||||||
player.displayClientMessage(
|
player.displayClientMessage(
|
||||||
Component.literal("§aReceived TiedUp! Guide Book!"),
|
Component.translatable("item.tiedup.guide.received")
|
||||||
|
.withStyle(ChatFormatting.GREEN),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,25 +39,25 @@ public class ItemToken extends Item {
|
|||||||
TooltipFlag flag
|
TooltipFlag flag
|
||||||
) {
|
) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Camp Access Token").withStyle(
|
Component.translatable("item.tiedup.token.title").withStyle(
|
||||||
ChatFormatting.GOLD,
|
ChatFormatting.GOLD,
|
||||||
ChatFormatting.BOLD
|
ChatFormatting.BOLD
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
tooltip.add(Component.literal(""));
|
tooltip.add(Component.literal(""));
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Kidnappers won't target you").withStyle(
|
Component.translatable("item.tiedup.token.effect_no_target").withStyle(
|
||||||
ChatFormatting.GREEN
|
ChatFormatting.GREEN
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Allows trading with Slave Traders").withStyle(
|
Component.translatable("item.tiedup.token.effect_trading").withStyle(
|
||||||
ChatFormatting.GREEN
|
ChatFormatting.GREEN
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
tooltip.add(Component.literal(""));
|
tooltip.add(Component.literal(""));
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Keep in your inventory for effect").withStyle(
|
Component.translatable("item.tiedup.token.hint").withStyle(
|
||||||
ChatFormatting.GRAY,
|
ChatFormatting.GRAY,
|
||||||
ChatFormatting.ITALIC
|
ChatFormatting.ITALIC
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.tiedup.remake.items;
|
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.core.TiedUpMod;
|
||||||
import com.tiedup.remake.entities.EntityDamsel;
|
import com.tiedup.remake.entities.EntityDamsel;
|
||||||
import com.tiedup.remake.entities.EntityKidnapper;
|
import com.tiedup.remake.entities.EntityKidnapper;
|
||||||
@@ -92,8 +92,8 @@ public class ItemWhip extends Item {
|
|||||||
return InteractionResult.PASS;
|
return InteractionResult.PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
float damage = ModConfig.SERVER.whipDamage.get().floatValue();
|
float damage = SettingsAccessor.getWhipDamage();
|
||||||
int resistanceDecrease = ModConfig.SERVER.whipResistanceDecrease.get();
|
int resistanceDecrease = SettingsAccessor.getWhipResistanceDecrease();
|
||||||
|
|
||||||
// 1. Play whip sound
|
// 1. Play whip sound
|
||||||
TiedUpSounds.playWhipSound(target);
|
TiedUpSounds.playWhipSound(target);
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public abstract class ItemOwnerTarget extends Item {
|
|||||||
) {
|
) {
|
||||||
if (hasOwner(stack)) {
|
if (hasOwner(stack)) {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal("Owner: ")
|
Component.translatable("item.tiedup.owner_target.owner")
|
||||||
.withStyle(ChatFormatting.GOLD)
|
.withStyle(ChatFormatting.GOLD)
|
||||||
.append(
|
.append(
|
||||||
Component.literal(getOwnerName(stack)).withStyle(
|
Component.literal(getOwnerName(stack)).withStyle(
|
||||||
@@ -167,8 +167,8 @@ public abstract class ItemOwnerTarget extends Item {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(
|
tooltip.add(
|
||||||
Component.literal(
|
Component.translatable(
|
||||||
"Unclaimed (" + unclaimedHint + ")"
|
"item.tiedup.owner_target.unclaimed", unclaimedHint
|
||||||
).withStyle(ChatFormatting.GRAY)
|
).withStyle(ChatFormatting.GRAY)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -46,8 +46,8 @@ public class StruggleSessionManager {
|
|||||||
> continuousSessions = new ConcurrentHashMap<>();
|
> continuousSessions = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping from legacy V1 slot indices to V2 BodyRegionV2.
|
* Mapping from legacy slot indices to V2 BodyRegionV2.
|
||||||
* Used to convert V1 session targetSlot ordinals to V2 regions.
|
* 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.
|
* Index: 0=ARMS, 1=MOUTH, 2=EYES, 3=EARS, 4=NECK, 5=TORSO, 6=HANDS.
|
||||||
*/
|
*/
|
||||||
private static final BodyRegionV2[] SLOT_TO_REGION = {
|
private static final BodyRegionV2[] SLOT_TO_REGION = {
|
||||||
@@ -83,16 +83,16 @@ public class StruggleSessionManager {
|
|||||||
) {
|
) {
|
||||||
UUID playerId = player.getUUID();
|
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(
|
ContinuousStruggleMiniGameState existing = continuousSessions.get(
|
||||||
playerId
|
playerId
|
||||||
);
|
);
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
TiedUpMod.LOGGER.debug(
|
TiedUpMod.LOGGER.debug(
|
||||||
"[StruggleSessionManager] Replacing existing continuous struggle session for {}",
|
"[StruggleSessionManager] Rejected continuous session: active session already exists for {}",
|
||||||
player.getName().getString()
|
player.getName().getString()
|
||||||
);
|
);
|
||||||
continuousSessions.remove(playerId);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new session with configurable rate
|
// Create new session with configurable rate
|
||||||
@@ -146,12 +146,16 @@ public class StruggleSessionManager {
|
|||||||
) {
|
) {
|
||||||
UUID playerId = player.getUUID();
|
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(
|
ContinuousStruggleMiniGameState existing = continuousSessions.get(
|
||||||
playerId
|
playerId
|
||||||
);
|
);
|
||||||
if (existing != null) {
|
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
|
// Create new session with target slot and configurable rate
|
||||||
@@ -607,7 +611,7 @@ public class StruggleSessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (session.isAccessoryStruggle()) {
|
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();
|
Integer slotIndex = session.getTargetSlot();
|
||||||
if (
|
if (
|
||||||
slotIndex == null ||
|
slotIndex == null ||
|
||||||
@@ -676,7 +680,7 @@ public class StruggleSessionManager {
|
|||||||
if (session.isV2Struggle()) {
|
if (session.isV2Struggle()) {
|
||||||
com.tiedup.remake.v2.BodyRegionV2 region =
|
com.tiedup.remake.v2.BodyRegionV2 region =
|
||||||
session.getTargetRegion();
|
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 =
|
ItemStack stackInRegion =
|
||||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getInRegion(
|
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getInRegion(
|
||||||
player,
|
player,
|
||||||
@@ -714,7 +718,7 @@ public class StruggleSessionManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Handle accessory escape (V1 path -- slot index is legacy ordinal)
|
// Handle accessory escape (legacy slot-index path)
|
||||||
Integer slotIndex = session.getTargetSlot();
|
Integer slotIndex = session.getTargetSlot();
|
||||||
if (
|
if (
|
||||||
slotIndex != null &&
|
slotIndex != null &&
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user