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:
NotEvil
2026-04-15 00:16:50 +02:00
parent 52d1044e9a
commit 3d61c9e9e6
85 changed files with 2885 additions and 777 deletions

View File

@@ -1,7 +1,19 @@
package com.tiedup.remake.util;
import com.tiedup.remake.blocks.entity.IBondageItemHolder;
import com.tiedup.remake.items.base.*;
import com.tiedup.remake.items.base.ItemBind;
import com.tiedup.remake.items.base.ItemBlindfold;
import com.tiedup.remake.items.base.ItemCollar;
import com.tiedup.remake.items.base.ItemEarplugs;
import com.tiedup.remake.items.base.ItemGag;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.v2.bondage.BindModeHelper;
import com.tiedup.remake.v2.bondage.CollarHelper;
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.v2.bondage.datadriven.DataDrivenItemDefinition;
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemRegistry;
import java.util.List;
import net.minecraft.ChatFormatting;
import net.minecraft.nbt.CompoundTag;
@@ -41,36 +53,32 @@ public final class BondageItemLoaderUtility {
ItemStack stack,
Player player
) {
if (stack.getItem() instanceof ItemBind && holder.getBind().isEmpty()) {
if ((stack.getItem() instanceof ItemBind || BindModeHelper.isBindItem(stack)) && holder.getBind().isEmpty()) {
holder.setBind(stack.copyWithCount(1));
if (!player.isCreative()) stack.shrink(1);
return true;
}
if (stack.getItem() instanceof ItemGag && holder.getGag().isEmpty()) {
if ((stack.getItem() instanceof ItemGag
|| DataDrivenBondageItem.getComponent(stack, ComponentType.GAGGING, GaggingComponent.class) != null)
&& holder.getGag().isEmpty()) {
holder.setGag(stack.copyWithCount(1));
if (!player.isCreative()) stack.shrink(1);
return true;
}
if (
stack.getItem() instanceof ItemBlindfold &&
holder.getBlindfold().isEmpty()
) {
if ((stack.getItem() instanceof ItemBlindfold || isDataDrivenForRegion(stack, BodyRegionV2.EYES))
&& holder.getBlindfold().isEmpty()) {
holder.setBlindfold(stack.copyWithCount(1));
if (!player.isCreative()) stack.shrink(1);
return true;
}
if (
stack.getItem() instanceof ItemEarplugs &&
holder.getEarplugs().isEmpty()
) {
if ((stack.getItem() instanceof ItemEarplugs || isDataDrivenForRegion(stack, BodyRegionV2.EARS))
&& holder.getEarplugs().isEmpty()) {
holder.setEarplugs(stack.copyWithCount(1));
if (!player.isCreative()) stack.shrink(1);
return true;
}
if (
stack.getItem() instanceof ItemCollar &&
holder.getCollar().isEmpty()
) {
if ((stack.getItem() instanceof ItemCollar || CollarHelper.isCollar(stack))
&& holder.getCollar().isEmpty()) {
holder.setCollar(stack.copyWithCount(1));
if (!player.isCreative()) stack.shrink(1);
return true;
@@ -87,13 +95,28 @@ public final class BondageItemLoaderUtility {
* @return true if the item can be loaded into a bondage item holder
*/
public static boolean isLoadableBondageItem(ItemStack stack) {
return (
(stack.getItem() instanceof ItemBind) ||
(stack.getItem() instanceof ItemGag) ||
(stack.getItem() instanceof ItemBlindfold) ||
(stack.getItem() instanceof ItemEarplugs) ||
(stack.getItem() instanceof ItemCollar)
);
if (stack.isEmpty()) return false;
// V1 item types
if (stack.getItem() instanceof ItemBind
|| stack.getItem() instanceof ItemGag
|| stack.getItem() instanceof ItemBlindfold
|| stack.getItem() instanceof ItemEarplugs
|| stack.getItem() instanceof ItemCollar) {
return true;
}
// V2 data-driven items: bind, gag, blindfold, earplugs, collar
if (BindModeHelper.isBindItem(stack)) return true;
if (DataDrivenBondageItem.getComponent(stack, ComponentType.GAGGING, GaggingComponent.class) != null) return true;
if (isDataDrivenForRegion(stack, BodyRegionV2.EYES)) return true;
if (isDataDrivenForRegion(stack, BodyRegionV2.EARS)) return true;
if (CollarHelper.isCollar(stack)) return true;
return false;
}
/** Check if a stack is a data-driven item occupying the given body region. */
private static boolean isDataDrivenForRegion(ItemStack stack, BodyRegionV2 region) {
DataDrivenItemDefinition def = DataDrivenItemRegistry.get(stack);
return def != null && def.occupiedRegions().contains(region);
}
/**

View File

@@ -2,9 +2,8 @@ package com.tiedup.remake.util;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.IHasResistance;
import com.tiedup.remake.items.base.ItemBind;
import com.tiedup.remake.items.base.ItemCollar;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.v2.bondage.CollarHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.UUID;
import net.minecraft.ChatFormatting;
@@ -60,7 +59,7 @@ public final class RestraintApplicator {
}
// Tighten existing bind - reset resistance to max
if (currentBind.getItem() instanceof ItemBind bindItem) {
if (currentBind.getItem() instanceof IHasResistance bindItem) {
int maxResistance = bindItem.getBaseResistance(target);
state.setCurrentBindResistance(maxResistance);
return true;
@@ -286,11 +285,8 @@ public final class RestraintApplicator {
ItemStack collarCopy = collar.copy();
// Add owner if provided
if (
ownerUUID != null &&
collarCopy.getItem() instanceof ItemCollar collarItem
) {
collarItem.addOwner(
if (ownerUUID != null && CollarHelper.isCollar(collarCopy)) {
CollarHelper.addOwner(
collarCopy,
ownerUUID,
ownerName != null ? ownerName : "Unknown"