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

@@ -26,7 +26,6 @@ import org.jetbrains.annotations.Nullable;
* - "Slave" = Entity wearing a collar owned by a player (passive ownership)
* - "Captive" = Entity attached by leash (active physical control) - managed by PlayerCaptiveManager
*
* Phase 17: Terminology Refactoring
*/
public class CollarRegistry extends SavedData {

View File

@@ -28,10 +28,7 @@ import net.minecraft.world.item.ItemStack;
* @see IRestrainable
*/
public interface IBondageState extends ICapturable {
// ========================================
// V2 REGION-BASED EQUIPMENT ACCESS
// ========================================
/**
* Get the item equipped in a V2 body region.
@@ -75,11 +72,13 @@ public interface IBondageState extends ICapturable {
* @param force If true, replace even if current item is locked
* @return The old ItemStack, or empty if locked (and !force) or nothing equipped
*/
ItemStack replaceEquipment(BodyRegionV2 region, ItemStack newStack, boolean force);
ItemStack replaceEquipment(
BodyRegionV2 region,
ItemStack newStack,
boolean force
);
// ========================================
// STATE QUERIES - BONDAGE EQUIPMENT
// ========================================
/**
* Check if entity has bind/ropes equipped.
@@ -174,7 +173,6 @@ public interface IBondageState extends ICapturable {
/**
* Check if entity has mittens equipped.
* Phase 14.4: Mittens system
* @return true if MITTENS slot is not empty
*/
boolean hasMittens();
@@ -213,9 +211,7 @@ public interface IBondageState extends ICapturable {
*/
boolean hasKnives();
// ========================================
// BULK OPERATIONS
// ========================================
/**
* Apply a full set of bondage equipment at once.
@@ -298,9 +294,7 @@ public interface IBondageState extends ICapturable {
*/
int getBondageItemsWhichCanBeRemovedCount();
// ========================================
// CLOTHES PERMISSION SYSTEM
// ========================================
/**
* Check if a player can remove clothes from this entity.
@@ -326,15 +320,12 @@ public interface IBondageState extends ICapturable {
*/
boolean canChangeClothes();
// ========================================
// POST-APPLY CALLBACKS
// ========================================
/**
* Called after a bind is applied.
* Implementations can trigger additional effects (sounds, particles, etc.).
*
* Phase 14.1.7: Added missing callback (was documented but not defined)
*/
default void checkBindAfterApply() {
// Default: no-op
@@ -373,16 +364,13 @@ public interface IBondageState extends ICapturable {
/**
* Called after mittens are applied.
* Phase 14.4: Mittens system
*/
default void checkMittensAfterApply() {
// Default: no-op
// NPCs don't need post-apply logic by default
}
// ========================================
// LOCK SAFETY HELPERS
// ========================================
/**
* Execute a runnable only if the item is unlocked.
@@ -478,7 +466,10 @@ public interface IBondageState extends ICapturable {
) {
if (stack.isEmpty()) return;
// Locked ILockable items cannot be removed
if (stack.getItem() instanceof ILockable lockable && lockable.isLocked(stack)) return;
if (
stack.getItem() instanceof ILockable lockable &&
lockable.isLocked(stack)
) return;
// Non-ILockable items or unlocked items: remove and drop
ItemStack removed = takeOff.get();
if (!removed.isEmpty()) {
@@ -486,9 +477,7 @@ public interface IBondageState extends ICapturable {
}
}
// ========================================
// RESISTANCE SYSTEM (Phase 14.1.7)
// ========================================
// RESISTANCE SYSTEM
/**
* Get current bind resistance value.
@@ -501,7 +490,6 @@ public interface IBondageState extends ICapturable {
* <p><b>For Players:</b> Stored in NBT, persists across sessions
* <p><b>For NPCs:</b> Default returns 0 (instant escape, can be overridden)
*
* Phase 14.1.7: Added to enable struggle system for NPCs
*
* @return Current resistance value (0 = can escape)
*/
@@ -517,7 +505,6 @@ public interface IBondageState extends ICapturable {
* <p><b>For Players:</b> Updates NBT storage
* <p><b>For NPCs:</b> Default no-op (no persistent resistance)
*
* Phase 14.1.7: Added to enable struggle system for NPCs
*
* @param resistance New resistance value
*/
@@ -531,7 +518,6 @@ public interface IBondageState extends ICapturable {
*
* <p>Same as bind resistance but for collars.
*
* Phase 14.1.7: Added for collar struggle system
*
* @return Current collar resistance value
*/
@@ -543,7 +529,6 @@ public interface IBondageState extends ICapturable {
/**
* Set current collar resistance.
*
* Phase 14.1.7: Added for collar struggle system
*
* @param resistance New resistance value
*/

View File

@@ -3,40 +3,33 @@ package com.tiedup.remake.state;
import net.minecraft.world.entity.Entity;
/**
* Phase 8: Master-Captive Relationships
* Phase 14.1.6: Refactored to use IRestrainable for NPC capture support
* Phase 17: Terminology refactoring - slave → captive
* C6-V2: Narrowed parameters from IRestrainable to IBondageState (minimum needed type)
*
* Interface for entities that can capture other entities (players or NPCs).
*
* Terminology (Phase 17):
* Terminology:
* - "Captive" = Entity attached by leash (active physical control)
* - "Slave" = Entity wearing a collar owned by someone (passive ownership via CollarRegistry)
*
* Design Pattern:
* - Interface-based design allows both players (PlayerCaptorManager)
* and NPCs (EntityKidnapper - Phase 14.2+) to act as captors
* and NPCs (EntityKidnapper) to act as captors
* - Separates concerns: ICaptor manages captives, IBondageState is managed
*
* Implementation:
* - PlayerCaptorManager: For player captors (Phase 8)
* - EntityKidnapper: For NPC captors (Phase 14.2+)
* - PlayerCaptorManager: For player captors
* - EntityKidnapper: For NPC captors
*
* @see IBondageState
* @see PlayerCaptorManager
*/
public interface ICaptor {
// ========================================
// Captive Management
// ========================================
/**
* Add a captive to this captor's captive list.
* Called when capture succeeds.
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from addSlave to addCaptive
* C6-V2: Narrowed from IRestrainable to IBondageState
*
* @param captive The IBondageState entity to capture
@@ -47,8 +40,6 @@ public interface ICaptor {
* Remove a captive from this captor's captive list.
* Called when freeing a captive or when captive escapes.
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from removeSlave to removeCaptive
* C6-V2: Narrowed from IRestrainable to IBondageState
*
* @param captive The IBondageState captive to remove
@@ -63,8 +54,6 @@ public interface ICaptor {
* - Target must be tied up OR have collar with this captor as owner
* - Target must not already be captured
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from canEnslave to canCapture
* C6-V2: Narrowed from IRestrainable to IBondageState
*
* @param target The potential IBondageState captive
@@ -76,8 +65,6 @@ public interface ICaptor {
* Check if this captor can release the given captive.
* Only the current captor can release their captive.
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from canFree to canRelease
* C6-V2: Narrowed from IRestrainable to IBondageState
*
* @param captive The IBondageState captive to check
@@ -85,14 +72,11 @@ public interface ICaptor {
*/
boolean canRelease(IBondageState captive);
// ========================================
// Configuration
// ========================================
/**
* Whether this captor allows captives to be transferred to other captors.
*
* Phase 17: Renamed from allowSlaveTransfer to allowCaptiveTransfer
*
* @return true if captive transfer is allowed (default for players)
*/
@@ -101,22 +85,17 @@ public interface ICaptor {
/**
* Whether this captor can have multiple captives simultaneously.
*
* Phase 17: Renamed from allowMultipleSlaves to allowMultipleCaptives
*
* @return true if multiple captives allowed (default for players)
*/
boolean allowMultipleCaptives();
// ========================================
// Event Callbacks
// ========================================
/**
* Called when a captive logs out while captured.
* Allows the captor to handle cleanup or persistence.
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from onSlaveLogout to onCaptiveLogout
* C6-V2: Narrowed from IRestrainable to IBondageState
* Note: For NPC captives, this may never be called (NPCs don't log out)
*
@@ -128,8 +107,6 @@ public interface ICaptor {
* Called when a captive is released (freed).
* Allows the captor to react to losing a captive.
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from onSlaveReleased to onCaptiveReleased
* C6-V2: Narrowed from IRestrainable to IBondageState
*
* @param captive The IBondageState captive that was released
@@ -140,22 +117,17 @@ public interface ICaptor {
* Called when a captive attempts to struggle.
* Allows the captor to react (e.g., shock collar activation).
*
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
* Phase 17: Renamed from onSlaveStruggle to onCaptiveStruggle
* C6-V2: Narrowed from IRestrainable to IBondageState
*
* @param captive The IBondageState captive that struggled
*/
void onCaptiveStruggle(IBondageState captive);
// ========================================
// Queries
// ========================================
/**
* Check if this captor currently has any captives.
*
* Phase 17: Renamed from hasSlaves to hasCaptives
*
* @return true if captive list is not empty
*/

View File

@@ -1,7 +1,7 @@
package com.tiedup.remake.state;
import org.jetbrains.annotations.Nullable;
import net.minecraft.world.entity.Entity;
import org.jetbrains.annotations.Nullable;
/**
* Capture, leash, and transport interface for kidnapped entities.
@@ -14,10 +14,7 @@ import net.minecraft.world.entity.Entity;
* @see IRestrainable
*/
public interface ICapturable extends IRestrainableEntity {
// ========================================
// CAPTURE LIFECYCLE
// ========================================
/**
* Capture this entity by the given captor.
@@ -44,7 +41,6 @@ public interface ICapturable extends IRestrainableEntity {
* <li>Use vanilla setLeashedTo() directly on the NPC</li>
* </ol>
*
* Phase 17: Renamed from getEnslavedBy to getCapturedBy
*
* @param captor The captor attempting to capture
* @return true if capture succeeded, false otherwise
@@ -78,15 +74,12 @@ public interface ICapturable extends IRestrainableEntity {
* <p>Only works if current captor allows captive transfer
* ({@link ICaptor#allowCaptiveTransfer()} == true).</p>
*
* Phase 17: Renamed from transferSlaveryTo to transferCaptivityTo
*
* @param newCaptor The new captor to transfer to
*/
void transferCaptivityTo(ICaptor newCaptor);
// ========================================
// STATE QUERIES - CAPTURE
// ========================================
/**
* Check if this entity can be captured.
@@ -107,7 +100,6 @@ public interface ICapturable extends IRestrainableEntity {
* <p><b>For Players:</b> Returns true when LeashProxyEntity is attached and leashed to captor</p>
* <p><b>For NPCs:</b> Returns true when vanilla leash is attached</p>
*
* Phase 17: Renamed from isSlave to isCaptive
*
* @return true if captured (has leash holder)
*/
@@ -147,7 +139,6 @@ public interface ICapturable extends IRestrainableEntity {
/**
* Get the current captor (the entity holding the leash).
*
* Phase 17: Renamed from getMaster to getCaptor
*
* @return The captor, or null if not captured
*/

View File

@@ -13,10 +13,7 @@ import net.minecraft.world.entity.player.Player;
*/
// C6-V2: takeBondageItemBy narrowed from IRestrainable to IRestrainableEntity
public interface ICoercible extends IRestrainableEntity {
// ========================================
// SPECIAL INTERACTIONS
// ========================================
/**
* Tighten binds on this entity (increase resistance).
@@ -72,7 +69,6 @@ public interface ICoercible extends IRestrainableEntity {
* Another entity takes a bondage item from this entity.
* Used when master removes items from slave.
*
* Phase 14.1.7: Changed from PlayerBindState to IRestrainable for polymorphism
* C6-V2: Narrowed from IRestrainable to IRestrainableEntity (only uses identity methods)
* This allows NPCs to take items from Players or other NPCs
*
@@ -81,9 +77,7 @@ public interface ICoercible extends IRestrainableEntity {
*/
void takeBondageItemBy(IRestrainableEntity taker, int slotIndex);
// ========================================
// COLLAR TIMERS (Phase 14.1.4)
// ========================================
// COLLAR TIMERS
/**
* Force-stops and clears any active auto-shock collar timer.

View File

@@ -1,7 +1,7 @@
package com.tiedup.remake.state;
import java.util.UUID;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.UUID;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
@@ -24,10 +24,7 @@ import net.minecraft.world.level.Level;
* @see IRestrainable
*/
public interface IRestrainableEntity {
// ========================================
// ENTITY IDENTITY
// ========================================
/**
* Get the underlying LivingEntity.
@@ -62,9 +59,7 @@ public interface IRestrainableEntity {
*/
String getNameFromCollar();
// ========================================
// LIFECYCLE
// ========================================
/**
* Called when this entity dies while kidnapped.
@@ -82,9 +77,7 @@ public interface IRestrainableEntity {
*/
boolean onDeathKidnapped(Level world);
// ========================================
// UTILITY
// ========================================
/**
* Drop an item at this entity's position.
@@ -102,9 +95,7 @@ public interface IRestrainableEntity {
*/
void teleportToPosition(com.tiedup.remake.util.teleport.Position position);
// ========================================
// DEFAULT HELPER METHODS - COMMUNICATION & STATE
// ========================================
/**
* Send a message to this entity (if it can receive messages).
@@ -158,50 +149,77 @@ public interface IRestrainableEntity {
* Get all V2 equipped items (de-duplicated).
* @return Unmodifiable map of region to ItemStack, or empty map if no V2 support.
*/
default java.util.Map<com.tiedup.remake.v2.BodyRegionV2, ItemStack> getAllEquippedV2() {
default java.util.Map<
com.tiedup.remake.v2.BodyRegionV2,
ItemStack
> getAllEquippedV2() {
com.tiedup.remake.v2.bondage.IV2BondageEquipment equip =
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getEquipment(asLivingEntity());
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getEquipment(
asLivingEntity()
);
return equip != null ? equip.getAllEquipped() : java.util.Map.of();
}
/**
* Get V2 item in a specific body region.
*/
default ItemStack getItemInRegion(com.tiedup.remake.v2.BodyRegionV2 region) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
.getInRegion(asLivingEntity(), region);
default ItemStack getItemInRegion(
com.tiedup.remake.v2.BodyRegionV2 region
) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getInRegion(
asLivingEntity(),
region
);
}
/**
* Equip a V2 item to its declared regions. Server-only.
* @return The equip result.
*/
default com.tiedup.remake.v2.bondage.V2EquipResult equipToRegion(ItemStack stack) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
.equipItem(asLivingEntity(), stack);
default com.tiedup.remake.v2.bondage.V2EquipResult equipToRegion(
ItemStack stack
) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.equipItem(
asLivingEntity(),
stack
);
}
/**
* Unequip V2 item from a region. Server-only.
*/
default ItemStack unequipFromRegion(com.tiedup.remake.v2.BodyRegionV2 region) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
.unequipFromRegion(asLivingEntity(), region);
default ItemStack unequipFromRegion(
com.tiedup.remake.v2.BodyRegionV2 region
) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.unequipFromRegion(
asLivingEntity(),
region
);
}
/**
* Unequip V2 item from a region with force option. Server-only.
*/
default ItemStack unequipFromRegion(com.tiedup.remake.v2.BodyRegionV2 region, boolean force) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
.unequipFromRegion(asLivingEntity(), region, force);
default ItemStack unequipFromRegion(
com.tiedup.remake.v2.BodyRegionV2 region,
boolean force
) {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.unequipFromRegion(
asLivingEntity(),
region,
force
);
}
/**
* Whether this entity has V2 equipment support.
*/
default boolean hasV2Support() {
return com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
.getEquipment(asLivingEntity()) != null;
return (
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getEquipment(
asLivingEntity()
) !=
null
);
}
}

View File

@@ -9,7 +9,6 @@ import org.jetbrains.annotations.Nullable;
* @see IRestrainable
*/
public interface ISaleable {
/**
* Check if this entity is marked for sale by a captor.
*

View File

@@ -46,13 +46,13 @@ import org.jetbrains.annotations.Nullable;
* - Track player restraint states (tied, gagged, blindfolded, etc.)
* - Manage bondage equipment lifecycle (put on/take off items)
* - Lifecycle management (connection, death, respawn)
* - Phase 8: Enslavement lifecycle (can be enslaved, act as master)
* - Phase 13: Advanced collar features (shocks, GPS tracking)
* - Enslavement lifecycle (can be enslaved, act as master)
* - Advanced collar features (shocks, GPS tracking)
*
* Thread Safety: This class is accessed from both server and client threads.
* Use appropriate synchronization when accessing the instances map.
*
* Refactoring: Component-Host pattern (Phase 1 in progress)
* Refactoring: Component-Host pattern
*/
public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
@@ -69,7 +69,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
/**
* Get or create a PlayerBindState instance for a player.
* Phase 15: Updates player reference when entity is recreated (e.g., after observer reconnects).
*
* @param player The player entity
* @return The state instance associated with this player
@@ -85,7 +84,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
new PlayerBindState(player)
);
// Phase 15: Update player reference if entity was recreated (reconnection scenario)
// This fixes the bug where remote players' animations don't appear after observer reconnects
if (state.player != player) {
state.player = player;
@@ -106,9 +104,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
* Cleans up the instance map when a player leaves the server.
*/
public static void removeInstance(UUID uuid, boolean isClient) {
Map<UUID, PlayerBindState> map = isClient
? instancesClient
: instances;
Map<UUID, PlayerBindState> map = isClient ? instancesClient : instances;
map.remove(uuid);
}
@@ -119,27 +115,25 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
private volatile Player player;
private boolean online;
// ========== Phase 1 Components ==========
// ========== Core Components ==========
private final PlayerTaskManagement taskManagement;
private final PlayerStateQuery stateQuery;
private final PlayerDataRetrieval dataRetrieval;
private final PlayerSale sale;
// ========== Phase 2 Components ==========
// ========== Struggle Components ==========
private final PlayerSpecialActions specialActions;
private final PlayerClothesPermission clothesPermission;
// ========== Phase 3 Components ==========
// ========== Animation Components ==========
private final PlayerEquipment equipment;
private final PlayerStruggle struggle;
private final PlayerShockCollar shockCollar;
// ========== Phase 4 Components ==========
// ========== Captivity Components ==========
private final PlayerLifecycle lifecycle;
private final PlayerCaptivity captivity;
// Phase 8: Enslavement fields
// Phase 17: master → captor, slaveHolderManager → captorManager
private ICaptor captor;
private PlayerCaptorManager captorManager;
// Note: transport field removed - now using IPlayerLeashAccess mixin
@@ -168,7 +162,9 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return activeMovementStyle;
}
public void setActiveMovementStyle(@Nullable com.tiedup.remake.v2.bondage.movement.MovementStyle style) {
public void setActiveMovementStyle(
@Nullable com.tiedup.remake.v2.bondage.movement.MovementStyle style
) {
this.activeMovementStyle = style;
}
@@ -234,26 +230,25 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
this.player = player;
this.online = true;
// Initialize Phase 1 components
// Initialize core components
this.taskManagement = new PlayerTaskManagement();
this.stateQuery = new PlayerStateQuery(this);
this.dataRetrieval = new PlayerDataRetrieval(this);
this.sale = new PlayerSale();
// Initialize Phase 2 components
// Initialize struggle components
this.specialActions = new PlayerSpecialActions(this);
this.clothesPermission = new PlayerClothesPermission(this);
// Initialize Phase 3 components
// Initialize animation components
this.equipment = new PlayerEquipment(this);
this.struggle = new PlayerStruggle(this);
this.shockCollar = new PlayerShockCollar(this);
// Initialize Phase 4 components
// Initialize captivity components
this.lifecycle = new PlayerLifecycle(this);
this.captivity = new PlayerCaptivity(this);
// Phase 17: Enslavement and captive management
this.captor = null;
this.captorManager = new PlayerCaptorManager(player);
}
@@ -301,7 +296,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return stateQuery.hasClothes();
}
/** Check if player has mittens equipped. Phase 14.4: Mittens system */
/** Check if player has mittens equipped. Mittens system */
public boolean hasMittens() {
return stateQuery.hasMittens();
}
@@ -334,7 +329,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
equipment.putClothesOn(clothes);
}
/** Equips mittens (blocks hand interactions). Phase 14.4: Mittens system. Issue #14 fix: now calls onEquipped. */
/** Equips mittens (blocks hand interactions). Mittens system. Issue #14 fix: now calls onEquipped. */
public void putMittensOn(ItemStack mittens) {
equipment.putMittensOn(mittens);
}
@@ -352,7 +347,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return equipment.takeBlindfoldOff();
}
/** Removes mittens. Phase 14.4: Mittens system */
/** Removes mittens. Mittens system */
public ItemStack takeMittensOff() {
return equipment.takeMittensOff();
}
@@ -446,7 +441,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
// Note: getCaptor(), getCaptorManager(), setStruggling(), setStrugglingClient(),
// isStruggling(), getStruggleStartTick() are implemented elsewhere in the class
// ========== Phase 6: Tying/Untying Task Methods ==========
// ========== Tying/Untying Task Methods ==========
// Delegated to PlayerTaskManagement component
public TyingTask getCurrentTyingTask() {
@@ -505,7 +500,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
taskManagement.setRestrainedState(state);
}
// ========== Phase 7: Struggle & Resistance Methods ==========
// ========== Struggle & Resistance Methods ==========
// Delegated to PlayerStruggle component
/**
@@ -637,7 +632,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 14.1.7: Now part of IRestrainable interface
* Delegated to PlayerEquipment component
*/
@Override
@@ -646,7 +640,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 14.1.7: Now part of IRestrainable interface
* Delegated to PlayerEquipment component
*/
@Override
@@ -655,7 +648,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 14.1.7: Added for IRestrainable interface
* Delegated to PlayerEquipment component
*/
@Override
@@ -664,7 +656,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 14.1.7: Added for IRestrainable interface
* Delegated to PlayerEquipment component
*/
@Override
@@ -672,12 +663,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
equipment.setCurrentCollarResistance(resistance);
}
// ========================================
// Phase 8: IRestrainable Implementation
// ========================================
/**
* Phase 17: Renamed from getEnslavedBy to getCapturedBy
* Initiates the capture process by a captor.
* Uses the proxy-based leash system (player is NOT mounted).
* Delegated to PlayerCaptivity component.
@@ -692,7 +678,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
captivity.free();
}
/** Phase 17: Ends captivity and detaches the leash proxy.
/** Ends captivity and detaches the leash proxy.
* Delegated to PlayerCaptivity component. */
@Override
public void free(boolean dropLead) {
@@ -700,7 +686,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 17: Renamed from transferSlaveryTo to transferCaptivityTo
* Delegated to PlayerCaptivity component.
*/
@Override
@@ -714,7 +699,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 17: Renamed from isSlave to isCaptive
* Delegated to PlayerCaptivity component.
*/
@Override
@@ -723,7 +707,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 17: Renamed from getMaster to getCaptor
* Also implements IPlayerBindStateHost.
*/
@Override
@@ -769,10 +752,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return player.getName().getString();
}
// ========================================
// Phase 13: Shock Functionality
// Delegated to PlayerShockCollar component
// ========================================
@Override
public void shockKidnapped() {
@@ -789,7 +769,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 17: Renamed from checkStillSlave to checkStillCaptive
* Periodically monitors captivity validity.
* Simplified: If any condition is invalid, free the captive immediately.
* Delegated to PlayerCaptivity component.
@@ -816,7 +795,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 17: Renamed from getSlaveHolderManager to getCaptorManager
* Manager for capturing other entities (acting as captor).
* Also implements IPlayerBindStateHost.
*/
@@ -825,9 +803,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return captorManager;
}
// ========================================
// IRestrainable Missing Methods
// ========================================
@Override
public void teleportToPosition(Position position) {
@@ -872,9 +848,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return dataRetrieval.getNameFromCollar();
}
// ========================================
// V2 Region-Based Equipment Access
// ========================================
@Override
public ItemStack getEquipment(BodyRegionV2 region) {
@@ -891,7 +865,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
case NECK -> equipment.putCollarOn(stack);
case TORSO -> equipment.putClothesOn(stack);
case HANDS -> equipment.putMittensOn(stack);
default -> {}
default -> {
}
}
}
@@ -923,10 +898,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return V2EquipmentHelper.unequipFromRegion(player, region, true);
}
// ========================================
// IRestrainable State Queries
// Delegated to PlayerStateQuery component
// ========================================
@Override
public boolean canBeTiedUp() {
@@ -943,9 +916,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return stateQuery.hasKnives();
}
// ========================================
// Sale System - Delegated to PlayerSale component
// ========================================
@Override
public boolean isForSell() {
@@ -1012,10 +983,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return stateQuery.hasBlindingEffect();
}
// ========================================
// Equipment Take Off (local helpers)
// Delegated to PlayerEquipment component
// ========================================
public ItemStack takeEarplugsOff() {
return equipment.takeEarplugsOff();
@@ -1025,23 +994,23 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return equipment.takeClothesOff();
}
// ========================================
// IRestrainable Equipment Put On
// Delegated to PlayerEquipment component
// ========================================
/** Equips earplugs (muffles sounds). Issue #14 fix: now calls onEquipped. */
public void putEarplugsOn(ItemStack earplugs) {
equipment.putEarplugsOn(earplugs);
}
// ========================================
// IRestrainable Equipment Replacement (V2 region-based)
// Delegated to PlayerEquipment component (except TORSO - handled by PlayerClothesPermission)
// ========================================
@Override
public synchronized ItemStack replaceEquipment(BodyRegionV2 region, ItemStack newStack, boolean force) {
public synchronized ItemStack replaceEquipment(
BodyRegionV2 region,
ItemStack newStack,
boolean force
) {
// MEDIUM FIX: Synchronized to prevent race condition during equipment replacement
return switch (region) {
case ARMS -> equipment.replaceBind(newStack, force);
@@ -1055,9 +1024,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
};
}
// ========================================
// IRestrainable Bulk Operations
// ========================================
@Override
public void untie(boolean drop) {
@@ -1075,7 +1042,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
// V1 speed reduction handled by MovementStyleManager (V2 tick-based).
// See H6 fix — removing V1 calls prevents double stacking.
// Phase 17: Free from captivity if applicable
if (isCaptive()) {
free();
}
@@ -1173,10 +1139,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return count;
}
// ========================================
// IRestrainable Callbacks
// Delegated to PlayerEquipment component
// ========================================
@Override
public void checkGagAfterApply() {
@@ -1198,10 +1162,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
equipment.checkCollarAfterApply();
}
// ========================================
// IRestrainable Special Interactions
// Delegated to PlayerSpecialActions component
// ========================================
@Override
public void applyChloroform(int duration) {
@@ -1209,7 +1171,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
}
/**
* Phase 14.1.7: Updated to use IRestrainable parameter (was PlayerBindState)
* C6-V2: Narrowed to IRestrainableEntity
*/
@Override
@@ -1217,10 +1178,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
specialActions.takeBondageItemBy(taker, slotIndex);
}
// ========================================
// IRestrainable Clothes Permissions
// Delegated to PlayerClothesPermission component
// ========================================
@Override
public boolean canTakeOffClothes(Player player) {
@@ -1237,9 +1196,7 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return clothesPermission.canChangeClothes();
}
// ========================================
// IRestrainable Lifecycle
// ========================================
@Override
public boolean onDeathKidnapped(net.minecraft.world.level.Level world) {
@@ -1262,7 +1219,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
// Drop all items
dropBondageItems(true);
// Phase 17: Free from captivity
if (isCaptive()) {
free();
}
@@ -1271,10 +1227,8 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return lifecycle.onDeathKidnapped(world);
}
// ========================================
// IRestrainable Entity Communication (Phase 14.1.3)
// IRestrainable Entity Communication
// Delegated to PlayerDataRetrieval component
// ========================================
@Override
public net.minecraft.world.entity.LivingEntity asLivingEntity() {

View File

@@ -1,23 +1,22 @@
package com.tiedup.remake.state;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.items.base.ItemCollar;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
// C6-V2: IRestrainable → IBondageState (narrowed API)
/**
* Phase 8: Master-Captive Relationships
* Phase 17: Renamed from PlayerKidnapperManager, terminology slave → captive
*
* Manages capture relationships for player captors.
*
* Terminology (Phase 17):
* Terminology:
* - "Captive" = Entity attached by leash (active physical control)
* - "Slave" = Entity wearing a collar owned by someone (passive ownership via CollarRegistry)
*
@@ -50,8 +49,6 @@ public class PlayerCaptorManager implements ICaptor {
* List of all captives currently owned by this captor.
* Thread-safe to avoid concurrent modification during iteration.
*
* Phase 14.1.6: Changed from List<PlayerBindState> to List<IBondageState>
* Phase 17: Renamed from slaves to captives
*/
private final List<IBondageState> captives;
@@ -65,13 +62,9 @@ public class PlayerCaptorManager implements ICaptor {
this.captives = new CopyOnWriteArrayList<>();
}
// ========================================
// ICaptor Implementation
// ========================================
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from addSlave to addCaptive
*/
@Override
public synchronized void addCaptive(IBondageState captive) {
@@ -94,8 +87,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from removeSlave to removeCaptive
*
* Thread Safety: Synchronized on 'this' to match addCaptive and freeAllCaptives.
*/
@@ -127,8 +118,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from canEnslave to canCapture
*/
@Override
public boolean canCapture(IBondageState target) {
@@ -141,7 +130,6 @@ public class PlayerCaptorManager implements ICaptor {
// - Target is tied up, OR
// - Target has collar AND collar has this captor as owner
// Phase 14.1.6: Use asLivingEntity() instead of getPlayer()
net.minecraft.world.entity.LivingEntity targetEntity =
target.asLivingEntity();
if (targetEntity == null) {
@@ -169,8 +157,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from canFree to canRelease
*/
@Override
public boolean canRelease(IBondageState captive) {
@@ -183,7 +169,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 17: Renamed from allowSlaveTransfer to allowCaptiveTransfer
*/
@Override
public boolean allowCaptiveTransfer() {
@@ -192,7 +177,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 17: Renamed from allowMultipleSlaves to allowMultipleCaptives
*/
@Override
public boolean allowMultipleCaptives() {
@@ -201,8 +185,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from onSlaveLogout to onCaptiveLogout
* Note: For NPC captives, this is never called (NPCs don't log out)
*/
@Override
@@ -223,8 +205,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from onSlaveReleased to onCaptiveReleased
*/
@Override
public void onCaptiveReleased(IBondageState captive) {
@@ -242,8 +222,6 @@ public class PlayerCaptorManager implements ICaptor {
}
/**
* Phase 14.1.6: Changed parameter from PlayerBindState to IBondageState
* Phase 17: Renamed from onSlaveStruggle to onCaptiveStruggle
*/
@Override
public void onCaptiveStruggle(IBondageState captive) {
@@ -256,13 +234,9 @@ public class PlayerCaptorManager implements ICaptor {
captive.getKidnappedName(),
captor.getName().getString()
);
// Phase 8: No action for basic struggle
// Phase 14: Shock collar would activate here
}
/**
* Phase 17: Renamed from hasSlaves to hasCaptives
*/
@Override
public boolean hasCaptives() {
@@ -274,14 +248,11 @@ public class PlayerCaptorManager implements ICaptor {
return captor;
}
// ========================================
// Additional Methods
// ========================================
/**
* Frees all captives currently owned by this captor.
*
* Phase 17: Renamed from freeAllSlaves to freeAllCaptives
*
* Thread Safety: Synchronized on 'this' to match addCaptive and removeCaptive.
*
@@ -307,7 +278,6 @@ public class PlayerCaptorManager implements ICaptor {
* Get a copy of the captive list.
* Safe for iteration without concurrent modification issues.
*
* Phase 17: Renamed from getSlaves to getCaptives
*
* @return Copy of the current captive list
*/
@@ -318,7 +288,6 @@ public class PlayerCaptorManager implements ICaptor {
/**
* Get the number of captives currently owned.
*
* Phase 17: Renamed from getSlaveCount to getCaptiveCount
*
* @return Captive count
*/
@@ -334,7 +303,6 @@ public class PlayerCaptorManager implements ICaptor {
* - When a player gets captured, their captives transfer to new captor
* - Prevents circular capture issues
*
* Phase 17: Renamed from transferAllSlavesTo to transferAllCaptivesTo
*
* @param newCaptor The new captor to transfer captives to
*/
@@ -389,7 +357,6 @@ public class PlayerCaptorManager implements ICaptor {
* Clean up invalid captives from the list.
* Removes captives that are no longer valid (offline, transport gone, etc.).
*
* Phase 17: Renamed from cleanupInvalidSlaves to cleanupInvalidCaptives
*
* Should be called periodically (e.g., on tick).
*/
@@ -421,7 +388,5 @@ public class PlayerCaptorManager implements ICaptor {
});
}
// ========================================
// Backward Compatibility (Phase 17)
// ========================================
// Backward Compatibility
}

View File

@@ -15,7 +15,6 @@ import net.minecraft.world.level.saveddata.SavedData;
* - Block lists (which players have blocked which other players)
* - Talk area settings (local chat distance per player)
*
* Phase 18: Social Commands persistence.
*/
public class SocialData extends SavedData {

View File

@@ -2,15 +2,14 @@ package com.tiedup.remake.state.components;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.LeashProxyEntity;
import com.tiedup.remake.state.IPlayerLeashAccess;
import com.tiedup.remake.state.ICaptor;
import com.tiedup.remake.state.IPlayerLeashAccess;
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.Nullable;
/**
* Component responsible for captivity mechanics and leash proxy management.
* Phase 17: Advanced capture system (proxy-based leashing)
*
* Single Responsibility: Captivity lifecycle and transport management
* Complexity: VERY HIGH (mixin coupling, network sync, leash proxy coordination)
@@ -35,7 +34,6 @@ public class PlayerCaptivity {
// ========== Captivity Initiation ==========
/**
* Phase 17: Renamed from getEnslavedBy to getCapturedBy
* Initiates the capture process by a captor.
* Uses the proxy-based leash system (player is NOT mounted).
*
@@ -101,7 +99,6 @@ public class PlayerCaptivity {
}
/**
* Phase 17: Ends captivity and detaches the leash proxy.
*
* @param dropLead Whether to drop the leash item
*/
@@ -159,7 +156,6 @@ public class PlayerCaptivity {
// ========== Captivity Transfer ==========
/**
* Phase 17: Renamed from transferSlaveryTo to transferCaptivityTo
* Transfers captivity from current captor to a new captor.
*
* Thread Safety: Synchronized to prevent concurrent transfer attempts.
@@ -206,7 +202,6 @@ public class PlayerCaptivity {
}
/**
* Phase 17: Renamed from isSlave to isCaptive
* Check if player is currently captured by an entity.
*
* @return true if player has a captor and is leashed
@@ -222,7 +217,6 @@ public class PlayerCaptivity {
/**
* Get the leash proxy entity (transport system).
* Phase 17: Proxy-based leashing (no mounting).
*
* @return The leash proxy, or null if not leashed
*/
@@ -238,7 +232,6 @@ public class PlayerCaptivity {
// ========== Captivity Monitoring ==========
/**
* Phase 17: Renamed from checkStillSlave to checkStillCaptive
* Periodically monitors captivity validity.
* Simplified: If any condition is invalid, free the captive immediately.
*

View File

@@ -1,9 +1,9 @@
package com.tiedup.remake.state.components;
import com.tiedup.remake.v2.bondage.IV2BondageItem;
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.v2.bondage.IV2BondageEquipment;
import com.tiedup.remake.v2.bondage.IV2BondageItem;
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
@@ -63,7 +63,10 @@ public class PlayerClothesPermission {
* @return true if clothes can be changed
*/
public boolean canChangeClothes() {
ItemStack clothes = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.TORSO);
ItemStack clothes = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.TORSO
);
if (clothes.isEmpty()) return true;
// Check if clothes are locked
@@ -95,20 +98,28 @@ public class PlayerClothesPermission {
*/
public ItemStack replaceClothes(ItemStack newClothes, boolean force) {
Player player = host.getPlayer();
if (player == null || player.level().isClientSide) return ItemStack.EMPTY;
if (
player == null || player.level().isClientSide
) return ItemStack.EMPTY;
IV2BondageEquipment equip = V2EquipmentHelper.getEquipment(player);
if (equip == null) return ItemStack.EMPTY;
// Take off old clothes
ItemStack old = V2EquipmentHelper.unequipFromRegion(player, BodyRegionV2.TORSO);
ItemStack old = V2EquipmentHelper.unequipFromRegion(
player,
BodyRegionV2.TORSO
);
// Equip new clothes if we successfully removed old ones
if (!old.isEmpty()) {
equip.setInRegion(BodyRegionV2.TORSO, newClothes.copy());
// Fire lifecycle hook for new item
if (!newClothes.isEmpty() && newClothes.getItem() instanceof IV2BondageItem newItem) {
if (
!newClothes.isEmpty() &&
newClothes.getItem() instanceof IV2BondageItem newItem
) {
newItem.onEquipped(newClothes, player);
}

View File

@@ -29,31 +29,52 @@ public class PlayerDataRetrieval {
// ========== Equipment Getters ==========
public ItemStack getCurrentBind() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.ARMS);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.ARMS
);
}
public ItemStack getCurrentGag() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.MOUTH);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.MOUTH
);
}
public ItemStack getCurrentBlindfold() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EYES);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EYES
);
}
public ItemStack getCurrentEarplugs() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EARS);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EARS
);
}
public ItemStack getCurrentClothes() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.TORSO);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.TORSO
);
}
public ItemStack getCurrentMittens() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.HANDS);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.HANDS
);
}
public ItemStack getCurrentCollar() {
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.NECK);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.NECK
);
}
// ========== Player Information ==========
@@ -97,7 +118,6 @@ public class PlayerDataRetrieval {
/**
* Check if player has clothes with small arms flag.
* TODO Phase 14+: Check clothes NBT for small arms flag
*/
public boolean hasClothesWithSmallArms() {
return false;

View File

@@ -1,12 +1,12 @@
package com.tiedup.remake.state.components;
import com.tiedup.remake.v2.bondage.IV2BondageItem;
import com.tiedup.remake.items.base.ILockable;
import com.tiedup.remake.items.base.ItemBind;
import com.tiedup.remake.items.base.ItemCollar;
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.v2.bondage.IV2BondageEquipment;
import com.tiedup.remake.v2.bondage.IV2BondageItem;
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
import java.util.function.Supplier;
import net.minecraft.world.entity.player.Player;
@@ -61,7 +61,7 @@ public class PlayerEquipment {
host.syncClothesConfig();
}
/** Equips mittens (blocks hand interactions). Phase 14.4: Mittens system. Issue #14 fix: now calls onEquipped. */
/** Equips mittens (blocks hand interactions). Mittens system. Issue #14 fix: now calls onEquipped. */
public void putMittensOn(ItemStack mittens) {
equipInRegion(BodyRegionV2.HANDS, mittens);
checkMittensAfterApply();
@@ -77,40 +77,67 @@ public class PlayerEquipment {
/** Removes binds and restores speed. */
public ItemStack takeBindOff() {
return V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.ARMS);
return V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.ARMS
);
}
public ItemStack takeGagOff() {
return V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.MOUTH);
return V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.MOUTH
);
}
public ItemStack takeBlindfoldOff() {
return V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.EYES);
return V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.EYES
);
}
public ItemStack takeCollarOff() {
return V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.NECK);
return V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.NECK
);
}
/** Removes mittens. Phase 14.4: Mittens system */
/** Removes mittens. Mittens system */
public ItemStack takeMittensOff() {
ItemStack mittens = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.HANDS);
ItemStack mittens = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.HANDS
);
if (isLocked(mittens, false)) {
return ItemStack.EMPTY;
}
return V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.HANDS);
return V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.HANDS
);
}
public ItemStack takeEarplugsOff() {
ItemStack earplugs = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EARS);
ItemStack earplugs = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EARS
);
if (isLocked(earplugs, false)) {
return ItemStack.EMPTY;
}
return V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.EARS);
return V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.EARS
);
}
public ItemStack takeClothesOff() {
ItemStack clothes = V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.TORSO);
ItemStack clothes = V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.TORSO
);
// Sync clothes removal to all tracking clients
host.syncClothesConfig();
return clothes;
@@ -121,7 +148,10 @@ public class PlayerEquipment {
*/
public ItemStack takeCollarOff(boolean force) {
Player player = host.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (collar.isEmpty()) return ItemStack.EMPTY;
if (collar.getItem() instanceof ItemCollar collarItem) {
@@ -135,21 +165,30 @@ public class PlayerEquipment {
/** Replaces the blindfold and returns the old one. Issue #14 fix: now calls lifecycle hooks. */
public ItemStack replaceBlindfold(ItemStack newBlindfold) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EYES);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EYES
);
if (current.isEmpty()) return ItemStack.EMPTY;
return replaceInRegion(BodyRegionV2.EYES, newBlindfold);
}
/** Replaces the gag and returns the old one. Issue #14 fix: now calls lifecycle hooks. */
public ItemStack replaceGag(ItemStack newGag) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.MOUTH);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.MOUTH
);
if (current.isEmpty()) return ItemStack.EMPTY;
return replaceInRegion(BodyRegionV2.MOUTH, newGag);
}
/** Replaces the collar and returns the old one. Issue #14 fix: now calls lifecycle hooks. */
public ItemStack replaceCollar(ItemStack newCollar) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.NECK);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.NECK
);
if (current.isEmpty()) return ItemStack.EMPTY;
return replaceInRegion(BodyRegionV2.NECK, newCollar);
}
@@ -176,7 +215,10 @@ public class PlayerEquipment {
if (newBind.isEmpty()) {
return ItemStack.EMPTY;
}
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.ARMS);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.ARMS
);
if (isLocked(current, force)) {
return ItemStack.EMPTY;
}
@@ -188,27 +230,42 @@ public class PlayerEquipment {
}
public ItemStack replaceGag(ItemStack newGag, boolean force) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.MOUTH);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.MOUTH
);
if (isLocked(current, force)) {
return ItemStack.EMPTY;
}
ItemStack old = V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.MOUTH);
ItemStack old = V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.MOUTH
);
putGagOn(newGag);
return old;
}
public ItemStack replaceBlindfold(ItemStack newBlindfold, boolean force) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EYES);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EYES
);
if (isLocked(current, force)) {
return ItemStack.EMPTY;
}
ItemStack old = V2EquipmentHelper.unequipFromRegion(host.getPlayer(), BodyRegionV2.EYES);
ItemStack old = V2EquipmentHelper.unequipFromRegion(
host.getPlayer(),
BodyRegionV2.EYES
);
putBlindfoldOn(newBlindfold);
return old;
}
public ItemStack replaceCollar(ItemStack newCollar, boolean force) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.NECK);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.NECK
);
if (isLocked(current, force)) {
return ItemStack.EMPTY;
}
@@ -222,7 +279,10 @@ public class PlayerEquipment {
}
public ItemStack replaceEarplugs(ItemStack newEarplugs, boolean force) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EARS);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EARS
);
if (isLocked(current, force)) {
return ItemStack.EMPTY;
}
@@ -236,7 +296,10 @@ public class PlayerEquipment {
}
public ItemStack replaceMittens(ItemStack newMittens, boolean force) {
ItemStack current = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.HANDS);
ItemStack current = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.HANDS
);
if (isLocked(current, force)) {
return ItemStack.EMPTY;
}
@@ -250,11 +313,13 @@ public class PlayerEquipment {
// ========== Resistance Methods ==========
/**
* Phase 14.1.7: Now part of IRestrainable interface
*/
public synchronized int getCurrentBindResistance() {
Player player = host.getPlayer();
ItemStack stack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.ARMS);
ItemStack stack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.ARMS
);
if (
stack.isEmpty() || !(stack.getItem() instanceof ItemBind bind)
) return 0;
@@ -262,11 +327,13 @@ public class PlayerEquipment {
}
/**
* Phase 14.1.7: Now part of IRestrainable interface
*/
public synchronized void setCurrentBindResistance(int resistance) {
Player player = host.getPlayer();
ItemStack stack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.ARMS);
ItemStack stack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.ARMS
);
if (
stack.isEmpty() || !(stack.getItem() instanceof ItemBind bind)
) return;
@@ -274,11 +341,13 @@ public class PlayerEquipment {
}
/**
* Phase 14.1.7: Added for IRestrainable interface
*/
public synchronized int getCurrentCollarResistance() {
Player player = host.getPlayer();
ItemStack stack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack stack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
stack.isEmpty() || !(stack.getItem() instanceof ItemCollar collar)
) return 0;
@@ -286,11 +355,13 @@ public class PlayerEquipment {
}
/**
* Phase 14.1.7: Added for IRestrainable interface
*/
public synchronized void setCurrentCollarResistance(int resistance) {
Player player = host.getPlayer();
ItemStack stack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack stack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
stack.isEmpty() || !(stack.getItem() instanceof ItemCollar collar)
) return;
@@ -339,7 +410,10 @@ public class PlayerEquipment {
}
private boolean hasMittens() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.HANDS);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.HANDS
);
}
// ========== Low-level V2 equipment operations ==========
@@ -380,7 +454,9 @@ public class PlayerEquipment {
*/
private ItemStack replaceInRegion(BodyRegionV2 region, ItemStack newStack) {
Player player = host.getPlayer();
if (player == null || player.level().isClientSide) return ItemStack.EMPTY;
if (
player == null || player.level().isClientSide
) return ItemStack.EMPTY;
IV2BondageEquipment equip = V2EquipmentHelper.getEquipment(player);
if (equip == null) return ItemStack.EMPTY;
@@ -388,7 +464,10 @@ public class PlayerEquipment {
ItemStack oldStack = equip.getInRegion(region);
// Call onUnequipped for the old item
if (!oldStack.isEmpty() && oldStack.getItem() instanceof IV2BondageItem oldItem) {
if (
!oldStack.isEmpty() &&
oldStack.getItem() instanceof IV2BondageItem oldItem
) {
oldItem.onUnequipped(oldStack, player);
}
@@ -396,7 +475,10 @@ public class PlayerEquipment {
equip.setInRegion(region, newStack.copy());
// Call onEquipped for the new item
if (!newStack.isEmpty() && newStack.getItem() instanceof IV2BondageItem newItem) {
if (
!newStack.isEmpty() &&
newStack.getItem() instanceof IV2BondageItem newItem
) {
newItem.onEquipped(newStack, player);
}

View File

@@ -1,11 +1,11 @@
package com.tiedup.remake.state.components;
import com.tiedup.remake.cells.CampOwnership;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.cells.CellRegistryV2;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.ItemBind;
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.UUID;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.player.Player;
@@ -47,7 +47,6 @@ public class PlayerLifecycle {
// Update player reference
host.setOnline(true);
// Phase 17: Clear captor reference (enslavement ends on disconnect)
host.setCaptor(null);
// Reset struggle animation state (prevent stuck animations)

View File

@@ -4,7 +4,6 @@ import com.tiedup.remake.util.tasks.ItemTask;
/**
* Component responsible for player sale system.
* Phase 14.3.5: Sale system fields
*
* Single Responsibility: Sale state management
* Complexity: LOW (simple state tracking)

View File

@@ -1,7 +1,6 @@
package com.tiedup.remake.state.components;
import com.tiedup.remake.core.ModSounds;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
import com.tiedup.remake.core.TiedUpMod;
@@ -10,6 +9,7 @@ import com.tiedup.remake.items.ItemShockCollarAuto;
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
import com.tiedup.remake.util.GameConstants;
import com.tiedup.remake.util.time.Timer;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import java.util.UUID;
import net.minecraft.ChatFormatting;
@@ -20,7 +20,6 @@ import org.jetbrains.annotations.Nullable;
/**
* Component responsible for shock collar mechanics and GPS tracking.
* Phase 13: Advanced collar features (shocks, GPS tracking)
*
* Single Responsibility: Collar automation and GPS monitoring
* Complexity: HIGH (synchronized timer, GPS zone checks, network messages)
@@ -32,7 +31,6 @@ public class PlayerShockCollar {
private final IPlayerBindStateHost host;
// Phase 13: Collar automation fields
// volatile: accessed from synchronized blocks across multiple threads
private volatile Timer timerAutoShockCollar;
private final Object lockTimerAutoShock = new Object();

View File

@@ -9,7 +9,6 @@ import com.tiedup.remake.v2.BodyRegionV2;
/**
* Component responsible for special player interactions.
* v2.5: Knife cut target for accessory cutting
* Phase 14.1.7: Item transfers between players
*
* Single Responsibility: Special action management
* Complexity: MEDIUM (external dependencies)
@@ -67,14 +66,12 @@ public class PlayerSpecialActions {
}
/**
* Phase 14.1.7: Transfer bondage item from this player to another.
* Updated to use IRestrainable parameter (was PlayerBindState)
*
* @param taker The entity taking the item
* @param slotIndex The slot index to take from
*/
public void takeBondageItemBy(IRestrainableEntity taker, int slotIndex) {
// TODO Phase 14+: Transfer item from this player to taker
TiedUpMod.LOGGER.debug(
"[PlayerSpecialActions] {} taking bondage item from {} (slot {})",
taker.getKidnappedName(),

View File

@@ -28,22 +28,34 @@ public class PlayerStateQuery {
/** Check if player has ropes/ties equipped. */
public boolean isTiedUp() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.ARMS);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.ARMS
);
}
/** Check if player is currently gagged. */
public boolean isGagged() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.MOUTH);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.MOUTH
);
}
/** Check if player is blindfolded. */
public boolean isBlindfolded() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.EYES);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.EYES
);
}
/** Check if player has earplugs. */
public boolean hasEarplugs() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.EARS);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.EARS
);
}
public boolean isEarplugged() {
@@ -52,22 +64,34 @@ public class PlayerStateQuery {
/** Check if player is wearing a collar. */
public boolean hasCollar() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.NECK);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.NECK
);
}
/** Returns the current collar ItemStack, or empty if none. */
public ItemStack getCurrentCollar() {
if (!hasCollar()) return ItemStack.EMPTY;
return V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.NECK);
return V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.NECK
);
}
public boolean hasClothes() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.TORSO);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.TORSO
);
}
/** Check if player has mittens equipped. Phase 14.4: Mittens system */
/** Check if player has mittens equipped. Mittens system */
public boolean hasMittens() {
return V2EquipmentHelper.isRegionOccupied(host.getPlayer(), BodyRegionV2.HANDS);
return V2EquipmentHelper.isRegionOccupied(
host.getPlayer(),
BodyRegionV2.HANDS
);
}
/** Check if player can be tied up (not already tied). */
@@ -104,7 +128,10 @@ public class PlayerStateQuery {
*/
public boolean hasGaggingEffect() {
if (!isGagged()) return false;
ItemStack gag = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.MOUTH);
ItemStack gag = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.MOUTH
);
if (gag.isEmpty()) return false;
return (
gag.getItem() instanceof
@@ -118,7 +145,10 @@ public class PlayerStateQuery {
*/
public boolean hasBlindingEffect() {
if (!isBlindfolded()) return false;
ItemStack blindfold = V2EquipmentHelper.getInRegion(host.getPlayer(), BodyRegionV2.EYES);
ItemStack blindfold = V2EquipmentHelper.getInRegion(
host.getPlayer(),
BodyRegionV2.EYES
);
if (blindfold.isEmpty()) return false;
return (
blindfold.getItem() instanceof

View File

@@ -8,7 +8,6 @@ import net.minecraft.world.entity.player.Player;
/**
* Component responsible for struggle mechanics and resistance management.
* Phase 7: Struggle & Resistance Methods
*
* Single Responsibility: Struggle state and resistance tracking
* Complexity: MEDIUM (volatile fields, animation coordination)
@@ -24,7 +23,6 @@ public class PlayerStruggle {
private final IPlayerBindStateHost host;
private final PlayerBindState state; // Cast reference for struggle system
// Phase 7 & 8: Struggle state tracking
private final StruggleBinds struggleBindState;
private final StruggleCollar struggleCollarState;

View File

@@ -7,7 +7,6 @@ import com.tiedup.remake.tasks.UntyingTask;
/**
* Component responsible for tracking tying/untying tasks.
* Phase 6: Tying/Untying task tracking (Phase 14.2.6: unified for Players + NPCs)
*
* Single Responsibility: Task state management
* Complexity: LOW (simple getters/setters)

View File

@@ -11,7 +11,6 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
/**
* Phase 21: Struggle implementation for accessory items (gag, blindfold, earplugs, collar).
*
* Accessories have NO base resistance - only locked items can be struggled.
* Lock adds 250 resistance. Struggle success destroys the padlock (lockable=false).
@@ -189,12 +188,14 @@ public class StruggleAccessory extends StruggleState {
}
/**
* Phase 13: Trigger shock collar check when struggling against accessories.
*/
@Override
protected boolean onAttempt(PlayerBindState state) {
Player player = state.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
!collar.isEmpty() &&

View File

@@ -1,5 +1,6 @@
package com.tiedup.remake.state.struggle;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
import com.tiedup.remake.core.TiedUpMod;
@@ -7,7 +8,6 @@ import com.tiedup.remake.items.base.ILockable;
import com.tiedup.remake.items.base.ItemBind;
import com.tiedup.remake.state.IPlayerLeashAccess;
import com.tiedup.remake.state.PlayerBindState;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
import net.minecraft.world.entity.item.ItemEntity;
@@ -15,7 +15,6 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
/**
* Phase 7: Struggle implementation for bind restraints (ropes).
*
* Handles struggling against binds:
* - Gets/sets resistance from equipped bind item
@@ -58,7 +57,6 @@ public class StruggleBinds extends StruggleState {
* - No bind item equipped
* - Bind item has struggle disabled
*
* Phase 20: Locked items can now be struggled, but with x10 resistance.
* The resistance penalty is applied in StruggleState.struggle().
*
* Based on original StruggleBinds.canStruggle() (lines 33-41)
@@ -73,7 +71,10 @@ public class StruggleBinds extends StruggleState {
return false;
}
ItemStack bindStack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.ARMS);
ItemStack bindStack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.ARMS
);
if (
bindStack.isEmpty() ||
!(bindStack.getItem() instanceof ItemBind bind)
@@ -81,11 +82,10 @@ public class StruggleBinds extends StruggleState {
return false;
}
// Phase 20: Locked items can now be struggled (with x10 resistance)
// The locked check has been moved to struggle() where decrease is reduced
return bind.canBeStruggledOut(bindStack);
}
}
/**
* Check if the bind item is locked.
@@ -99,7 +99,10 @@ public class StruggleBinds extends StruggleState {
Player player = state.getPlayer();
if (player == null) return false;
ItemStack bindStack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.ARMS);
ItemStack bindStack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.ARMS
);
if (
bindStack.isEmpty() ||
!(bindStack.getItem() instanceof ItemBind bind)
@@ -135,13 +138,15 @@ public class StruggleBinds extends StruggleState {
}
/**
* Phase 13: Trigger shock collar check even when struggling against binds.
* If shocked, the attempt is missed.
*/
@Override
protected boolean onAttempt(PlayerBindState state) {
Player player = state.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
!collar.isEmpty() &&
@@ -157,7 +162,6 @@ public class StruggleBinds extends StruggleState {
* Drop the bind items to the ground.
* Accessories are NOT dropped during bind struggle.
*
* Phase 21: Struggle success destroys the padlock (lockable=false).
*
* Based on original StruggleBinds.dropBondageItems() (lines 50-69)
*
@@ -170,9 +174,11 @@ public class StruggleBinds extends StruggleState {
}
// ONLY drop the BIND slot
ItemStack stack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.ARMS);
ItemStack stack = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.ARMS
);
if (!stack.isEmpty()) {
// Phase 21: Struggle success DESTROYS the padlock
// The bind drops without its padlock (lockable=false)
ItemStack toDrop = stack.copy();
if (
@@ -217,7 +223,6 @@ public class StruggleBinds extends StruggleState {
return;
}
// Phase 17: 1. Remove from captivity/leash
if (state.isCaptive()) {
state.free();
}
@@ -240,7 +245,6 @@ public class StruggleBinds extends StruggleState {
}
/**
* Phase 2: External success action for mini-game system.
* Called when player completes struggle mini-game successfully.
*
* @param state The player's bind state
@@ -250,7 +254,6 @@ public class StruggleBinds extends StruggleState {
}
/**
* Phase 2: Set external cooldown timer (e.g., from mini-game exhaustion).
*
* @param seconds Cooldown duration in seconds
* @param level The level for timer
@@ -310,7 +313,10 @@ public class StruggleBinds extends StruggleState {
return;
}
ItemStack bindStack = V2EquipmentHelper.getInRegion(target, BodyRegionV2.ARMS);
ItemStack bindStack = V2EquipmentHelper.getInRegion(
target,
BodyRegionV2.ARMS
);
if (
bindStack.isEmpty() ||
!(bindStack.getItem() instanceof ItemBind bind)

View File

@@ -10,7 +10,6 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
/**
* Phase 8: Master-Slave Relationships
*
* Struggle mechanics specifically for locked collars.
*
@@ -45,7 +44,10 @@ public class StruggleCollar extends StruggleState {
@Override
protected int getResistanceState(PlayerBindState state) {
Player player = state.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
collar.isEmpty() ||
@@ -66,7 +68,10 @@ public class StruggleCollar extends StruggleState {
@Override
protected void setResistanceState(PlayerBindState state, int resistance) {
Player player = state.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
collar.isEmpty() ||
@@ -95,12 +100,14 @@ public class StruggleCollar extends StruggleState {
protected boolean canStruggle(PlayerBindState state) {
Player player = state.getPlayer();
// Phase 13 logic: Can only struggle against collar if NOT tied up
if (state.isTiedUp()) {
return false;
}
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
collar.isEmpty() ||
@@ -134,7 +141,10 @@ public class StruggleCollar extends StruggleState {
@Override
protected boolean onAttempt(PlayerBindState state) {
Player player = state.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
!collar.isEmpty() &&
@@ -157,7 +167,10 @@ public class StruggleCollar extends StruggleState {
@Override
protected void successAction(PlayerBindState state) {
Player player = state.getPlayer();
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
player,
BodyRegionV2.NECK
);
if (
collar.isEmpty() ||
@@ -217,7 +230,10 @@ public class StruggleCollar extends StruggleState {
return;
}
ItemStack collar = V2EquipmentHelper.getInRegion(target, BodyRegionV2.NECK);
ItemStack collar = V2EquipmentHelper.getInRegion(
target,
BodyRegionV2.NECK
);
if (
collar.isEmpty() ||

View File

@@ -1,16 +1,15 @@
package com.tiedup.remake.state.struggle;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.state.PlayerBindState;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.util.time.Timer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.GameRules;
/**
* Phase 7: Base class for struggle mechanics.
*
* Handles the logic for players/NPCs struggling against restraints:
* - Cooldown timer between attempts
@@ -87,7 +86,6 @@ public abstract class StruggleState {
);
}
// Phase 13: Trigger attempt effects (shock collar check)
if (!onAttempt(state)) {
return; // Interrupted by pain
}
@@ -100,8 +98,12 @@ public abstract class StruggleState {
if (success) {
// Calculate resistance decrease
int currentResistance = getResistanceState(state);
int minDecrease = SettingsAccessor.getStruggleMinDecrease(gameRules);
int maxDecrease = SettingsAccessor.getStruggleMaxDecrease(gameRules);
int minDecrease = SettingsAccessor.getStruggleMinDecrease(
gameRules
);
int maxDecrease = SettingsAccessor.getStruggleMaxDecrease(
gameRules
);
int decrease =
minDecrease +