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,19 +1,18 @@
|
||||
package com.tiedup.remake.prison;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* Phase 2: Data class representing a single ransom demand.
|
||||
*
|
||||
* Contains:
|
||||
* - Captive and captor IDs
|
||||
@@ -380,11 +379,16 @@ public class RansomData {
|
||||
tag.putUUID("ransomId", ransomId);
|
||||
tag.putUUID("captiveId", captiveId);
|
||||
tag.putUUID("captorId", captorId);
|
||||
ResourceLocation demandItemKey = ForgeRegistries.ITEMS.getKey(demandItem);
|
||||
ResourceLocation demandItemKey = ForgeRegistries.ITEMS.getKey(
|
||||
demandItem
|
||||
);
|
||||
if (demandItemKey != null) {
|
||||
tag.putString("demandItem", demandItemKey.toString());
|
||||
} else {
|
||||
LOGGER.warn("[RansomData] Unregistered demand item {}, falling back to iron_ingot", demandItem);
|
||||
LOGGER.warn(
|
||||
"[RansomData] Unregistered demand item {}, falling back to iron_ingot",
|
||||
demandItem
|
||||
);
|
||||
tag.putString("demandItem", "minecraft:iron_ingot");
|
||||
}
|
||||
tag.putInt("demandAmount", demandAmount);
|
||||
@@ -415,7 +419,11 @@ public class RansomData {
|
||||
);
|
||||
if (demandItem == null) demandItem = Items.IRON_INGOT;
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("[RansomData] Failed to parse demand item key '{}', falling back to iron_ingot", itemKey, e);
|
||||
LOGGER.warn(
|
||||
"[RansomData] Failed to parse demand item key '{}', falling back to iron_ingot",
|
||||
itemKey,
|
||||
e
|
||||
);
|
||||
demandItem = Items.IRON_INGOT;
|
||||
}
|
||||
|
||||
@@ -427,7 +435,10 @@ public class RansomData {
|
||||
try {
|
||||
difficulty = RansomDifficulty.valueOf(tag.getString("difficulty"));
|
||||
} catch (IllegalArgumentException e) {
|
||||
LOGGER.warn("[RansomData] Unknown difficulty '{}', falling back to NORMAL", tag.getString("difficulty"));
|
||||
LOGGER.warn(
|
||||
"[RansomData] Unknown difficulty '{}', falling back to NORMAL",
|
||||
tag.getString("difficulty")
|
||||
);
|
||||
difficulty = RansomDifficulty.NORMAL;
|
||||
}
|
||||
RansomState state = RansomState.fromString(tag.getString("state"));
|
||||
@@ -456,7 +467,9 @@ public class RansomData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
ResourceLocation demandItemKey = ForgeRegistries.ITEMS.getKey(demandItem);
|
||||
ResourceLocation demandItemKey = ForgeRegistries.ITEMS.getKey(
|
||||
demandItem
|
||||
);
|
||||
return String.format(
|
||||
"RansomData{id=%s, captive=%s, demand=%dx%s, state=%s, paid=%d/%d}",
|
||||
ransomId.toString().substring(0, 8),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.tiedup.remake.prison.service;
|
||||
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -20,6 +19,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Centralized item management for the prison system.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.tiedup.remake.prison.service;
|
||||
|
||||
import com.tiedup.remake.cells.CellDataV2;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.cells.CellRegistryV2;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.AbstractTiedUpNpc;
|
||||
@@ -17,8 +16,8 @@ import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.state.ICaptor;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import java.util.*;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -29,6 +28,7 @@ import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Centralized prisoner lifecycle service.
|
||||
@@ -109,7 +109,9 @@ public class PrisonerService {
|
||||
}
|
||||
|
||||
// 2. Leash attach
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(captive);
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(
|
||||
captive
|
||||
);
|
||||
if (kidnappedState == null) {
|
||||
// Rollback
|
||||
manager.escape(
|
||||
@@ -237,7 +239,9 @@ public class PrisonerService {
|
||||
}
|
||||
|
||||
// 3. Unleash: remove captor refs and drop leash
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(captive);
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(
|
||||
captive
|
||||
);
|
||||
if (kidnappedState != null) {
|
||||
kidnappedState.free(false); // Drop leash without dialogue/items
|
||||
captor.removeCaptive(kidnappedState, false);
|
||||
@@ -307,7 +311,9 @@ public class PrisonerService {
|
||||
);
|
||||
|
||||
// 3. Leash to new captor — forceCapturedBy for damsels
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(captive);
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(
|
||||
captive
|
||||
);
|
||||
if (kidnappedState == null) {
|
||||
// Rollback
|
||||
if (isPlayer) {
|
||||
@@ -378,7 +384,9 @@ public class PrisonerService {
|
||||
long gameTime = level.getGameTime();
|
||||
|
||||
// 1. Unleash
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(captive);
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(
|
||||
captive
|
||||
);
|
||||
if (kidnappedState != null && kidnappedState.isCaptive()) {
|
||||
kidnappedState.free(false);
|
||||
}
|
||||
@@ -451,7 +459,9 @@ public class PrisonerService {
|
||||
ICaptor oldCaptor,
|
||||
ICaptor newCaptor
|
||||
) {
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(captive);
|
||||
IBondageState kidnappedState = KidnappedHelper.getKidnappedState(
|
||||
captive
|
||||
);
|
||||
if (kidnappedState == null) {
|
||||
TiedUpMod.LOGGER.warn(
|
||||
"[PrisonerService] transferCaptive() no kidnapped state for {}",
|
||||
@@ -479,9 +489,7 @@ public class PrisonerService {
|
||||
TiedUpMod.LOGGER.warn(
|
||||
"[PrisonerService] transferCaptive() re-leash to new captor failed, attempting rollback"
|
||||
);
|
||||
if (
|
||||
captive instanceof AbstractTiedUpNpc npc
|
||||
) {
|
||||
if (captive instanceof AbstractTiedUpNpc npc) {
|
||||
npc.forceCapturedBy(oldCaptor);
|
||||
} else {
|
||||
kidnappedState.getCapturedBy(oldCaptor);
|
||||
@@ -739,9 +747,13 @@ public class PrisonerService {
|
||||
if (state != PrisonerState.CAPTURED) {
|
||||
boolean hasCollarOwners = collars.hasOwners(playerId);
|
||||
if (!hasCollarOwners) {
|
||||
IBondageState cap = KidnappedHelper.getKidnappedState(player);
|
||||
IBondageState cap = KidnappedHelper.getKidnappedState(
|
||||
player
|
||||
);
|
||||
ItemStack collar =
|
||||
cap != null ? cap.getEquipment(BodyRegionV2.NECK) : ItemStack.EMPTY;
|
||||
cap != null
|
||||
? cap.getEquipment(BodyRegionV2.NECK)
|
||||
: ItemStack.EMPTY;
|
||||
|
||||
if (
|
||||
!collar.isEmpty() &&
|
||||
|
||||
Reference in New Issue
Block a user