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:
@@ -6,7 +6,6 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
/**
|
||||
* Phase 6: Lightweight client-side task state for displaying progress.
|
||||
*
|
||||
* Based on original PlayerStateTask from 1.12.2
|
||||
*
|
||||
|
||||
@@ -6,8 +6,6 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* Phase 6: Timed task that involves interacting with a target entity.
|
||||
* Phase 14.2.6: Refactored to support any IBondageState entity (Players + NPCs)
|
||||
*
|
||||
* Based on original TimedInteractTask from 1.12.2
|
||||
*
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.tiedup.remake.tasks;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* Phase 6: Base class for all progress-based tasks (tying, untying, etc.)
|
||||
*
|
||||
* Based on original TimedTask from 1.12.2, refactored for continuous click requirement.
|
||||
*
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.tiedup.remake.tasks;
|
||||
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.network.ModNetwork;
|
||||
import com.tiedup.remake.network.action.PacketTying;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
@@ -13,8 +13,6 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* Phase 6: Concrete tying task for tying up any IBondageState entity.
|
||||
* Phase 14.2.6: Unified to work with both Players and NPCs.
|
||||
*
|
||||
* Based on original TyingPlayerTask from 1.12.2
|
||||
*
|
||||
@@ -115,9 +113,7 @@ public class TyingPlayerTask extends TyingTask {
|
||||
boolean isSelfTying =
|
||||
kidnapper != null && kidnapper.equals(targetEntity);
|
||||
|
||||
// ========================================
|
||||
// SECURITY: Validate kidnapper is still close to target (skip for self-tying)
|
||||
// ========================================
|
||||
if (!isSelfTying && kidnapper != null && targetEntity != null) {
|
||||
double distance = kidnapper.distanceTo(targetEntity);
|
||||
if (distance > 4.0) {
|
||||
@@ -290,11 +286,16 @@ public class TyingPlayerTask extends TyingTask {
|
||||
if (isSelfTying) {
|
||||
if (kidnapper instanceof ServerPlayer serverPlayer) {
|
||||
PacketTying completionPacket = new PacketTying(
|
||||
-1, this.getMaxSeconds(), true, "yourself"
|
||||
-1,
|
||||
this.getMaxSeconds(),
|
||||
true,
|
||||
"yourself"
|
||||
);
|
||||
ModNetwork.sendToPlayer(completionPacket, serverPlayer);
|
||||
|
||||
PlayerBindState playerState = PlayerBindState.getInstance(serverPlayer);
|
||||
PlayerBindState playerState = PlayerBindState.getInstance(
|
||||
serverPlayer
|
||||
);
|
||||
if (playerState != null) {
|
||||
playerState.setRestrainedState(null);
|
||||
}
|
||||
@@ -302,11 +303,16 @@ public class TyingPlayerTask extends TyingTask {
|
||||
} else {
|
||||
if (targetEntity instanceof ServerPlayer serverTarget) {
|
||||
PacketTying completionPacket = new PacketTying(
|
||||
-1, this.getMaxSeconds(), false, kidnapperName
|
||||
-1,
|
||||
this.getMaxSeconds(),
|
||||
false,
|
||||
kidnapperName
|
||||
);
|
||||
ModNetwork.sendToPlayer(completionPacket, serverTarget);
|
||||
|
||||
PlayerBindState playerState = PlayerBindState.getInstance(serverTarget);
|
||||
PlayerBindState playerState = PlayerBindState.getInstance(
|
||||
serverTarget
|
||||
);
|
||||
if (playerState != null) {
|
||||
playerState.setRestrainedState(null);
|
||||
}
|
||||
@@ -314,7 +320,10 @@ public class TyingPlayerTask extends TyingTask {
|
||||
|
||||
if (kidnapper instanceof ServerPlayer serverKidnapper) {
|
||||
PacketTying completionPacket = new PacketTying(
|
||||
-1, this.getMaxSeconds(), true, targetName
|
||||
-1,
|
||||
this.getMaxSeconds(),
|
||||
true,
|
||||
targetName
|
||||
);
|
||||
ModNetwork.sendToPlayer(completionPacket, serverKidnapper);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* Phase 6: Abstract tying task (binding/gagging an entity).
|
||||
* Phase 14.2.6: Refactored to support any IBondageState entity (Players + NPCs)
|
||||
*
|
||||
* Based on original TyingTask from 1.12.2
|
||||
*
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* Phase 6: Concrete untying task for freeing a tied entity.
|
||||
* Phase 14.2.6: Unified to work with both Players and NPCs.
|
||||
*
|
||||
* Based on original UntyingPlayerTask from 1.12.2
|
||||
*
|
||||
@@ -92,9 +90,7 @@ public class UntyingPlayerTask extends UntyingTask {
|
||||
*/
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
// ========================================
|
||||
// SECURITY: Validate helper is still close to target
|
||||
// ========================================
|
||||
if (helper != null && targetEntity != null) {
|
||||
double distance = helper.distanceTo(targetEntity);
|
||||
if (distance > 4.0) {
|
||||
@@ -184,7 +180,11 @@ public class UntyingPlayerTask extends UntyingTask {
|
||||
untieTarget();
|
||||
|
||||
// Handle Damsel-specific rewards
|
||||
if (targetEntity instanceof EntityDamsel damsel && NpcTypeHelper.isDamselOnly(targetEntity) && helper != null) {
|
||||
if (
|
||||
targetEntity instanceof EntityDamsel damsel &&
|
||||
NpcTypeHelper.isDamselOnly(targetEntity) &&
|
||||
helper != null
|
||||
) {
|
||||
// Reward the savior (gives emeralds and marks player as savior)
|
||||
damsel.rewardSavior(helper);
|
||||
}
|
||||
@@ -255,8 +255,12 @@ public class UntyingPlayerTask extends UntyingTask {
|
||||
private void dropBondageItems() {
|
||||
// For player targets: use V2EquipmentHelper to get all equipped items
|
||||
if (targetEntity instanceof Player player) {
|
||||
Map<BodyRegionV2, ItemStack> equipped = V2EquipmentHelper.getAllEquipped(player);
|
||||
for (Map.Entry<BodyRegionV2, ItemStack> entry : equipped.entrySet()) {
|
||||
Map<BodyRegionV2, ItemStack> equipped =
|
||||
V2EquipmentHelper.getAllEquipped(player);
|
||||
for (Map.Entry<
|
||||
BodyRegionV2,
|
||||
ItemStack
|
||||
> entry : equipped.entrySet()) {
|
||||
ItemStack stack = entry.getValue();
|
||||
if (!stack.isEmpty()) {
|
||||
// Drop item at player's position
|
||||
@@ -375,7 +379,6 @@ public class UntyingPlayerTask extends UntyingTask {
|
||||
if (targetEntity instanceof Player player) {
|
||||
V2EquipmentHelper.clearAll(player);
|
||||
|
||||
// Phase 17: Free from captivity/leash if applicable (player-specific)
|
||||
PlayerBindState playerState = PlayerBindState.getInstance(player);
|
||||
if (playerState != null && playerState.isCaptive()) {
|
||||
playerState.free();
|
||||
|
||||
@@ -5,8 +5,6 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
/**
|
||||
* Phase 6: Abstract untying task (freeing a tied entity).
|
||||
* Phase 14.2.6: Refactored to support any IBondageState entity (Players + NPCs)
|
||||
*
|
||||
* Based on original UntyingTask from 1.12.2
|
||||
*
|
||||
|
||||
@@ -78,7 +78,9 @@ public class V2TyingPlayerTask extends TyingPlayerTask {
|
||||
}
|
||||
// Consume the held item
|
||||
heldStack.shrink(1);
|
||||
TiedUpMod.LOGGER.debug("[V2TyingPlayerTask] V2 equip succeeded, item consumed");
|
||||
TiedUpMod.LOGGER.debug(
|
||||
"[V2TyingPlayerTask] V2 equip succeeded, item consumed"
|
||||
);
|
||||
} else {
|
||||
TiedUpMod.LOGGER.warn(
|
||||
"[V2TyingPlayerTask] V2 equip BLOCKED after tying — regions may have changed"
|
||||
|
||||
Reference in New Issue
Block a user