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:
@@ -1,7 +1,7 @@
|
||||
package com.tiedup.remake.state.components;
|
||||
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
|
||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
@@ -87,12 +87,9 @@ public class PlayerDataRetrieval {
|
||||
Player player = host.getPlayer();
|
||||
ItemStack collar = getCurrentCollar();
|
||||
|
||||
if (
|
||||
!collar.isEmpty() &&
|
||||
collar.getItem() instanceof ItemCollar collarItem
|
||||
) {
|
||||
if (!collar.isEmpty() && CollarHelper.isCollar(collar)) {
|
||||
// Try to get nickname from collar NBT
|
||||
String nickname = collarItem.getNickname(collar);
|
||||
String nickname = CollarHelper.getNickname(collar);
|
||||
if (nickname != null && !nickname.isEmpty()) {
|
||||
return nickname;
|
||||
}
|
||||
@@ -109,8 +106,8 @@ public class PlayerDataRetrieval {
|
||||
ItemStack collar = getCurrentCollar();
|
||||
if (collar.isEmpty()) return false;
|
||||
|
||||
if (collar.getItem() instanceof ItemCollar collarItem) {
|
||||
String nickname = collarItem.getNickname(collar);
|
||||
if (CollarHelper.isCollar(collar)) {
|
||||
String nickname = CollarHelper.getNickname(collar);
|
||||
return nickname != null && !nickname.isEmpty();
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.tiedup.remake.state.components;
|
||||
|
||||
import com.tiedup.remake.items.base.ILockable;
|
||||
import com.tiedup.remake.items.base.ItemBind;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.bondage.IV2BondageEquipment;
|
||||
@@ -154,9 +152,9 @@ public class PlayerEquipment {
|
||||
);
|
||||
if (collar.isEmpty()) return ItemStack.EMPTY;
|
||||
|
||||
if (collar.getItem() instanceof ItemCollar collarItem) {
|
||||
if (!force && collarItem.isLocked(collar)) return ItemStack.EMPTY;
|
||||
collarItem.setLocked(collar, false);
|
||||
if (collar.getItem() instanceof ILockable lockable) {
|
||||
if (!force && lockable.isLocked(collar)) return ItemStack.EMPTY;
|
||||
lockable.setLocked(collar, false);
|
||||
}
|
||||
return V2EquipmentHelper.unequipFromRegion(player, BodyRegionV2.NECK);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.tiedup.remake.state.components;
|
||||
import com.tiedup.remake.cells.CampOwnership;
|
||||
import com.tiedup.remake.cells.CellRegistryV2;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.items.base.ItemBind;
|
||||
import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
|
||||
import com.tiedup.remake.v2.bondage.BindModeHelper;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -148,7 +148,7 @@ public class PlayerLifecycle {
|
||||
*/
|
||||
private boolean hasLegsBound(ItemStack bind) {
|
||||
if (bind.isEmpty()) return false;
|
||||
if (!(bind.getItem() instanceof ItemBind)) return false;
|
||||
return ItemBind.hasLegsBound(bind);
|
||||
if (!BindModeHelper.isBindItem(bind)) return false;
|
||||
return BindModeHelper.hasLegsBound(bind);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user