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

@@ -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() {