Remove internal phase comments and format code

Strip all Phase references, TODO/FUTURE roadmap notes, and internal
planning comments from the codebase. Run Prettier for consistent
formatting across all Java files.
This commit is contained in:
NotEvil
2026-04-12 01:24:49 +02:00
parent 73d70e212d
commit a71093ba9c
482 changed files with 8500 additions and 5155 deletions

View File

@@ -352,10 +352,7 @@ public class GenericKnife extends Item implements IKnife {
return;
}
ItemStack accessory = V2EquipmentHelper.getInRegion(
player,
target
);
ItemStack accessory = V2EquipmentHelper.getInRegion(player, target);
if (accessory.isEmpty()) {
// Target doesn't exist
state.clearKnifeCutTarget();

View File

@@ -9,7 +9,6 @@ import net.minecraft.world.item.Item;
*
* Factory pattern: All mittens variants are created using this single class.
*
* Phase 14.4: Mittens system - blocks hand interactions when equipped.
*/
public class GenericMittens extends ItemMittens {

View File

@@ -17,7 +17,6 @@ import net.minecraft.world.level.Level;
* Chloroform Bottle - Used to soak rags for knocking out targets
* Has limited durability.
*
* Phase 15: Full chloroform system implementation
*
* Usage:
* - Hold chloroform bottle in main hand, rag in offhand

View File

@@ -135,9 +135,7 @@ public class ItemChokeCollar extends ItemCollar implements IHas3DModelConfig {
return false;
}
// ========================================
// 3D Model Support
// ========================================
@Override
public boolean uses3DModel() {

View File

@@ -8,7 +8,6 @@ import net.minecraft.world.item.Item;
* Standard collar for marking ownership.
*
* Based on original ItemCollar from 1.12.2
* Phase 1: No ownership system yet, just a basic wearable collar
* Note: Collars have maxStackSize of 1 (unique items)
*/
public class ItemClassicCollar extends ItemCollar {

View File

@@ -1,7 +1,6 @@
package com.tiedup.remake.items;
import com.tiedup.remake.cells.CellDataV2;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.cells.CellRegistryV2;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.TiedUpMod;
@@ -14,6 +13,7 @@ import com.tiedup.remake.personality.JobExperience;
import com.tiedup.remake.personality.NpcCommand;
import com.tiedup.remake.personality.NpcNeeds;
import com.tiedup.remake.personality.PersonalityState;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.ChatFormatting;

View File

@@ -129,9 +129,10 @@ public class ItemDebugWand extends Item {
) {
player.displayClientMessage(Component.literal(""), false); // Blank line
player.displayClientMessage(
Component.literal(
"=== " + damsel.getNpcName() + " ==="
).withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD),
Component.literal("=== " + damsel.getNpcName() + " ===").withStyle(
ChatFormatting.GOLD,
ChatFormatting.BOLD
),
false
);

View File

@@ -253,7 +253,6 @@ public class ItemGpsCollar extends ItemShockCollar {
}
/**
* Phase 14.1.4: Reset auto-shock timer when GPS collar is removed.
*/
@Override
public void onUnequipped(ItemStack stack, LivingEntity entity) {

View File

@@ -1,11 +1,11 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.items.base.ItemCollar;
import com.tiedup.remake.items.base.ItemOwnerTarget;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.util.KidnappedHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
@@ -88,7 +88,9 @@ public class ItemGpsLocator extends ItemOwnerTarget {
target
);
if (targetState != null && targetState.hasCollar()) {
ItemStack collarStack = targetState.getEquipment(BodyRegionV2.NECK);
ItemStack collarStack = targetState.getEquipment(
BodyRegionV2.NECK
);
if (
collarStack.getItem() instanceof
ItemGpsCollar collarItem
@@ -162,7 +164,6 @@ public class ItemGpsLocator extends ItemOwnerTarget {
}
/**
* Phase 14.1.5: Refactored to support IBondageState (LivingEntity + NPCs)
*/
@Override
public InteractionResult interactLivingEntity(

View File

@@ -9,7 +9,6 @@ import net.minecraft.world.item.Item;
* Hood - Covers the head completely
* Combines blindfold effect with gagging effect.
*
* Phase 15: Combo item (BLINDFOLD slot + gag effect)
* Extends ItemBlindfold for slot behavior, implements IHasGaggingEffect for speech muffling.
*/
public class ItemHood extends ItemBlindfold implements IHasGaggingEffect {

View File

@@ -1,10 +1,10 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.items.base.ItemOwnerTarget;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.util.KidnappedHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import java.util.UUID;
import net.minecraft.ChatFormatting;
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Collar Key - Used to lock/unlock bondage items via the Slave Management GUI.
*
* <p>Phase 20: Key-Lock System</p>
* <p>Key-Lock System</p>
* <ul>
* <li><b>Linking:</b> Right-click a player wearing a collar to link (claim) the key to them.</li>
* <li><b>Management:</b> Opens SlaveItemManagementScreen to lock/unlock individual items.</li>
@@ -40,7 +40,7 @@ public class ItemKey extends ItemOwnerTarget {
super(new net.minecraft.world.item.Item.Properties().durability(64));
}
// ========== Phase 20: Key UUID System ==========
// ========== Key UUID System ==========
/**
* Get the unique UUID for this key.
@@ -124,8 +124,6 @@ public class ItemKey extends ItemOwnerTarget {
* Logic for interacting with entities wearing collars.
* Opens the Slave Item Management GUI to lock/unlock individual items.
*
* Phase 14.1.5: Refactored to support IBondageState (LivingEntity + NPCs)
* Phase 20: Opens GUI instead of direct toggle
*/
@Override
public InteractionResult interactLivingEntity(
@@ -234,7 +232,9 @@ public class ItemKey extends ItemOwnerTarget {
net.minecraft.world.entity.LivingEntity target
) {
net.minecraft.client.Minecraft.getInstance().setScreen(
new com.tiedup.remake.client.gui.screens.UnifiedBondageScreen(target)
new com.tiedup.remake.client.gui.screens.UnifiedBondageScreen(
target
)
);
}

View File

@@ -27,7 +27,6 @@ import org.jetbrains.annotations.Nullable;
/**
* Lockpick item for picking locks on bondage restraints.
*
* Phase 21: Revamped Lockpick System
*
* Behavior:
* - 25% chance of success per attempt

View File

@@ -1,12 +1,12 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.ILockable;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.util.KidnappedHelper;
import com.tiedup.remake.util.TiedUpSounds;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.UUID;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
@@ -21,8 +21,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
/**
* Master Key - Universal key that opens any padlock.
*
* Phase 15: Full master key implementation
* Phase 20: Opens SlaveItemManagementScreen in master mode
*
* Behavior:
* - Right-click: Opens Slave Management GUI (can unlock any lock)
@@ -124,7 +122,9 @@ public class ItemMasterKey extends Item {
net.minecraft.world.entity.LivingEntity target
) {
net.minecraft.client.Minecraft.getInstance().setScreen(
new com.tiedup.remake.client.gui.screens.UnifiedBondageScreen(target)
new com.tiedup.remake.client.gui.screens.UnifiedBondageScreen(
target
)
);
}

View File

@@ -9,7 +9,6 @@ import net.minecraft.world.item.Item;
* Medical Gag - Full face medical restraint
* Combines gag effect with blinding effect.
*
* Phase 15: Combo item (GAG slot + blinding effect)
* Extends ItemGag for slot behavior, implements IHasBlindingEffect for vision obstruction.
*/
public class ItemMedicalGag extends ItemGag implements IHasBlindingEffect {

View File

@@ -16,7 +16,6 @@ import net.minecraft.world.item.ItemStack;
/**
* Paddle - Tool for disciplining NPCs (gentle discipline).
*
* Phase 7: Basic paddle
* Refactored: Tighten moved to keybind, paddle now only does discipline on NPCs
*/
public class ItemPaddle extends Item {
@@ -54,7 +53,9 @@ public class ItemPaddle extends Item {
}
// NPC discipline - visual/sound feedback only (no personality effect)
if (target instanceof com.tiedup.remake.entities.AbstractTiedUpNpc npc) {
if (
target instanceof com.tiedup.remake.entities.AbstractTiedUpNpc npc
) {
// Visual feedback - gentler than whip
TiedUpSounds.playSlapSound(target);
if (player.level() instanceof ServerLevel serverLevel) {

View File

@@ -12,7 +12,6 @@ import org.jetbrains.annotations.Nullable;
/**
* Padlock - Used to make bondage items lockable.
*
* Phase 20: Anvil-based padlock attachment
*
* Usage:
* - Combine with a bondage item (ILockable) in an Anvil

View File

@@ -28,7 +28,6 @@ import org.jetbrains.annotations.Nullable;
* Rag - Can be soaked in chloroform to knock out targets
* Has wet/dry state managed via NBT.
*
* Phase 15: Full chloroform system implementation
*
* Usage:
* 1. Hold chloroform bottle, rag in offhand, right-click → rag becomes wet

View File

@@ -11,7 +11,6 @@ import net.minecraft.world.level.Level;
* Rope Arrow - Arrow that ties up targets on hit
* When fired from a bow and hits an entity, it has 75% chance to bind them.
*
* Phase 15: Full rope arrow implementation
*
* Behavior:
* - Works like regular arrows for firing

View File

@@ -8,7 +8,6 @@ import net.minecraft.world.item.ItemStack;
/**
* Automatic Shock Collar - Shocks the wearer at regular intervals.
*
* Phase 14.1.5: Refactored to support IRestrainable (LivingEntity + NPCs)
*
* <p>Mechanics:</p>
* <ul>
@@ -39,7 +38,6 @@ public class ItemShockCollarAuto extends ItemShockCollar {
/**
* Ensures the internal shock timer is cleaned up when the item is removed.
*
* Phase 14.1.5: Refactored to support IRestrainable (LivingEntity + NPCs)
*/
@Override
public void onUnequipped(ItemStack stack, LivingEntity entity) {

View File

@@ -1,13 +1,13 @@
package com.tiedup.remake.items;
import com.tiedup.remake.core.ModSounds;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.ItemCollar;
import com.tiedup.remake.items.base.ItemOwnerTarget;
import com.tiedup.remake.state.IRestrainable;
import com.tiedup.remake.util.KidnappedHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@@ -73,7 +73,9 @@ public class ItemShockerController extends ItemOwnerTarget {
KidnappedHelper.getKidnappedState(target);
if (targetState != null && targetState.hasCollar()) {
isDisconnected = false;
ItemStack collar = targetState.getEquipment(BodyRegionV2.NECK);
ItemStack collar = targetState.getEquipment(
BodyRegionV2.NECK
);
if (
collar.getItem() instanceof
ItemCollar collarItem &&
@@ -260,7 +262,6 @@ public class ItemShockerController extends ItemOwnerTarget {
}
/**
* Phase 14.1.5: Refactored to support IRestrainable (LivingEntity + NPCs)
*/
@Override
public InteractionResult interactLivingEntity(
@@ -308,7 +309,6 @@ public class ItemShockerController extends ItemOwnerTarget {
}
/**
* Phase 14.1.5: New method to support LivingEntity (Players + NPCs)
* Returns all kidnappable entities in range wearing shock collars owned by the shocker owner or in public mode.
*/
private List<LivingEntity> getNearbyKidnappedTargets(
@@ -371,7 +371,9 @@ public class ItemShockerController extends ItemOwnerTarget {
CompoundTag tag = stack.getTag();
return (tag != null && tag.contains(NBT_RADIUS))
? tag.getInt(NBT_RADIUS)
: com.tiedup.remake.core.SettingsAccessor.getShockerControllerRadius(null);
: com.tiedup.remake.core.SettingsAccessor.getShockerControllerRadius(
null
);
}
public void setRadius(ItemStack stack, int radius) {

View File

@@ -22,7 +22,6 @@ import net.minecraft.world.item.ItemStack;
* Whip - Tool for discipline
* Right-click a tied entity to deal damage and decrease their resistance.
*
* Phase 15: Full whip mechanics implementation
*
* Effects:
* - Deals damage (configurable)
@@ -161,8 +160,13 @@ public class ItemWhip extends Item {
// Resistance is stored in bind item NBT, so we must sync inventory
// Without this, client still shows old resistance value in UI
// Sync V2 equipment (resistance NBT changed on the stored ItemStack)
if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) {
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.sync(serverPlayer);
if (
player instanceof
net.minecraft.server.level.ServerPlayer serverPlayer
) {
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.sync(
serverPlayer
);
}
TiedUpMod.LOGGER.debug(

View File

@@ -192,21 +192,25 @@ public class ModCreativeTabs {
output.accept(V2Items.PET_CAGE.get());
// ========== V2 BONDAGE ITEMS ==========
output.accept(com.tiedup.remake.v2.bondage.V2BondageItems.V2_HANDCUFFS.get());
output.accept(
com.tiedup.remake.v2.bondage.V2BondageItems.V2_HANDCUFFS.get()
);
// ========== DATA-DRIVEN BONDAGE ITEMS ==========
for (com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemDefinition def :
com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemRegistry.getAll()) {
for (com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemDefinition def : com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemRegistry.getAll()) {
output.accept(
com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(def.id())
com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
def.id()
)
);
}
// ========== FURNITURE PLACER ITEMS ==========
for (com.tiedup.remake.v2.furniture.FurnitureDefinition def :
com.tiedup.remake.v2.furniture.FurnitureRegistry.getAll()) {
for (com.tiedup.remake.v2.furniture.FurnitureDefinition def : com.tiedup.remake.v2.furniture.FurnitureRegistry.getAll()) {
output.accept(
com.tiedup.remake.v2.furniture.FurniturePlacerItem.createStack(def.id())
com.tiedup.remake.v2.furniture.FurniturePlacerItem.createStack(
def.id()
)
);
}
})

View File

@@ -79,7 +79,6 @@ public class ModItems {
/**
* All mittens items (1 variant via MittensVariant enum)
* Phase 14.4: Blocks hand interactions when equipped
*/
public static final Map<MittensVariant, RegistryObject<Item>> MITTENS =
registerAllMittens();
@@ -183,7 +182,6 @@ public class ModItems {
ItemKey::new
);
// Phase 20: Lockpick for picking locks without keys
public static final RegistryObject<Item> LOCKPICK = ITEMS.register(
"lockpick",
ItemLockpick::new

View File

@@ -53,7 +53,9 @@ public enum BindVariant {
* Delegates to {@link com.tiedup.remake.core.SettingsAccessor#getBindResistance(String)}.
*/
public int getResistance() {
return com.tiedup.remake.core.SettingsAccessor.getBindResistance(registryName);
return com.tiedup.remake.core.SettingsAccessor.getBindResistance(
registryName
);
}
public PoseType getPoseType() {

View File

@@ -33,9 +33,7 @@ import net.minecraft.world.item.ItemStack;
* @see SettingsAccessor
*/
public interface IHasResistance {
// ========================================
// NBT KEYS
// ========================================
/** NBT key for storing current resistance value (camelCase standard) */
String NBT_CURRENT_RESISTANCE = "currentResistance";
@@ -46,9 +44,7 @@ public interface IHasResistance {
/** NBT key for storing whether item can be struggled out of */
String NBT_CAN_STRUGGLE = "canBeStruggledOut";
// ========================================
// ABSTRACT METHODS (must implement)
// ========================================
/**
* Get the item name/ID for resistance config lookup.
@@ -74,9 +70,7 @@ public interface IHasResistance {
*/
void notifyStruggle(LivingEntity entity);
// ========================================
// DEFAULT METHODS (NBT handling)
// ========================================
/**
* Get the base resistance from config via SettingsAccessor.

View File

@@ -234,7 +234,9 @@ public interface ILockable {
* @return Lock resistance value (default: 250, configurable)
*/
default int getLockResistance() {
return com.tiedup.remake.core.SettingsAccessor.getPadlockResistance(null);
return com.tiedup.remake.core.SettingsAccessor.getPadlockResistance(
null
);
}
/**

View File

@@ -1,17 +1,17 @@
package com.tiedup.remake.items.base;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.network.ModNetwork;
import com.tiedup.remake.network.action.PacketTying;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.state.PlayerBindState;
import com.tiedup.remake.tasks.TyingPlayerTask;
import com.tiedup.remake.tasks.TyingTask;
import com.tiedup.remake.util.KidnappedHelper;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.util.RestraintEffectUtils;
import com.tiedup.remake.util.TiedUpSounds;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import java.util.UUID;
import net.minecraft.ChatFormatting;
@@ -36,13 +36,10 @@ import org.jetbrains.annotations.Nullable;
* These items restrain a player's movement and actions when equipped.
*
* <p>Implements {@link IHasResistance} for the struggle/escape system.
* <p>Implements {@link ILockable} for the padlock system (Phase 15).
* <p>Implements {@link ILockable} for the padlock system.
*
* Based on original ItemBind from 1.12.2
*
* Phase 5: Movement speed reduction implemented
* Phase 7: Resistance system implemented via IHasResistance
* Phase 15: Added ILockable interface for padlock support
*/
public abstract class ItemBind
extends Item
@@ -68,12 +65,20 @@ public abstract class ItemBind
private static final String MODE_FULL = BIND_MODE_FULL;
private static final String MODE_ARMS = "arms";
private static final String MODE_LEGS = "legs";
private static final String[] MODE_CYCLE = {MODE_FULL, MODE_ARMS, MODE_LEGS};
private static final java.util.Map<String, String> MODE_TRANSLATION_KEYS = java.util.Map.of(
MODE_FULL, "tiedup.bindmode.full",
MODE_ARMS, "tiedup.bindmode.arms",
MODE_LEGS, "tiedup.bindmode.legs"
);
private static final String[] MODE_CYCLE = {
MODE_FULL,
MODE_ARMS,
MODE_LEGS,
};
private static final java.util.Map<String, String> MODE_TRANSLATION_KEYS =
java.util.Map.of(
MODE_FULL,
"tiedup.bindmode.full",
MODE_ARMS,
"tiedup.bindmode.arms",
MODE_LEGS,
"tiedup.bindmode.legs"
);
/**
* Get the bind mode ID string from the stack's NBT.
@@ -85,7 +90,11 @@ public abstract class ItemBind
CompoundTag tag = stack.getTag();
if (tag == null || !tag.contains(NBT_BIND_MODE)) return MODE_FULL;
String value = tag.getString(NBT_BIND_MODE);
if (MODE_FULL.equals(value) || MODE_ARMS.equals(value) || MODE_LEGS.equals(value)) {
if (
MODE_FULL.equals(value) ||
MODE_ARMS.equals(value) ||
MODE_LEGS.equals(value)
) {
return value;
}
return MODE_FULL;
@@ -135,7 +144,10 @@ public abstract class ItemBind
* @return the i18n key for the mode
*/
public static String getBindModeTranslationKey(ItemStack stack) {
return MODE_TRANSLATION_KEYS.getOrDefault(getBindModeId(stack), "tiedup.bindmode.full");
return MODE_TRANSLATION_KEYS.getOrDefault(
getBindModeId(stack),
"tiedup.bindmode.full"
);
}
/**
@@ -221,7 +233,6 @@ public abstract class ItemBind
* Called when the bind is equipped on an entity.
* Applies movement speed reduction only if legs are bound.
*
* Phase 14.1.5: Refactored to support IBondageState (LivingEntity + NPCs)
* Leg Binding: Speed reduction conditional on mode
* Based on original ItemBind.onEquipped() (1.12.2)
*/
@@ -247,9 +258,13 @@ public abstract class ItemBind
// still need the legacy RestraintEffectUtils speed modifier.
PoseType poseType = getPoseType();
boolean fullImmobilization =
poseType == PoseType.WRAP || poseType == PoseType.LATEX_SACK;
poseType == PoseType.WRAP ||
poseType == PoseType.LATEX_SACK;
RestraintEffectUtils.applyBindSpeedReduction(entity, fullImmobilization);
RestraintEffectUtils.applyBindSpeedReduction(
entity,
fullImmobilization
);
TiedUpMod.LOGGER.debug(
"[ItemBind] Applied bind (mode={}, pose={}) to NPC {} - speed reduced (full={})",
modeId,
@@ -270,9 +285,7 @@ public abstract class ItemBind
/**
* Called when the bind is unequipped from an entity.
* Restores normal movement speed for all entities.
* Phase 7: Resets resistance for next use.
*
* Phase 14.1.5: Refactored to support IBondageState (LivingEntity + NPCs)
* Based on original ItemBind.onUnequipped() (1.12.2)
*/
@Override
@@ -285,23 +298,23 @@ public abstract class ItemBind
RestraintEffectUtils.removeBindSpeedReduction(entity);
}
// Phase 7: Reset resistance for next use (uses IHasResistance default method)
IHasResistance.super.resetCurrentResistance(stack);
TiedUpMod.LOGGER.debug(
"[ItemBind] Removed bind from {} - speed {} resistance reset",
entity.getName().getString(),
entity instanceof Player ? "delegated to MovementStyleManager," : "restored,"
entity instanceof Player
? "delegated to MovementStyleManager,"
: "restored,"
);
}
// ========== Phase 6: Tying Interaction ==========
// ========== Tying Interaction ==========
/**
* Called when player right-clicks another entity with this bind item.
* Starts or continues a tying task to tie up the target entity.
*
* Phase 14.2: Unified to support IBondageState (Player + NPCs)
* - Players: Uses tying task with progress bar
* - NPCs: Instant bind (no tying mini-game)
*
@@ -325,14 +338,15 @@ public abstract class ItemBind
return InteractionResult.SUCCESS;
}
// Phase 14.2: Use KidnappedHelper to support both Players and NPCs
IBondageState targetState = KidnappedHelper.getKidnappedState(target);
if (targetState == null) {
return InteractionResult.PASS; // Target cannot be restrained
}
// Get kidnapper state (player using the item)
IBondageState kidnapperState = KidnappedHelper.getKidnappedState(player);
IBondageState kidnapperState = KidnappedHelper.getKidnappedState(
player
);
if (kidnapperState == null) {
return InteractionResult.FAIL;
}
@@ -345,7 +359,11 @@ public abstract class ItemBind
// No bind in hand - can't swap, just pass
return InteractionResult.PASS;
}
ItemStack oldBind = targetState.replaceEquipment(BodyRegionV2.ARMS, stack.copy(), false);
ItemStack oldBind = targetState.replaceEquipment(
BodyRegionV2.ARMS,
stack.copy(),
false
);
if (!oldBind.isEmpty()) {
stack.shrink(1);
targetState.kidnappedDropItem(oldBind);
@@ -359,7 +377,6 @@ public abstract class ItemBind
return InteractionResult.PASS;
}
// Phase 7 FIX: Can't tie others if you're tied yourself
if (kidnapperState.isTiedUp()) {
TiedUpMod.LOGGER.debug(
"[ItemBind] {} tried to tie but is tied themselves",
@@ -368,9 +385,7 @@ public abstract class ItemBind
return InteractionResult.PASS;
}
// ========================================
// SECURITY: Distance and line-of-sight validation (skip for self-tying)
// ========================================
boolean isSelfTying = player.equals(target);
if (!isSelfTying) {
double maxTieDistance = 4.0; // Max distance to tie (blocks)
@@ -396,13 +411,11 @@ public abstract class ItemBind
}
}
// Phase 14.2.6: Unified tying for both Players and NPCs
return handleTying(stack, player, target, targetState);
}
/**
* Handle tying any target entity (Player or NPC).
* Phase 14.2.6: Unified tying system for all IBondageState entities.
*
* Uses progress-based system:
* - update() marks the tick as active
@@ -547,16 +560,17 @@ public abstract class ItemBind
/**
* Get the tying duration in seconds from GameRule.
* Phase 6: Reads from custom GameRule "tyingPlayerTime"
*
* @param player The player (for accessing world/GameRules)
* @return Duration in seconds (default: 5)
*/
private int getTyingDuration(Player player) {
return SettingsAccessor.getTyingPlayerTime(player.level().getGameRules());
return SettingsAccessor.getTyingPlayerTime(
player.level().getGameRules()
);
}
// ========== Phase 7: Resistance System (via IHasResistance) ==========
// ========== Resistance System (via IHasResistance) ==========
/**
* Get the item name for GameRule lookup.
@@ -566,7 +580,7 @@ public abstract class ItemBind
*/
public abstract String getItemName();
// ========== Phase 15: Pose System ==========
// ========== Pose System ==========
/**
* Get the pose type for this bind item.

View File

@@ -1,8 +1,8 @@
package com.tiedup.remake.items.base;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.util.EquipmentInteractionHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
@@ -21,8 +21,6 @@ import org.jetbrains.annotations.Nullable;
*
* Based on original ItemBlindfold from 1.12.2
*
* Phase 1: Basic implementation without rendering effects (added in Phase 5)
* Phase 8.5: Added interactLivingEntity for equipment on tied players
*/
public abstract class ItemBlindfold
extends Item
@@ -75,7 +73,8 @@ public abstract class ItemBlindfold
target,
state -> state.isBlindfolded(),
(state, item) -> state.equip(BodyRegionV2.EYES, item),
(state, item) -> state.replaceEquipment(BodyRegionV2.EYES, item, false),
(state, item) ->
state.replaceEquipment(BodyRegionV2.EYES, item, false),
(p, t) ->
SystemMessageManager.sendToTarget(
p,

View File

@@ -1,14 +1,14 @@
package com.tiedup.remake.items.base;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.network.sync.SyncManager;
import com.tiedup.remake.state.CollarRegistry;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.util.KidnappedHelper;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.util.teleport.Position;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@@ -34,10 +34,6 @@ import org.jetbrains.annotations.Nullable;
*
* Based on original ItemCollar from 1.12.2
*
* Phase 1: Basic implementation
* Phase 8: Add ownership system, locking, and resistance
* Phase 14: Add GPS/shock features for special collars
* Phase 14.1.6: Implements ILockable interface for lock safety
*
* Note: Collars have maxStackSize of 1 (unique items)
*/
@@ -63,7 +59,7 @@ public abstract class ItemCollar
private static final String NBT_BONDAGE_SERVICE = "bondageservice";
private static final String NBT_SERVICE_SENTENCE = "servicesentence";
// NBT Keys - Blacklist/Whitelist (Phase 14.4)
// NBT Keys - Blacklist/Whitelist
private static final String NBT_BLACKLIST = "blacklist";
private static final String NBT_WHITELIST = "whitelist";
@@ -246,15 +242,10 @@ public abstract class ItemCollar
return false;
}
// ========================================
// Phase 8.5: Interactive Equipment
// ========================================
/**
* Called when player right-clicks another entity with this collar.
* Allows putting collar on tied-up entities (Players and NPCs) and adds the player as owner.
*
* Phase 14.1.5: Refactored to support IBondageState (LivingEntity + NPCs)
* Based on original ItemCollar.itemInteractionForEntity()
*
* @param stack The item stack
@@ -286,7 +277,6 @@ public abstract class ItemCollar
return InteractionResult.PASS;
}
// Phase 8: Add player as owner if not already
ItemStack newCollar = stack.copy();
if (!isOwner(newCollar, player)) {
addOwner(newCollar, player);
@@ -297,7 +287,6 @@ public abstract class ItemCollar
targetState.equip(BodyRegionV2.NECK, newCollar);
stack.shrink(1);
// Phase 17: Register in CollarRegistry
registerCollarInRegistry(target, newCollar, player);
// Send screen message to target
@@ -359,12 +348,15 @@ public abstract class ItemCollar
}
// Old collar not locked - replace it
ItemStack replacedCollar = targetState.replaceEquipment(BodyRegionV2.NECK, newCollar, false);
ItemStack replacedCollar = targetState.replaceEquipment(
BodyRegionV2.NECK,
newCollar,
false
);
if (replacedCollar != null) {
stack.shrink(1);
targetState.kidnappedDropItem(replacedCollar);
// Phase 17: Update CollarRegistry (unregister old, register new)
unregisterCollarFromRegistry(target);
registerCollarInRegistry(target, newCollar, player);
@@ -394,10 +386,6 @@ public abstract class ItemCollar
return InteractionResult.PASS;
}
// ========================================
// Phase 8: Ownership System
// ========================================
/**
* Add an owner to this collar.
* Owners are stored as UUID + name pairs in NBT.
@@ -534,10 +522,6 @@ public abstract class ItemCollar
return !getOwners(stack).isEmpty();
}
// ========================================
// Phase 14.4: Blacklist/Whitelist System
// ========================================
/**
* Add a player to this collar's blacklist.
* Blacklisted players will not be targeted when kidnapping mode is active.
@@ -726,15 +710,10 @@ public abstract class ItemCollar
return result;
}
// ========================================
// Phase 8: Locking System
// ========================================
/**
* Check if this collar is locked.
* Locked collars cannot be removed normally.
*
* Phase 14.1.6: Now part of ILockable interface
*
* @param stack The collar ItemStack
* @return true if locked
@@ -751,7 +730,6 @@ public abstract class ItemCollar
/**
* Set the locked state of this collar.
*
* Phase 14.1.6: Changed return type from void to ItemStack (ILockable interface)
*
* @param stack The collar ItemStack
* @param locked true to lock, false to unlock
@@ -771,7 +749,6 @@ public abstract class ItemCollar
* Check if this collar can be locked.
* By default, all collars are lockable.
*
* Phase 14.1.6: Added for ILockable interface
*
* @param stack The collar ItemStack
* @return true if lockable (can accept a padlock)
@@ -793,7 +770,6 @@ public abstract class ItemCollar
/**
* Set whether this collar can be locked (lockable state).
*
* Phase 14.1.6: Added for ILockable interface
*
* @param stack The collar ItemStack
* @param state true to make lockable, false to prevent locking
@@ -812,7 +788,6 @@ public abstract class ItemCollar
* Check if the padlock should be dropped when unlocking.
* Collars have a built-in lock mechanism, so no padlock to drop.
*
* Phase 20: Collars are inherently lockable, no external padlock needed.
*
* @return false (no padlock to drop for collars)
*/
@@ -821,7 +796,7 @@ public abstract class ItemCollar
return false;
}
// ========== Phase 20: Key-Lock System ==========
// ========== Key-Lock System ==========
/**
* Get the UUID of the key that locked this collar.
@@ -859,14 +834,9 @@ public abstract class ItemCollar
}
}
// ========================================
// Phase 8: Resistance System (like ItemBind Phase 7)
// ========================================
/**
* Get the base resistance for this collar from config.
*
* Phase 14.1.5: Refactored to support LivingEntity
* BUG-003 fix: Now reads from SettingsAccessor (config) instead of GameRules
*
* @param entity The entity (kept for API compatibility)
@@ -880,7 +850,6 @@ public abstract class ItemCollar
* Get the current resistance of this collar.
* Returns base resistance if not yet set.
*
* Phase 14.1.5: Refactored to support LivingEntity
*
* @param stack The collar ItemStack
* @param entity The entity (for GameRules lookup)
@@ -929,7 +898,6 @@ public abstract class ItemCollar
/**
* Reset the current resistance to base value.
*
* Phase 14.1.5: Refactored to support LivingEntity
*
* @param stack The collar ItemStack
* @param entity The entity (for GameRules lookup)
@@ -972,9 +940,7 @@ public abstract class ItemCollar
.putBoolean(NBT_CAN_BE_STRUGGLED_OUT, canStruggle);
}
// ========================================
// Cell ID (Assigned Cell)
// ========================================
/**
* Get the assigned cell ID from this collar.
@@ -1025,9 +991,7 @@ public abstract class ItemCollar
return getCellId(stack) != null;
}
// ========================================
// Kidnapping Mode
// ========================================
/**
* Check if kidnapping mode is enabled.
@@ -1075,9 +1039,7 @@ public abstract class ItemCollar
return hasCellAssigned(stack);
}
// ========================================
// Tie to Pole (Auto-tie slave in cell)
// ========================================
/**
* Check if slave should be auto-tied to nearest pole in prison.
@@ -1108,9 +1070,7 @@ public abstract class ItemCollar
stack.getOrCreateTag().putBoolean(NBT_TIE_TO_POLE, enabled);
}
// ========================================
// Warn Masters
// ========================================
/**
* Check if owners should be warned when slave is captured.
@@ -1145,9 +1105,7 @@ public abstract class ItemCollar
stack.getOrCreateTag().putBoolean(NBT_WARN_MASTERS, enabled);
}
// ========================================
// Bondage Service
// ========================================
/**
* Check if bondage service is enabled on this collar.
@@ -1216,10 +1174,6 @@ public abstract class ItemCollar
}
}
// ========================================
// Phase 17: CollarRegistry Integration
// ========================================
/**
* Register a collar in the global CollarRegistry.
* Called when a collar is put on an entity.
@@ -1310,9 +1264,7 @@ public abstract class ItemCollar
);
}
// ========================================
// ESCAPE DETECTION: Collar Removal Alert
// ========================================
/**
* Alert nearby kidnappers when a collar is forcibly removed.
@@ -1418,9 +1370,7 @@ public abstract class ItemCollar
}
}
// ========================================
// LIFECYCLE HOOKS
// ========================================
/**
* Called when a collar is unequipped from an entity.
@@ -1444,9 +1394,7 @@ public abstract class ItemCollar
onCollarRemoved(entity, true);
}
// ========================================
// TEXTURE SUBFOLDER
// ========================================
/**
* Get the texture subfolder for collar items.

View File

@@ -1,9 +1,9 @@
package com.tiedup.remake.items.base;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.util.EquipmentInteractionHelper;
import com.tiedup.remake.util.TiedUpSounds;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
@@ -22,7 +22,6 @@ import org.jetbrains.annotations.Nullable;
*
* Based on original ItemEarplugs from 1.12.2
*
* Phase 8.5: Basic implementation + equipment mechanics
* Phase future: Sound blocking effect
*/
public abstract class ItemEarplugs
@@ -67,7 +66,8 @@ public abstract class ItemEarplugs
target,
state -> state.hasEarplugs(),
(state, item) -> state.equip(BodyRegionV2.EARS, item),
(state, item) -> state.replaceEquipment(BodyRegionV2.EARS, item, false),
(state, item) ->
state.replaceEquipment(BodyRegionV2.EARS, item, false),
(p, t) ->
SystemMessageManager.sendToTarget(
p,

View File

@@ -1,9 +1,9 @@
package com.tiedup.remake.items.base;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.util.EquipmentInteractionHelper;
import com.tiedup.remake.util.GagMaterial;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
@@ -23,9 +23,6 @@ import org.jetbrains.annotations.Nullable;
*
* Based on original ItemGag from 1.12.2
*
* Phase 1: Basic implementation without gag talk or adjustment (added later)
* Phase 8.5: Added interactLivingEntity for equipment on tied players
* Phase 12: Added GagTalk material system
*/
public abstract class ItemGag
extends Item
@@ -85,7 +82,8 @@ public abstract class ItemGag
target,
state -> state.isGagged(),
(state, item) -> state.equip(BodyRegionV2.MOUTH, item),
(state, item) -> state.replaceEquipment(BodyRegionV2.MOUTH, item, false),
(state, item) ->
state.replaceEquipment(BodyRegionV2.MOUTH, item, false),
SystemMessageManager::sendGagged,
"ItemGag"
);

View File

@@ -1,8 +1,8 @@
package com.tiedup.remake.items.base;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.util.EquipmentInteractionHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.LivingEntity;
@@ -14,7 +14,6 @@ import net.minecraft.world.item.ItemStack;
* Base class for mittens items.
* These items block hand interactions (mining, placing, using items) when equipped.
*
* Phase 14.4: Mittens system
*
* Restrictions when wearing mittens:
* - Cannot mine/break blocks
@@ -57,7 +56,8 @@ public abstract class ItemMittens
target,
state -> state.hasMittens(),
(state, item) -> state.equip(BodyRegionV2.HANDS, item),
(state, item) -> state.replaceEquipment(BodyRegionV2.HANDS, item, false),
(state, item) ->
state.replaceEquipment(BodyRegionV2.HANDS, item, false),
(p, t) ->
SystemMessageManager.sendToTarget(
p,

View File

@@ -144,24 +144,32 @@ public abstract class ItemOwnerTarget extends Item {
/**
* Check if a player instance matches the item's current target.
*/
// =====================================================
// TOOLTIP HELPERS
// =====================================================
/**
* Appends the "Owner: ..." or "Unclaimed (...)" tooltip line.
* @param unclaimedHint text shown when unclaimed (e.g. "Right-click a player")
*/
protected void appendOwnerTooltip(ItemStack stack, List<Component> tooltip, String unclaimedHint) {
protected void appendOwnerTooltip(
ItemStack stack,
List<Component> tooltip,
String unclaimedHint
) {
if (hasOwner(stack)) {
tooltip.add(
Component.literal("Owner: ")
.withStyle(ChatFormatting.GOLD)
.append(Component.literal(getOwnerName(stack)).withStyle(ChatFormatting.WHITE))
.append(
Component.literal(getOwnerName(stack)).withStyle(
ChatFormatting.WHITE
)
)
);
} else {
tooltip.add(
Component.literal("Unclaimed (" + unclaimedHint + ")").withStyle(ChatFormatting.GRAY)
Component.literal(
"Unclaimed (" + unclaimedHint + ")"
).withStyle(ChatFormatting.GRAY)
);
}
}
@@ -171,16 +179,30 @@ public abstract class ItemOwnerTarget extends Item {
* the collar nickname if available.
* @return display name, possibly "Nickname (RealName)" if collar has a nickname
*/
protected String resolveTargetDisplayName(ItemStack stack, @Nullable Level level) {
protected String resolveTargetDisplayName(
ItemStack stack,
@Nullable Level level
) {
String displayName = getTargetName(stack);
if (level != null && hasTarget(stack)) {
Player target = level.getPlayerByUUID(getTargetId(stack));
if (target != null) {
IBondageState targetState = KidnappedHelper.getKidnappedState(target);
IBondageState targetState = KidnappedHelper.getKidnappedState(
target
);
if (targetState != null && targetState.hasCollar()) {
ItemStack collar = targetState.getEquipment(BodyRegionV2.NECK);
if (collar.getItem() instanceof ItemCollar collarItem && collarItem.hasNickname(collar)) {
displayName = collarItem.getNickname(collar) + " (" + displayName + ")";
ItemStack collar = targetState.getEquipment(
BodyRegionV2.NECK
);
if (
collar.getItem() instanceof ItemCollar collarItem &&
collarItem.hasNickname(collar)
) {
displayName =
collarItem.getNickname(collar) +
" (" +
displayName +
")";
}
}
}

View File

@@ -4,7 +4,7 @@ package com.tiedup.remake.items.base;
* Enum defining all mittens variants.
* Used by GenericMittens to create mittens items via factory pattern.
*
* <p>Phase 14.4: Mittens system - blocks hand interactions when equipped.
* <p>Mittens system - blocks hand interactions when equipped.
*
* <p><b>Issue #12 fix:</b> Added textureSubfolder to eliminate string checks in renderers.
*/

View File

@@ -5,7 +5,6 @@ package com.tiedup.remake.items.base;
* Each pose type has a corresponding animation file for players
* and pose method in BondagePoseHelper for NPCs.
*
* Phase 15: Pose system for different bind types
*/
public enum PoseType {
/** Standard tied pose - arms behind back, legs frozen */

View File

@@ -138,7 +138,9 @@ public class GenericClothes extends Item implements ILockable, IV2BondageItem {
else {
ItemStack clothesCopy = stack.copyWithCount(1);
ItemStack oldClothes = targetState.replaceEquipment(
BodyRegionV2.TORSO, clothesCopy, false
BodyRegionV2.TORSO,
clothesCopy,
false
);
if (!oldClothes.isEmpty()) {
stack.shrink(1);