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:
@@ -4,14 +4,14 @@ import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.items.ItemShockCollar;
|
||||
import com.tiedup.remake.items.base.ItemBind;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
|
||||
import com.tiedup.remake.minigame.ContinuousStruggleMiniGameState.TickResult;
|
||||
import com.tiedup.remake.minigame.ContinuousStruggleMiniGameState.UpdateType;
|
||||
import com.tiedup.remake.network.ModNetwork;
|
||||
import com.tiedup.remake.network.minigame.PacketContinuousStruggleState;
|
||||
import com.tiedup.remake.network.sync.SyncManager;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -52,13 +52,13 @@ public class StruggleSessionManager {
|
||||
* Index: 0=ARMS, 1=MOUTH, 2=EYES, 3=EARS, 4=NECK, 5=TORSO, 6=HANDS.
|
||||
*/
|
||||
private static final BodyRegionV2[] SLOT_TO_REGION = {
|
||||
BodyRegionV2.ARMS, // 0 = BIND
|
||||
BodyRegionV2.MOUTH, // 1 = GAG
|
||||
BodyRegionV2.EYES, // 2 = BLINDFOLD
|
||||
BodyRegionV2.EARS, // 3 = EARPLUGS
|
||||
BodyRegionV2.NECK, // 4 = COLLAR
|
||||
BodyRegionV2.TORSO, // 5 = CLOTHES
|
||||
BodyRegionV2.HANDS, // 6 = MITTENS
|
||||
BodyRegionV2.ARMS, // 0 = BIND
|
||||
BodyRegionV2.MOUTH, // 1 = GAG
|
||||
BodyRegionV2.EYES, // 2 = BLINDFOLD
|
||||
BodyRegionV2.EARS, // 3 = EARPLUGS
|
||||
BodyRegionV2.NECK, // 4 = COLLAR
|
||||
BodyRegionV2.TORSO, // 5 = CLOTHES
|
||||
BodyRegionV2.HANDS, // 6 = MITTENS
|
||||
};
|
||||
|
||||
private StruggleSessionManager() {}
|
||||
@@ -277,7 +277,9 @@ public class StruggleSessionManager {
|
||||
UUID playerId = player.getUUID();
|
||||
|
||||
// Reject if an active session already exists
|
||||
ContinuousStruggleMiniGameState existing = continuousSessions.get(playerId);
|
||||
ContinuousStruggleMiniGameState existing = continuousSessions.get(
|
||||
playerId
|
||||
);
|
||||
if (existing != null) {
|
||||
TiedUpMod.LOGGER.debug(
|
||||
"[StruggleSessionManager] Rejected furniture session: active session already exists for {}",
|
||||
@@ -319,13 +321,30 @@ public class StruggleSessionManager {
|
||||
|
||||
// Play struggle loop sound from furniture definition (plays once on start;
|
||||
// true looping sound would require client-side sound management -- future scope)
|
||||
net.minecraft.world.entity.Entity furnitureEntity = player.level().getEntity(furnitureEntityId);
|
||||
if (furnitureEntity instanceof com.tiedup.remake.v2.furniture.EntityFurniture furniture) {
|
||||
com.tiedup.remake.v2.furniture.FurnitureDefinition def = furniture.getDefinition();
|
||||
net.minecraft.world.entity.Entity furnitureEntity = player
|
||||
.level()
|
||||
.getEntity(furnitureEntityId);
|
||||
if (
|
||||
furnitureEntity instanceof
|
||||
com.tiedup.remake.v2.furniture.EntityFurniture furniture
|
||||
) {
|
||||
com.tiedup.remake.v2.furniture.FurnitureDefinition def =
|
||||
furniture.getDefinition();
|
||||
if (def != null && def.feedback().struggleLoopSound() != null) {
|
||||
player.level().playSound(null, player.getX(), player.getY(), player.getZ(),
|
||||
net.minecraft.sounds.SoundEvent.createVariableRangeEvent(def.feedback().struggleLoopSound()),
|
||||
SoundSource.PLAYERS, 0.6f, 1.0f);
|
||||
player
|
||||
.level()
|
||||
.playSound(
|
||||
null,
|
||||
player.getX(),
|
||||
player.getY(),
|
||||
player.getZ(),
|
||||
net.minecraft.sounds.SoundEvent.createVariableRangeEvent(
|
||||
def.feedback().struggleLoopSound()
|
||||
),
|
||||
SoundSource.PLAYERS,
|
||||
0.6f,
|
||||
1.0f
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +500,9 @@ public class StruggleSessionManager {
|
||||
|
||||
// Check kidnapper notification
|
||||
if (session.shouldNotifyKidnappers(currentTick)) {
|
||||
GuardNotificationHelper.notifyNearbyKidnappersOfStruggle(player);
|
||||
GuardNotificationHelper.notifyNearbyKidnappersOfStruggle(
|
||||
player
|
||||
);
|
||||
}
|
||||
|
||||
// Play struggle sound periodically
|
||||
@@ -516,7 +537,10 @@ public class StruggleSessionManager {
|
||||
* Check if shock collar check is applicable for this player.
|
||||
*/
|
||||
private boolean shouldCheckShockCollar(ServerPlayer player) {
|
||||
ItemStack collar = V2EquipmentHelper.getInRegion(player, BodyRegionV2.NECK);
|
||||
ItemStack collar = V2EquipmentHelper.getInRegion(
|
||||
player,
|
||||
BodyRegionV2.NECK
|
||||
);
|
||||
if (collar.isEmpty()) return false;
|
||||
|
||||
// Only shock collars can trigger during struggle
|
||||
@@ -562,8 +586,10 @@ public class StruggleSessionManager {
|
||||
com.tiedup.remake.v2.BodyRegionV2 region =
|
||||
session.getTargetRegion();
|
||||
ItemStack stack =
|
||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
|
||||
.getInRegion(player, region);
|
||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getInRegion(
|
||||
player,
|
||||
region
|
||||
);
|
||||
if (stack.isEmpty()) return;
|
||||
|
||||
if (
|
||||
@@ -584,10 +610,17 @@ public class StruggleSessionManager {
|
||||
if (session.isAccessoryStruggle()) {
|
||||
// Handle accessory resistance update (V1 path -- slot index is legacy ordinal)
|
||||
Integer slotIndex = session.getTargetSlot();
|
||||
if (slotIndex == null || slotIndex < 0 || slotIndex >= SLOT_TO_REGION.length) return;
|
||||
if (
|
||||
slotIndex == null ||
|
||||
slotIndex < 0 ||
|
||||
slotIndex >= SLOT_TO_REGION.length
|
||||
) return;
|
||||
|
||||
BodyRegionV2 region = SLOT_TO_REGION[slotIndex];
|
||||
ItemStack accessoryStack = V2EquipmentHelper.getInRegion(player, region);
|
||||
ItemStack accessoryStack = V2EquipmentHelper.getInRegion(
|
||||
player,
|
||||
region
|
||||
);
|
||||
if (accessoryStack.isEmpty()) return;
|
||||
|
||||
if (
|
||||
@@ -606,7 +639,10 @@ public class StruggleSessionManager {
|
||||
}
|
||||
|
||||
// Update bind resistance
|
||||
ItemStack bindStack = V2EquipmentHelper.getInRegion(player, BodyRegionV2.ARMS);
|
||||
ItemStack bindStack = V2EquipmentHelper.getInRegion(
|
||||
player,
|
||||
BodyRegionV2.ARMS
|
||||
);
|
||||
if (
|
||||
bindStack.isEmpty() ||
|
||||
!(bindStack.getItem() instanceof ItemBind bind)
|
||||
@@ -648,15 +684,23 @@ public class StruggleSessionManager {
|
||||
session.getTargetRegion();
|
||||
// BUG-001 fix: break lock before unequip (consistent with V1 accessory escape)
|
||||
ItemStack stackInRegion =
|
||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
|
||||
.getInRegion(player, region);
|
||||
if (!stackInRegion.isEmpty()
|
||||
&& stackInRegion.getItem() instanceof com.tiedup.remake.items.base.ILockable lockable) {
|
||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.getInRegion(
|
||||
player,
|
||||
region
|
||||
);
|
||||
if (
|
||||
!stackInRegion.isEmpty() &&
|
||||
stackInRegion.getItem() instanceof
|
||||
com.tiedup.remake.items.base.ILockable lockable
|
||||
) {
|
||||
lockable.breakLock(stackInRegion);
|
||||
}
|
||||
ItemStack removed =
|
||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper
|
||||
.unequipFromRegion(player, region, true);
|
||||
com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper.unequipFromRegion(
|
||||
player,
|
||||
region,
|
||||
true
|
||||
);
|
||||
if (!removed.isEmpty()) {
|
||||
if (!player.getInventory().add(removed)) {
|
||||
player.drop(removed, false);
|
||||
@@ -678,9 +722,16 @@ public class StruggleSessionManager {
|
||||
} else {
|
||||
// Handle accessory escape (V1 path -- slot index is legacy ordinal)
|
||||
Integer slotIndex = session.getTargetSlot();
|
||||
if (slotIndex != null && slotIndex >= 0 && slotIndex < SLOT_TO_REGION.length) {
|
||||
if (
|
||||
slotIndex != null &&
|
||||
slotIndex >= 0 &&
|
||||
slotIndex < SLOT_TO_REGION.length
|
||||
) {
|
||||
BodyRegionV2 region = SLOT_TO_REGION[slotIndex];
|
||||
ItemStack accessoryStack = V2EquipmentHelper.getInRegion(player, region);
|
||||
ItemStack accessoryStack = V2EquipmentHelper.getInRegion(
|
||||
player,
|
||||
region
|
||||
);
|
||||
if (!accessoryStack.isEmpty()) {
|
||||
// Break the lock on the accessory
|
||||
if (
|
||||
@@ -691,7 +742,9 @@ public class StruggleSessionManager {
|
||||
}
|
||||
// Remove the accessory from the region and drop it
|
||||
ItemStack removed = V2EquipmentHelper.unequipFromRegion(
|
||||
player, region, true
|
||||
player,
|
||||
region,
|
||||
true
|
||||
);
|
||||
if (!removed.isEmpty()) {
|
||||
// Drop the item at player's feet
|
||||
@@ -716,7 +769,9 @@ public class StruggleSessionManager {
|
||||
int furnitureEntityId = session.getFurnitureEntityId();
|
||||
String seatId = session.getFurnitureSeatId();
|
||||
|
||||
net.minecraft.world.entity.Entity entity = player.level().getEntity(furnitureEntityId);
|
||||
net.minecraft.world.entity.Entity entity = player
|
||||
.level()
|
||||
.getEntity(furnitureEntityId);
|
||||
if (entity == null || entity.isRemoved()) {
|
||||
TiedUpMod.LOGGER.warn(
|
||||
"[StruggleSessionManager] Furniture entity {} no longer exists for escape",
|
||||
@@ -727,7 +782,10 @@ public class StruggleSessionManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(entity instanceof com.tiedup.remake.v2.furniture.ISeatProvider provider)) {
|
||||
if (
|
||||
!(entity instanceof
|
||||
com.tiedup.remake.v2.furniture.ISeatProvider provider)
|
||||
) {
|
||||
TiedUpMod.LOGGER.warn(
|
||||
"[StruggleSessionManager] Entity {} is not an ISeatProvider",
|
||||
furnitureEntityId
|
||||
@@ -740,38 +798,57 @@ public class StruggleSessionManager {
|
||||
provider.setSeatLocked(seatId, false);
|
||||
|
||||
// Clear persistent data tag (reconnection system)
|
||||
net.minecraft.nbt.CompoundTag persistentData = player.getPersistentData();
|
||||
net.minecraft.nbt.CompoundTag persistentData =
|
||||
player.getPersistentData();
|
||||
persistentData.remove("tiedup_locked_furniture");
|
||||
|
||||
// Dismount the player
|
||||
player.stopRiding();
|
||||
|
||||
// Play escape sound: prefer furniture-specific sound, fall back to CHAIN_BREAK
|
||||
net.minecraft.sounds.SoundEvent escapeSound = net.minecraft.sounds.SoundEvents.CHAIN_BREAK;
|
||||
if (entity instanceof com.tiedup.remake.v2.furniture.EntityFurniture furniture) {
|
||||
com.tiedup.remake.v2.furniture.FurnitureDefinition def = furniture.getDefinition();
|
||||
net.minecraft.sounds.SoundEvent escapeSound =
|
||||
net.minecraft.sounds.SoundEvents.CHAIN_BREAK;
|
||||
if (
|
||||
entity instanceof
|
||||
com.tiedup.remake.v2.furniture.EntityFurniture furniture
|
||||
) {
|
||||
com.tiedup.remake.v2.furniture.FurnitureDefinition def =
|
||||
furniture.getDefinition();
|
||||
if (def != null && def.feedback().escapeSound() != null) {
|
||||
escapeSound = net.minecraft.sounds.SoundEvent.createVariableRangeEvent(
|
||||
def.feedback().escapeSound()
|
||||
);
|
||||
escapeSound =
|
||||
net.minecraft.sounds.SoundEvent.createVariableRangeEvent(
|
||||
def.feedback().escapeSound()
|
||||
);
|
||||
}
|
||||
}
|
||||
player.serverLevel().playSound(
|
||||
null,
|
||||
player.getX(), player.getY(), player.getZ(),
|
||||
escapeSound,
|
||||
net.minecraft.sounds.SoundSource.PLAYERS,
|
||||
1.0f, 1.0f
|
||||
);
|
||||
player
|
||||
.serverLevel()
|
||||
.playSound(
|
||||
null,
|
||||
player.getX(),
|
||||
player.getY(),
|
||||
player.getZ(),
|
||||
escapeSound,
|
||||
net.minecraft.sounds.SoundSource.PLAYERS,
|
||||
1.0f,
|
||||
1.0f
|
||||
);
|
||||
|
||||
// Broadcast updated furniture state to all tracking clients
|
||||
if (entity instanceof com.tiedup.remake.v2.furniture.EntityFurniture furniture) {
|
||||
com.tiedup.remake.v2.furniture.network.PacketSyncFurnitureState.sendToTracking(furniture);
|
||||
if (
|
||||
entity instanceof
|
||||
com.tiedup.remake.v2.furniture.EntityFurniture furniture
|
||||
) {
|
||||
com.tiedup.remake.v2.furniture.network.PacketSyncFurnitureState.sendToTracking(
|
||||
furniture
|
||||
);
|
||||
}
|
||||
|
||||
TiedUpMod.LOGGER.info(
|
||||
"[StruggleSessionManager] {} escaped furniture {} seat '{}'",
|
||||
player.getName().getString(), furnitureEntityId, seatId
|
||||
player.getName().getString(),
|
||||
furnitureEntityId,
|
||||
seatId
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user