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:
@@ -67,9 +67,8 @@ public class CampManagementHandler {
|
||||
long currentTime = level.getGameTime();
|
||||
|
||||
// Get camps that need maid respawn
|
||||
List<UUID> campsNeedingMaid = CampMaidManager.getCampsNeedingMaidRespawn(
|
||||
currentTime, level
|
||||
);
|
||||
List<UUID> campsNeedingMaid =
|
||||
CampMaidManager.getCampsNeedingMaidRespawn(currentTime, level);
|
||||
|
||||
for (UUID campId : campsNeedingMaid) {
|
||||
spawnNewMaidForCamp(level, ownership, campId);
|
||||
|
||||
@@ -91,7 +91,9 @@ public class ForcedSeatingHandler {
|
||||
Entity target = event.getTarget();
|
||||
|
||||
// Furniture handles its own seating — skip forced seating logic
|
||||
if (target instanceof com.tiedup.remake.v2.furniture.ISeatProvider) return;
|
||||
if (
|
||||
target instanceof com.tiedup.remake.v2.furniture.ISeatProvider
|
||||
) return;
|
||||
|
||||
// Only process if Force Seat keybind is pressed
|
||||
if (!isForceSeatPressed(owner)) return;
|
||||
@@ -227,7 +229,10 @@ public class ForcedSeatingHandler {
|
||||
}
|
||||
|
||||
// Furniture manages its own dismount via removePassenger()
|
||||
if (vehicle instanceof com.tiedup.remake.v2.furniture.ISeatProvider) {
|
||||
if (
|
||||
vehicle instanceof
|
||||
com.tiedup.remake.v2.furniture.ISeatProvider
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.tiedup.remake.events.captivity;
|
||||
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.entities.LeashProxyEntity;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.state.IPlayerLeashAccess;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.state.IPlayerLeashAccess;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -110,7 +110,11 @@ public class PlayerEnslavementHandler {
|
||||
}
|
||||
|
||||
// Check if enslavement is enabled
|
||||
if (!SettingsAccessor.isEnslavementEnabled(master.level().getGameRules())) {
|
||||
if (
|
||||
!SettingsAccessor.isEnslavementEnabled(
|
||||
master.level().getGameRules()
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,16 +136,16 @@ public class PlayerEnslavementHandler {
|
||||
|
||||
ItemStack heldItem = master.getItemInHand(event.getHand());
|
||||
|
||||
// ========================================
|
||||
// Scenario 1: Enslavement with Lead
|
||||
// ========================================
|
||||
if (heldItem.is(Items.LEAD)) {
|
||||
// Check if target is enslavable (using IBondageState)
|
||||
if (!slaveKidnappedState.isEnslavable()) {
|
||||
// Exception: collar owner can capture even if not tied
|
||||
boolean canCapture = false;
|
||||
if (slaveKidnappedState.hasCollar()) {
|
||||
ItemStack collar = slaveKidnappedState.getEquipment(BodyRegionV2.NECK);
|
||||
ItemStack collar = slaveKidnappedState.getEquipment(
|
||||
BodyRegionV2.NECK
|
||||
);
|
||||
if (collar.getItem() instanceof ItemCollar collarItem) {
|
||||
if (
|
||||
collarItem
|
||||
@@ -161,7 +165,6 @@ public class PlayerEnslavementHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 17: Check if not already captured (Player-specific check)
|
||||
if (slaveState.isCaptive()) {
|
||||
TiedUpMod.LOGGER.debug(
|
||||
"[PlayerEnslavementHandler] {} is already captured",
|
||||
@@ -191,14 +194,10 @@ public class PlayerEnslavementHandler {
|
||||
);
|
||||
}
|
||||
}
|
||||
// ========================================
|
||||
// Scenario 2: Freeing with Empty Hand
|
||||
// ========================================
|
||||
else if (heldItem.isEmpty()) {
|
||||
// Phase 17: isSlave → isCaptive
|
||||
if (!slaveState.isCaptive()) return;
|
||||
|
||||
// Phase 17: getMaster → getCaptor, getSlaveHolderManager → getCaptorManager
|
||||
if (slaveState.getCaptor() != masterState.getCaptorManager()) {
|
||||
TiedUpMod.LOGGER.debug(
|
||||
"[PlayerEnslavementHandler] {} tried to free {} but is not the captor",
|
||||
@@ -221,7 +220,6 @@ public class PlayerEnslavementHandler {
|
||||
/**
|
||||
* Periodic check for enslaved players.
|
||||
*
|
||||
* Phase 14.1.5: Remains PlayerBindState-specific (enslavement system is Player-only)
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
@@ -233,11 +231,9 @@ public class PlayerEnslavementHandler {
|
||||
PlayerBindState state = PlayerBindState.getInstance(player);
|
||||
if (state == null) return;
|
||||
|
||||
// Phase 17: isSlave → isCaptive, checkStillSlave → checkStillCaptive
|
||||
if (state.isCaptive()) {
|
||||
state.checkStillCaptive();
|
||||
}
|
||||
// Phase 17: getSlaveHolderManager → getCaptorManager, cleanupInvalidSlaves → cleanupInvalidCaptives
|
||||
state.getCaptorManager().cleanupInvalidCaptives();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
/**
|
||||
* Server tick handler for dialogue and conversation system maintenance.
|
||||
*
|
||||
* Phase 14: Conversation System
|
||||
*
|
||||
* Handles:
|
||||
* - Cleanup of stale/abandoned conversations
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.state.IRestrainable;
|
||||
import com.tiedup.remake.state.ICaptor;
|
||||
import com.tiedup.remake.state.IRestrainable;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.util.tasks.ItemTask;
|
||||
import net.minecraft.ChatFormatting;
|
||||
@@ -20,7 +20,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
/**
|
||||
* Event handler for player interactions with EntityKidnapper.
|
||||
*
|
||||
* Phase 14.3.5: Sale system interactions
|
||||
*
|
||||
* Handles:
|
||||
* - Right-click on kidnapper selling slave to buy
|
||||
@@ -121,7 +120,6 @@ public class KidnapperInteractionEventHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Phase 17: getSlaveHolderManager → getCaptorManager
|
||||
ICaptor buyerKidnapper = bindState.getCaptorManager();
|
||||
if (buyerKidnapper == null) {
|
||||
TiedUpMod.LOGGER.error(
|
||||
|
||||
@@ -44,7 +44,8 @@ public class CapabilityEventHandler {
|
||||
}
|
||||
|
||||
// V2 bondage equipment capability
|
||||
V2BondageEquipmentProvider v2Provider = new V2BondageEquipmentProvider();
|
||||
V2BondageEquipmentProvider v2Provider =
|
||||
new V2BondageEquipmentProvider();
|
||||
event.addCapability(V2_BONDAGE_EQUIPMENT_ID, v2Provider);
|
||||
event.addListener(v2Provider::invalidate);
|
||||
}
|
||||
@@ -71,7 +72,9 @@ public class CapabilityEventHandler {
|
||||
Player newPlayer = event.getEntity();
|
||||
|
||||
if (event.isWasDeath()) {
|
||||
boolean keepInventory = oldPlayer.level().getGameRules()
|
||||
boolean keepInventory = oldPlayer
|
||||
.level()
|
||||
.getGameRules()
|
||||
.getBoolean(GameRules.RULE_KEEPINVENTORY);
|
||||
|
||||
// === V2 Death Handling ===
|
||||
@@ -81,15 +84,22 @@ public class CapabilityEventHandler {
|
||||
if (keepInventory) {
|
||||
// keepInventory: serialize/deserialize round-trip
|
||||
newPlayer
|
||||
.getCapability(V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT)
|
||||
.getCapability(
|
||||
V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT
|
||||
)
|
||||
.ifPresent(newV2 -> {
|
||||
CompoundTag saved = oldV2.serializeNBT();
|
||||
newV2.deserializeNBT(saved);
|
||||
// Fire onEquipped for each item on the new player
|
||||
for (Map.Entry<BodyRegionV2, ItemStack> entry
|
||||
: newV2.getAllEquipped().entrySet()) {
|
||||
for (Map.Entry<
|
||||
BodyRegionV2,
|
||||
ItemStack
|
||||
> entry : newV2.getAllEquipped().entrySet()) {
|
||||
ItemStack stack = entry.getValue();
|
||||
if (stack.getItem() instanceof IV2BondageItem v2Item) {
|
||||
if (
|
||||
stack.getItem() instanceof
|
||||
IV2BondageItem v2Item
|
||||
) {
|
||||
v2Item.onEquipped(stack, newPlayer);
|
||||
}
|
||||
}
|
||||
@@ -99,10 +109,13 @@ public class CapabilityEventHandler {
|
||||
});
|
||||
} else {
|
||||
// No keepInventory: fire onUnequipped for each V2 item
|
||||
for (Map.Entry<BodyRegionV2, ItemStack> entry
|
||||
: oldV2.getAllEquipped().entrySet()) {
|
||||
for (Map.Entry<BodyRegionV2, ItemStack> entry : oldV2
|
||||
.getAllEquipped()
|
||||
.entrySet()) {
|
||||
ItemStack stack = entry.getValue();
|
||||
if (stack.getItem() instanceof IV2BondageItem v2Item) {
|
||||
if (
|
||||
stack.getItem() instanceof IV2BondageItem v2Item
|
||||
) {
|
||||
v2Item.onUnequipped(stack, oldPlayer);
|
||||
}
|
||||
}
|
||||
@@ -124,15 +137,20 @@ public class CapabilityEventHandler {
|
||||
.getCapability(V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT)
|
||||
.ifPresent(oldV2 -> {
|
||||
newPlayer
|
||||
.getCapability(V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT)
|
||||
.getCapability(
|
||||
V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT
|
||||
)
|
||||
.ifPresent(newV2 -> {
|
||||
CompoundTag saved = oldV2.serializeNBT();
|
||||
newV2.deserializeNBT(saved);
|
||||
// Fire onEquipped for each item on the new player
|
||||
for (Map.Entry<BodyRegionV2, ItemStack> entry
|
||||
: newV2.getAllEquipped().entrySet()) {
|
||||
for (Map.Entry<BodyRegionV2, ItemStack> entry : newV2
|
||||
.getAllEquipped()
|
||||
.entrySet()) {
|
||||
ItemStack stack = entry.getValue();
|
||||
if (stack.getItem() instanceof IV2BondageItem v2Item) {
|
||||
if (
|
||||
stack.getItem() instanceof IV2BondageItem v2Item
|
||||
) {
|
||||
v2Item.onEquipped(stack, newPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,9 @@ public class PlayerDisconnectHandler {
|
||||
com.tiedup.remake.v2.blocks.PetBedManager.onPlayerDisconnect(playerId);
|
||||
|
||||
// Clean up active conversations
|
||||
com.tiedup.remake.dialogue.conversation.ConversationManager.cleanupPlayer(playerId);
|
||||
com.tiedup.remake.dialogue.conversation.ConversationManager.cleanupPlayer(
|
||||
playerId
|
||||
);
|
||||
|
||||
// Clean up cell selection mode
|
||||
com.tiedup.remake.cells.CellSelectionManager.cleanup(playerId);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.tiedup.remake.events.lifecycle;
|
||||
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2BondageEquipmentProvider;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.EntityMaster;
|
||||
import com.tiedup.remake.entities.ModEntities;
|
||||
import com.tiedup.remake.state.IPlayerLeashAccess;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2BondageEquipmentProvider;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -45,7 +45,6 @@ public class PlayerLifecycleHandler {
|
||||
PlayerBindState state = PlayerBindState.getInstance(player);
|
||||
if (state == null) return;
|
||||
|
||||
// Phase 17: CASE 1: This player is a Captor - free all their captives
|
||||
if (state.getCaptorManager().hasCaptives()) {
|
||||
TiedUpMod.LOGGER.info(
|
||||
"[Lifecycle] Captor {} disconnected. Freeing all captives.",
|
||||
@@ -65,7 +64,9 @@ public class PlayerLifecycleHandler {
|
||||
if (holder instanceof LeashFenceKnotEntity fenceKnot) {
|
||||
BlockPos polePos = fenceKnot.getPos();
|
||||
player
|
||||
.getCapability(V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT)
|
||||
.getCapability(
|
||||
V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT
|
||||
)
|
||||
.ifPresent(cap -> {
|
||||
cap.savePoleLeash(polePos, player.level().dimension());
|
||||
TiedUpMod.LOGGER.info(
|
||||
@@ -84,7 +85,9 @@ public class PlayerLifecycleHandler {
|
||||
.getEntity()
|
||||
.getUUID();
|
||||
player
|
||||
.getCapability(V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT)
|
||||
.getCapability(
|
||||
V2BondageEquipmentProvider.V2_BONDAGE_EQUIPMENT
|
||||
)
|
||||
.ifPresent(cap -> {
|
||||
cap.saveCaptorUUID(captorUUID);
|
||||
TiedUpMod.LOGGER.info(
|
||||
@@ -145,9 +148,7 @@ public class PlayerLifecycleHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// MASTER PERSISTENCE CONSTANTS
|
||||
// ========================================
|
||||
|
||||
private static final String NBT_MASTER_DATA = "TiedUp_MasterPersistence";
|
||||
private static final String NBT_MASTER_HAS_MASTER = "HasMaster";
|
||||
@@ -155,9 +156,7 @@ public class PlayerLifecycleHandler {
|
||||
private static final String NBT_MASTER_STATE = "MasterState";
|
||||
private static final String NBT_MASTER_NAME = "MasterName";
|
||||
|
||||
// ========================================
|
||||
// MASTER DISCONNECT HANDLING
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Handle Master entity when pet player disconnects.
|
||||
@@ -254,9 +253,7 @@ public class PlayerLifecycleHandler {
|
||||
persistentData.put(NBT_MASTER_DATA, masterData);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// MASTER RECONNECT HANDLING
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Handle Master restoration when pet player reconnects.
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.tiedup.remake.events.lifecycle;
|
||||
|
||||
import com.tiedup.remake.events.restriction.BondageItemRestrictionHandler;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2BondageEquipmentProvider;
|
||||
import com.tiedup.remake.cells.CampOwnership;
|
||||
import com.tiedup.remake.cells.CellRegistryV2;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.events.restriction.BondageItemRestrictionHandler;
|
||||
import com.tiedup.remake.labor.LaborTask;
|
||||
import com.tiedup.remake.network.ModNetwork;
|
||||
import com.tiedup.remake.network.labor.PacketSyncLaborProgress;
|
||||
@@ -16,6 +14,8 @@ import com.tiedup.remake.prison.PrisonerRecord;
|
||||
import com.tiedup.remake.prison.PrisonerState;
|
||||
import com.tiedup.remake.state.IPlayerLeashAccess;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2BondageEquipmentProvider;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.items.ItemLockpick;
|
||||
import com.tiedup.remake.items.base.IKnife;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.state.IRestrainable;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
|
||||
import com.tiedup.remake.util.GameConstants;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -29,9 +29,9 @@ import net.minecraft.world.level.block.TrapDoorBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
@@ -43,7 +43,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
/**
|
||||
* Unified event handler for all bondage item restrictions.
|
||||
*
|
||||
* Phase 14.4+: Centralized restriction system
|
||||
* Leg Binding: Separate arm/leg restrictions
|
||||
*
|
||||
* This handler manages restrictions based on equipped bondage items:
|
||||
@@ -90,9 +89,7 @@ public class BondageItemRestrictionHandler {
|
||||
Map<MessageCategory, Long>
|
||||
> messageCooldowns = new HashMap<>();
|
||||
|
||||
// ========================================
|
||||
// MOVEMENT RESTRICTIONS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Movement restrictions per tick (throttled to every 5 ticks).
|
||||
@@ -135,9 +132,11 @@ public class BondageItemRestrictionHandler {
|
||||
// === SWIM SPEED RESTRICTION ===
|
||||
if (player.isInWater() && player.isSwimming()) {
|
||||
Vec3 motion = player.getDeltaMovement();
|
||||
player.setDeltaMovement(motion.scale(
|
||||
com.tiedup.remake.core.ModConfig.SERVER.tiedSwimSpeedMultiplier.get()
|
||||
));
|
||||
player.setDeltaMovement(
|
||||
motion.scale(
|
||||
com.tiedup.remake.core.ModConfig.SERVER.tiedSwimSpeedMultiplier.get()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,9 +159,7 @@ public class BondageItemRestrictionHandler {
|
||||
sendRestrictionMessage(player, MessageCategory.NO_ELYTRA);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// INTERACTION RESTRICTIONS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Block breaking restrictions.
|
||||
@@ -334,10 +331,7 @@ public class BondageItemRestrictionHandler {
|
||||
event.setCanceled(true);
|
||||
|
||||
// Kidnapper responds with dialogue
|
||||
kidnapper.talkTo(
|
||||
player,
|
||||
DialogueCategory.ATTACK_SLAVE
|
||||
);
|
||||
kidnapper.talkTo(player, DialogueCategory.ATTACK_SLAVE);
|
||||
|
||||
// Shock the captive/worker
|
||||
IRestrainable playerState = KidnappedHelper.getKidnappedState(
|
||||
@@ -426,12 +420,16 @@ public class BondageItemRestrictionHandler {
|
||||
if (event.getAmount() <= 0) return;
|
||||
|
||||
// Find if this player has a nearby Master who owns them
|
||||
var masters = pet.level().getEntitiesOfClass(
|
||||
com.tiedup.remake.entities.EntityMaster.class,
|
||||
pet.getBoundingBox().inflate(32.0),
|
||||
m -> m.isAlive() && m.hasPet()
|
||||
&& pet.getUUID().equals(m.getStateManager().getPetPlayerUUID())
|
||||
);
|
||||
var masters = pet
|
||||
.level()
|
||||
.getEntitiesOfClass(
|
||||
com.tiedup.remake.entities.EntityMaster.class,
|
||||
pet.getBoundingBox().inflate(32.0),
|
||||
m ->
|
||||
m.isAlive() &&
|
||||
m.hasPet() &&
|
||||
pet.getUUID().equals(m.getStateManager().getPetPlayerUUID())
|
||||
);
|
||||
|
||||
for (var master : masters) {
|
||||
master.onPetHurt(event.getSource(), event.getAmount());
|
||||
@@ -483,9 +481,7 @@ public class BondageItemRestrictionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// HELPER METHODS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Check if a block interaction should be allowed when tied.
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.tiedup.remake.prison.PrisonerManager;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -20,6 +19,7 @@ import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Event handler for labor tool protection.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.entities.EntityMaster;
|
||||
import com.tiedup.remake.items.ItemChokeCollar;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.blocks.PetBedManager;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -50,9 +50,7 @@ public class PetPlayRestrictionHandler {
|
||||
private static final java.util.Map<java.util.UUID, Long> lastMessageTime =
|
||||
new java.util.HashMap<>();
|
||||
|
||||
// ========================================
|
||||
// EATING RESTRICTION
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Prevent pet play players from eating food from hand.
|
||||
@@ -156,9 +154,7 @@ public class PetPlayRestrictionHandler {
|
||||
// Pet bed interaction (carpet placeholder) - handled in sleep event
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// SLEEPING RESTRICTION
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Prevent pet play players from sleeping in normal beds.
|
||||
@@ -264,9 +260,7 @@ public class PetPlayRestrictionHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// CHOKE COLLAR EFFECT
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Apply choke collar effect on player tick.
|
||||
@@ -318,9 +312,7 @@ public class PetPlayRestrictionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// UTILITY
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* BUG FIX: Clean up player data to prevent memory leak.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.minigame.StruggleSessionManager;
|
||||
@@ -15,7 +15,7 @@ import com.tiedup.remake.tasks.UntyingPlayerTask;
|
||||
import com.tiedup.remake.tasks.UntyingTask;
|
||||
import com.tiedup.remake.util.GameConstants;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -228,7 +228,6 @@ public class RestraintTaskTickHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Phase 13: Auto-shock collar logic (Player-specific feature)
|
||||
if (playerState != null) {
|
||||
playerState.checkAutoShockCollar();
|
||||
}
|
||||
@@ -284,9 +283,7 @@ public class RestraintTaskTickHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// SECURITY: Distance and line-of-sight validation
|
||||
// ========================================
|
||||
double maxUntieDistance = 4.0; // Max distance to untie (blocks)
|
||||
double distance = helper.distanceTo(targetEntity);
|
||||
if (distance > maxUntieDistance) {
|
||||
@@ -310,7 +307,10 @@ public class RestraintTaskTickHandler {
|
||||
}
|
||||
|
||||
// Check for Kidnapper fight back - block untying if Kidnapper is nearby
|
||||
if (targetEntity instanceof com.tiedup.remake.entities.AbstractTiedUpNpc npc) {
|
||||
if (
|
||||
targetEntity instanceof
|
||||
com.tiedup.remake.entities.AbstractTiedUpNpc npc
|
||||
) {
|
||||
if (
|
||||
npc.getCaptor() instanceof EntityKidnapper kidnapper &&
|
||||
kidnapper.isAlive()
|
||||
@@ -413,9 +413,11 @@ public class RestraintTaskTickHandler {
|
||||
// Get untying duration (default: 10 seconds)
|
||||
int untyingSeconds = getUntyingDuration(helper);
|
||||
|
||||
// Phase 11: Check collar ownership for TiedUp NPCs
|
||||
// Non-owners take 3x longer and trigger alert to owners
|
||||
if (targetEntity instanceof com.tiedup.remake.entities.AbstractTiedUpNpc npc) {
|
||||
if (
|
||||
targetEntity instanceof
|
||||
com.tiedup.remake.entities.AbstractTiedUpNpc npc
|
||||
) {
|
||||
if (!npc.isCollarOwner(helper)) {
|
||||
// Non-owner: triple the untying time
|
||||
untyingSeconds *= 3;
|
||||
@@ -513,7 +515,9 @@ public class RestraintTaskTickHandler {
|
||||
* @return Duration in seconds (default: 10)
|
||||
*/
|
||||
private static int getUntyingDuration(Player player) {
|
||||
return SettingsAccessor.getUntyingPlayerTime(player.level().getGameRules());
|
||||
return SettingsAccessor.getUntyingPlayerTime(
|
||||
player.level().getGameRules()
|
||||
);
|
||||
}
|
||||
|
||||
// ========== FORCE FEEDING MECHANIC ==========
|
||||
@@ -627,7 +631,6 @@ public class RestraintTaskTickHandler {
|
||||
|
||||
/**
|
||||
* Alert all collar owners that someone is trying to free their slave.
|
||||
* Phase 11: Multiplayer protection system
|
||||
*
|
||||
* @param slave The slave being freed
|
||||
* @param liberator The player trying to free them
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
/**
|
||||
* Event handler for anvil-based padlock attachment.
|
||||
*
|
||||
* Phase 20: Padlock via Anvil
|
||||
*
|
||||
* Allows combining a bondage item (ILockable) with a Padlock in the anvil
|
||||
* to make the item "lockable". A lockable item can then be locked with a Key.
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.tiedup.remake.events.system;
|
||||
|
||||
import com.tiedup.remake.bounty.Bounty;
|
||||
import com.tiedup.remake.bounty.BountyManager;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.state.PlayerCaptorManager;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import java.util.List;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
@@ -20,7 +20,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
/**
|
||||
* Handles bounty delivery detection and player login events.
|
||||
*
|
||||
* Phase 17: Bounty System
|
||||
*
|
||||
* Detects when:
|
||||
* - A hunter brings a captive near the bounty client
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
/**
|
||||
* Central event handler for Cell System V2 Phase 2.
|
||||
* Central event handler for Cell System V2.
|
||||
*
|
||||
* Handles:
|
||||
* - Selection mode (block click capture for Set Spawn/Delivery/Disguise)
|
||||
|
||||
@@ -5,12 +5,12 @@ import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.dialogue.GagTalkManager;
|
||||
import com.tiedup.remake.items.base.ItemGag;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.util.GagMaterial;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.util.TiedUpUtils;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
|
||||
import java.util.List;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -25,7 +25,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
* ChatEventHandler - Intercepts chat messages to apply gag effects.
|
||||
* Evolution: Implements proximity-based chat for gagged players.
|
||||
*
|
||||
* Phase 14.1.5: Refactored to use IBondageState interface
|
||||
*
|
||||
* Security fix: Now blocks communication commands (/msg, /tell, etc.) when gagged
|
||||
* to prevent gag bypass exploit
|
||||
@@ -70,8 +69,10 @@ public class ChatEventHandler {
|
||||
);
|
||||
|
||||
// 2. Proximity Chat Logic
|
||||
boolean useProximity = SettingsAccessor.isGagTalkProximityEnabled(
|
||||
player.level().getGameRules());
|
||||
boolean useProximity =
|
||||
SettingsAccessor.isGagTalkProximityEnabled(
|
||||
player.level().getGameRules()
|
||||
);
|
||||
|
||||
if (useProximity) {
|
||||
// Cancel global and send to nearby
|
||||
@@ -84,7 +85,6 @@ public class ChatEventHandler {
|
||||
|
||||
double range = material.getTalkRange();
|
||||
|
||||
// Phase 14.2: Use TiedUpUtils for proximity and earplugs filtering
|
||||
List<ServerPlayer> nearbyPlayers =
|
||||
TiedUpUtils.getPlayersAround(
|
||||
player.level(),
|
||||
|
||||
@@ -30,7 +30,10 @@ public class MiniGameTickHandler {
|
||||
long currentTick = event.getServer().getTickCount();
|
||||
|
||||
// Tick continuous struggle sessions every tick
|
||||
StruggleSessionManager.getInstance().tickContinuousSessions(event.getServer(), currentTick);
|
||||
StruggleSessionManager.getInstance().tickContinuousSessions(
|
||||
event.getServer(),
|
||||
currentTick
|
||||
);
|
||||
|
||||
// Cleanup expired sessions periodically
|
||||
StruggleSessionManager.getInstance().tickCleanup(currentTick);
|
||||
|
||||
Reference in New Issue
Block a user