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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user