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

@@ -3,13 +3,15 @@ package com.tiedup.remake.worldgen;
import com.tiedup.remake.blocks.ModBlocks;
import com.tiedup.remake.blocks.entity.TrappedChestBlockEntity;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.ModItems;
import com.tiedup.remake.items.base.BindVariant;
import com.tiedup.remake.items.base.BlindfoldVariant;
import com.tiedup.remake.items.base.GagVariant;
import com.tiedup.remake.v2.V2Blocks;
import com.tiedup.remake.v2.BodyRegionV2;
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 com.tiedup.remake.v2.blocks.PetCageBlock;
import com.tiedup.remake.v2.blocks.PetCagePartBlock;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@@ -540,34 +542,35 @@ public class HangingCagePiece extends StructurePiece {
BlockEntity be = level.getBlockEntity(chestPos);
if (be instanceof TrappedChestBlockEntity trappedChest) {
// Random bind
BindVariant[] bindVariants = BindVariant.values();
BindVariant chosenBind = bindVariants[random.nextInt(
bindVariants.length
)];
ItemStack bindStack = new ItemStack(ModItems.getBind(chosenBind));
trappedChest.setBind(bindStack);
// Random gag (50% chance)
if (random.nextFloat() < 0.50f) {
GagVariant[] gagVariants = GagVariant.values();
GagVariant chosenGag = gagVariants[random.nextInt(
gagVariants.length
)];
ItemStack gagStack = new ItemStack(ModItems.getGag(chosenGag));
trappedChest.setGag(gagStack);
// Random bind from data-driven ARMS items
List<DataDrivenItemDefinition> binds = DataDrivenItemRegistry.getAll().stream()
.filter(d -> d.occupiedRegions().contains(BodyRegionV2.ARMS))
.collect(Collectors.toList());
if (!binds.isEmpty()) {
DataDrivenItemDefinition chosenBind = binds.get(random.nextInt(binds.size()));
trappedChest.setBind(DataDrivenBondageItem.createStack(chosenBind.id()));
}
// Random blindfold (30% chance)
// Random gag from data-driven MOUTH items (50% chance)
if (random.nextFloat() < 0.50f) {
List<DataDrivenItemDefinition> gags = DataDrivenItemRegistry.getAll().stream()
.filter(d -> d.occupiedRegions().contains(BodyRegionV2.MOUTH))
.collect(Collectors.toList());
if (!gags.isEmpty()) {
DataDrivenItemDefinition chosenGag = gags.get(random.nextInt(gags.size()));
trappedChest.setGag(DataDrivenBondageItem.createStack(chosenGag.id()));
}
}
// Random blindfold from data-driven EYES items (30% chance)
if (random.nextFloat() < 0.30f) {
BlindfoldVariant[] bfVariants = BlindfoldVariant.values();
BlindfoldVariant chosenBf = bfVariants[random.nextInt(
bfVariants.length
)];
ItemStack bfStack = new ItemStack(
ModItems.getBlindfold(chosenBf)
);
trappedChest.setBlindfold(bfStack);
List<DataDrivenItemDefinition> blindfolds = DataDrivenItemRegistry.getAll().stream()
.filter(d -> d.occupiedRegions().contains(BodyRegionV2.EYES))
.collect(Collectors.toList());
if (!blindfolds.isEmpty()) {
DataDrivenItemDefinition chosenBf = blindfolds.get(random.nextInt(blindfolds.size()));
trappedChest.setBlindfold(DataDrivenBondageItem.createStack(chosenBf.id()));
}
}
}
}
@@ -629,22 +632,26 @@ public class HangingCagePiece extends StructurePiece {
entityTag.putUUID("UUID", java.util.UUID.randomUUID());
// Random bind item — the damsel spawns already restrained
BindVariant[] variants = BindVariant.values();
BindVariant chosenBind = variants[random.nextInt(variants.length)];
ItemStack bindStack = new ItemStack(ModItems.getBind(chosenBind));
bindStack.getOrCreateTag().putString("bindMode", "full");
entityTag.put("Bind", bindStack.save(new CompoundTag()));
List<DataDrivenItemDefinition> bindDefs = DataDrivenItemRegistry.getAll().stream()
.filter(d -> d.occupiedRegions().contains(BodyRegionV2.ARMS))
.collect(Collectors.toList());
if (!bindDefs.isEmpty()) {
DataDrivenItemDefinition chosenBind = bindDefs.get(random.nextInt(bindDefs.size()));
ItemStack bindStack = DataDrivenBondageItem.createStack(chosenBind.id());
bindStack.getOrCreateTag().putString("bindMode", "full");
entityTag.put("Bind", bindStack.save(new CompoundTag()));
// Add directly to chunk's pending entity list
ChunkAccess chunk = level.getChunk(masterPos);
if (chunk instanceof ProtoChunk protoChunk) {
protoChunk.addEntity(entityTag);
TiedUpMod.LOGGER.info(
"[HangingCage] Scheduled {} damsel with {} at {}",
shiny ? "shiny" : "regular",
chosenBind.getRegistryName(),
masterPos.toShortString()
);
// Add directly to chunk's pending entity list
ChunkAccess chunk = level.getChunk(masterPos);
if (chunk instanceof ProtoChunk protoChunk) {
protoChunk.addEntity(entityTag);
TiedUpMod.LOGGER.info(
"[HangingCage] Scheduled {} damsel with {} at {}",
shiny ? "shiny" : "regular",
chosenBind.id(),
masterPos.toShortString()
);
}
}
}
}