feat(D-01/C): consumer migration — 85 files migrated to V2 helpers
Phase 1 (state): PlayerBindState, PlayerCaptorManager, PlayerEquipment, PlayerDataRetrieval, PlayerLifecycle, PlayerShockCollar, StruggleAccessory Phase 2 (client): AnimationTickHandler, NpcAnimationTickHandler, 5 render handlers, DamselModel, 3 client mixins, SelfBondageInputHandler, SlaveManagementScreen, ActionPanel, SlaveEntryWidget, ModKeybindings Phase 3 (entities): 28 entity/AI files migrated to CollarHelper, BindModeHelper, PoseTypeHelper, createStack() Phase 4 (network): PacketSlaveAction, PacketMasterEquip, PacketAssignCellToCollar, PacketNpcCommand, PacketFurnitureForcemount Phase 5 (events): RestraintTaskTickHandler, PetPlayRestrictionHandler, PlayerEnslavementHandler, ChatEventHandler, LaborAttackPunishmentHandler Phase 6 (commands): BondageSubCommand, CollarCommand, NPCCommand, KidnapSetCommand Phase 7 (compat): MCAKidnappedAdapter, MCA mixins Phase 8 (misc): GagTalkManager, PetRequestManager, HangingCagePiece, BondageItemBlockEntity, TrappedChestBlockEntity, DispenserBehaviors, BondageItemLoaderUtility, RestraintApplicator, StruggleSessionManager, MovementStyleResolver, CampLifecycleManager Some files retain dual V1/V2 checks (instanceof V1 || V2Helper) for coexistence — V1-only branches removed in Branch D.
This commit is contained in:
@@ -4,7 +4,7 @@ import com.tiedup.remake.cells.CampLifecycleManager;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.EntityMaid;
|
||||
import com.tiedup.remake.entities.EntitySlaveTrader;
|
||||
import com.tiedup.remake.items.base.ItemBind;
|
||||
import com.tiedup.remake.v2.bondage.BindModeHelper;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -40,7 +40,7 @@ public class CampNpcProtectionHandler {
|
||||
|
||||
// Check if player is holding restraint item
|
||||
ItemStack heldItem = player.getItemInHand(event.getHand());
|
||||
if (!(heldItem.getItem() instanceof ItemBind)) return;
|
||||
if (!BindModeHelper.isBindItem(heldItem)) return;
|
||||
|
||||
// Check if target is trader or maid with active camp
|
||||
UUID campId = null;
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.tiedup.remake.events.captivity;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.LeashProxyEntity;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||
import com.tiedup.remake.state.IPlayerLeashAccess;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
@@ -146,9 +146,9 @@ public class PlayerEnslavementHandler {
|
||||
ItemStack collar = slaveKidnappedState.getEquipment(
|
||||
BodyRegionV2.NECK
|
||||
);
|
||||
if (collar.getItem() instanceof ItemCollar collarItem) {
|
||||
if (CollarHelper.isCollar(collar)) {
|
||||
if (
|
||||
collarItem
|
||||
CollarHelper
|
||||
.getOwners(collar)
|
||||
.contains(master.getUUID())
|
||||
) {
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.entities.EntityMaid;
|
||||
import com.tiedup.remake.entities.EntitySlaveTrader;
|
||||
import com.tiedup.remake.items.base.ItemBind;
|
||||
import com.tiedup.remake.prison.LaborRecord;
|
||||
import com.tiedup.remake.v2.bondage.BindModeHelper;
|
||||
import com.tiedup.remake.prison.PrisonerManager;
|
||||
import com.tiedup.remake.prison.PrisonerRecord;
|
||||
import com.tiedup.remake.prison.PrisonerState;
|
||||
@@ -145,7 +145,7 @@ public class LaborAttackPunishmentHandler {
|
||||
|
||||
// Check if player is holding a restraint item (rope, chain, etc.)
|
||||
ItemStack heldItem = serverPlayer.getItemInHand(hand);
|
||||
if (!(heldItem.getItem() instanceof ItemBind)) {
|
||||
if (!BindModeHelper.isBindItem(heldItem)) {
|
||||
return; // Not a restraint item
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.EntityMaster;
|
||||
import com.tiedup.remake.items.ItemChokeCollar;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.blocks.PetBedManager;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -284,8 +284,8 @@ public class PetPlayRestrictionHandler {
|
||||
if (bindState == null || !bindState.hasCollar()) return;
|
||||
|
||||
ItemStack collar = bindState.getEquipment(BodyRegionV2.NECK);
|
||||
if (collar.getItem() instanceof ItemChokeCollar chokeCollar) {
|
||||
if (chokeCollar.isChoking(collar)) {
|
||||
if (CollarHelper.isChokeCollar(collar)) {
|
||||
if (CollarHelper.isChoking(collar)) {
|
||||
// Apply ChokeEffect (short duration, re-applied each active tick)
|
||||
if (
|
||||
!player.hasEffect(
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.tiedup.remake.events.restriction;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.minigame.StruggleSessionManager;
|
||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||
import com.tiedup.remake.network.ModNetwork;
|
||||
import com.tiedup.remake.network.personality.PacketSlaveBeingFreed;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
@@ -642,14 +642,11 @@ public class RestraintTaskTickHandler {
|
||||
if (!(slave.level() instanceof ServerLevel serverLevel)) return;
|
||||
|
||||
ItemStack collar = slave.getEquipment(BodyRegionV2.NECK);
|
||||
if (
|
||||
collar.isEmpty() ||
|
||||
!(collar.getItem() instanceof ItemCollar collarItem)
|
||||
) {
|
||||
if (collar.isEmpty() || !CollarHelper.isCollar(collar)) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<UUID> owners = collarItem.getOwners(collar);
|
||||
List<UUID> owners = CollarHelper.getOwners(collar);
|
||||
if (owners.isEmpty()) return;
|
||||
|
||||
// Create alert packet
|
||||
|
||||
@@ -7,6 +7,9 @@ import com.tiedup.remake.dialogue.GagTalkManager;
|
||||
import com.tiedup.remake.items.base.ItemGag;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.util.GagMaterial;
|
||||
import com.tiedup.remake.v2.bondage.component.ComponentType;
|
||||
import com.tiedup.remake.v2.bondage.component.GaggingComponent;
|
||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.util.TiedUpUtils;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
@@ -54,12 +57,22 @@ public class ChatEventHandler {
|
||||
BodyRegionV2.MOUTH
|
||||
);
|
||||
|
||||
if (
|
||||
!gagStack.isEmpty() &&
|
||||
gagStack.getItem() instanceof ItemGag gagItem
|
||||
) {
|
||||
// V2: check gagging component, V1 fallback: instanceof ItemGag
|
||||
GaggingComponent gaggingComp = DataDrivenBondageItem.getComponent(
|
||||
gagStack, ComponentType.GAGGING, GaggingComponent.class);
|
||||
boolean isGagItem = gaggingComp != null
|
||||
|| gagStack.getItem() instanceof ItemGag;
|
||||
|
||||
if (!gagStack.isEmpty() && isGagItem) {
|
||||
String originalMessage = event.getRawText();
|
||||
GagMaterial material = gagItem.getGagMaterial();
|
||||
// V2: get material from component, V1 fallback: from ItemGag
|
||||
GagMaterial material = null;
|
||||
if (gaggingComp != null) {
|
||||
material = gaggingComp.getMaterial();
|
||||
}
|
||||
if (material == null && gagStack.getItem() instanceof ItemGag gagItem) {
|
||||
material = gagItem.getGagMaterial();
|
||||
}
|
||||
|
||||
// 1. Process the message through our GagTalkManager V2
|
||||
Component muffledMessage = GagTalkManager.processGagMessage(
|
||||
@@ -83,7 +96,9 @@ public class ChatEventHandler {
|
||||
.append("> ")
|
||||
.append(muffledMessage);
|
||||
|
||||
double range = material.getTalkRange();
|
||||
double range = material != null
|
||||
? material.getTalkRange()
|
||||
: (gaggingComp != null ? gaggingComp.getRange() : 10.0);
|
||||
|
||||
List<ServerPlayer> nearbyPlayers =
|
||||
TiedUpUtils.getPlayersAround(
|
||||
|
||||
Reference in New Issue
Block a user