feat(D-01/D): V1 cleanup — delete 28 files, ~5400 lines removed

D1: ThreadLocal alert suppression moved from ItemCollar to CollarHelper.
    onCollarRemoved() logic (kidnapper alert) moved to CollarHelper.

D2+D3: Deleted 17 V1 item classes + 4 V1-only interfaces:
  ItemBind, ItemGag, ItemBlindfold, ItemCollar, ItemEarplugs, ItemMittens,
  ItemColor, ItemClassicCollar, ItemShockCollar, ItemShockCollarAuto,
  ItemGpsCollar, ItemChokeCollar, ItemHood, ItemMedicalGag,
  IBondageItem, IHasGaggingEffect, IHasBlindingEffect, IAdjustable

D4: KidnapperTheme/KidnapperItemSelector/DispenserBehaviors migrated
    from variant enums to string-based DataDrivenItemRegistry IDs.

D5: Deleted 11 variant enums + Generic* factories + ItemBallGag3D:
  BindVariant, GagVariant, BlindfoldVariant, EarplugsVariant, MittensVariant,
  GenericBind, GenericGag, GenericBlindfold, GenericEarplugs, GenericMittens

D6: ModItems cleaned — all V1 bondage registrations removed.
D7: ModCreativeTabs rewritten — iterates DataDrivenItemRegistry.
D8+D9: All V2 helpers cleaned (V1 fallbacks removed), orphan imports removed.

Zero V1 bondage code references remain (only Javadoc comments).
All bondage items are now data-driven via 47 JSON definitions.
This commit is contained in:
NotEvil
2026-04-15 01:55:16 +02:00
parent fccb99ef9a
commit 099cd0d984
89 changed files with 2647 additions and 5423 deletions

View File

@@ -166,11 +166,8 @@ public class PacketTighten {
// Check if sender owns collar
if (!hasPermission && closestState.hasCollar()) {
var collarStack = closestState.getEquipment(BodyRegionV2.NECK);
if (
collarStack.getItem() instanceof
com.tiedup.remake.items.base.ItemCollar collar
) {
if (collar.isOwner(collarStack, tightener)) {
if (com.tiedup.remake.v2.bondage.CollarHelper.isCollar(collarStack)) {
if (com.tiedup.remake.v2.bondage.CollarHelper.isOwner(collarStack, tightener)) {
hasPermission = true;
}
}

View File

@@ -2,7 +2,6 @@ package com.tiedup.remake.network.item;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.AdjustmentHelper;
import com.tiedup.remake.items.base.IAdjustable;
import com.tiedup.remake.network.sync.SyncManager;
import com.tiedup.remake.state.PlayerBindState;
import com.tiedup.remake.v2.BodyRegionV2;
@@ -152,7 +151,7 @@ public class PacketAdjustItem {
return;
}
if (!(stack.getItem() instanceof IAdjustable)) {
if (!AdjustmentHelper.isAdjustable(stack)) {
TiedUpMod.LOGGER.warn(
"[PACKET] PacketAdjustItem: Item {} is not adjustable",
stack.getItem()

View File

@@ -3,7 +3,6 @@ package com.tiedup.remake.network.item;
import com.tiedup.remake.core.SystemMessageManager;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.AdjustmentHelper;
import com.tiedup.remake.items.base.IAdjustable;
import com.tiedup.remake.network.sync.SyncManager;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.state.PlayerBindState;
@@ -195,7 +194,7 @@ public class PacketAdjustRemote {
return;
}
if (!(stack.getItem() instanceof IAdjustable)) {
if (!AdjustmentHelper.isAdjustable(stack)) {
TiedUpMod.LOGGER.warn(
"[PACKET] PacketAdjustRemote: Item {} is not adjustable",
stack.getItem()
@@ -255,11 +254,8 @@ public class PacketAdjustRemote {
ItemStack collarStack = kidnapped.getEquipment(
BodyRegionV2.NECK
);
if (
collarStack.getItem() instanceof
com.tiedup.remake.items.base.ItemCollar collar
) {
if (collar.isOwner(collarStack, sender)) {
if (com.tiedup.remake.v2.bondage.CollarHelper.isCollar(collarStack)) {
if (com.tiedup.remake.v2.bondage.CollarHelper.isOwner(collarStack, sender)) {
return kidnapped;
}
}

View File

@@ -454,9 +454,7 @@ public class PacketLockpickAttempt {
);
if (collar.isEmpty()) return;
if (
collar.getItem() instanceof com.tiedup.remake.items.ItemShockCollar
) {
if (com.tiedup.remake.v2.bondage.CollarHelper.canShock(collar)) {
state.shockKidnapped(" (Failed lockpick attempt)", 2.0f);
TiedUpMod.LOGGER.info(
"[PacketLockpickAttempt] Player {} shocked for failed lockpick",

View File

@@ -70,11 +70,8 @@ public class PacketRequestNpcInventory {
// Verify player is owner of collar (or NPC has no collar)
if (damsel.hasCollar()) {
ItemStack collar = damsel.getEquipment(BodyRegionV2.NECK);
if (
collar.getItem() instanceof
com.tiedup.remake.items.base.ItemCollar collarItem
) {
if (!collarItem.isOwner(collar, player)) {
if (com.tiedup.remake.v2.bondage.CollarHelper.isCollar(collar)) {
if (!com.tiedup.remake.v2.bondage.CollarHelper.isOwner(collar, player)) {
TiedUpMod.LOGGER.warn(
"[PacketRequestNpcInventory] Player {} is not owner of NPC collar",
player.getName().getString()

View File

@@ -2,7 +2,7 @@ package com.tiedup.remake.network.selfbondage;
import com.tiedup.remake.core.SettingsAccessor;
import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.items.base.*;
import com.tiedup.remake.items.base.ILockable;
import com.tiedup.remake.network.ModNetwork;
import com.tiedup.remake.network.PacketRateLimiter;
import com.tiedup.remake.network.action.PacketTying;
@@ -79,141 +79,13 @@ public class PacketSelfBondage {
// V2 bondage items — use tying task with V2 equip
if (item instanceof IV2BondageItem v2Item) {
handleV2SelfBondage(player, stack, v2Item, state);
return;
}
// V1 routes below (legacy)
if (item instanceof ItemBind bind) {
handleSelfBind(player, stack, bind, state);
} else if (item instanceof ItemGag) {
handleSelfAccessory(
player,
stack,
state,
"gag",
s -> s.isGagged(),
s -> s.getEquipment(BodyRegionV2.MOUTH),
s -> s.unequip(BodyRegionV2.MOUTH),
(s, i) -> s.equip(BodyRegionV2.MOUTH, i)
);
} else if (item instanceof ItemBlindfold) {
handleSelfAccessory(
player,
stack,
state,
"blindfold",
s -> s.isBlindfolded(),
s -> s.getEquipment(BodyRegionV2.EYES),
s -> s.unequip(BodyRegionV2.EYES),
(s, i) -> s.equip(BodyRegionV2.EYES, i)
);
} else if (item instanceof ItemMittens) {
handleSelfAccessory(
player,
stack,
state,
"mittens",
s -> s.hasMittens(),
s -> s.getEquipment(BodyRegionV2.HANDS),
s -> s.unequip(BodyRegionV2.HANDS),
(s, i) -> s.equip(BodyRegionV2.HANDS, i)
);
} else if (item instanceof ItemEarplugs) {
handleSelfAccessory(
player,
stack,
state,
"earplugs",
s -> s.hasEarplugs(),
s -> s.getEquipment(BodyRegionV2.EARS),
s -> s.unequip(BodyRegionV2.EARS),
(s, i) -> s.equip(BodyRegionV2.EARS, i)
);
}
// ItemCollar: NOT handled - cannot self-collar
// V1 routes removed — all bondage items are now V2/data-driven
});
ctx.get().setPacketHandled(true);
}
/**
* Handle self-binding with a bind item (rope, chain, etc.).
* Uses tying task system - requires holding left-click.
*/
private static void handleSelfBind(
ServerPlayer player,
ItemStack stack,
ItemBind bind,
IBondageState state
) {
// Can't self-tie if already tied
if (state.isTiedUp()) {
TiedUpMod.LOGGER.debug(
"[SelfBondage] {} tried to self-tie but is already tied",
player.getName().getString()
);
return;
}
// Get player's bind state for tying task management
PlayerBindState playerState = PlayerBindState.getInstance(player);
if (playerState == null) return;
// Get tying duration from GameRule
int tyingSeconds = SettingsAccessor.getTyingPlayerTime(
player.level().getGameRules()
);
// Create self-tying task (target == kidnapper)
TyingPlayerTask newTask = new TyingPlayerTask(
stack.copy(),
state,
player, // Target is self
tyingSeconds,
player.level(),
player // Kidnapper is also self
);
// Get current tying task
TyingTask currentTask = playerState.getCurrentTyingTask();
// Check if we should start a new task or continue existing one
if (
currentTask == null ||
!currentTask.isSameTarget(player) ||
currentTask.isOutdated() ||
!ItemStack.matches(currentTask.getBind(), stack)
) {
// Start new self-tying task
playerState.setCurrentTyingTask(newTask);
newTask.start();
TiedUpMod.LOGGER.debug(
"[SelfBondage] {} started self-tying ({} seconds)",
player.getName().getString(),
tyingSeconds
);
} else {
// Continue existing task
newTask = (TyingPlayerTask) currentTask;
}
// Update task progress
newTask.update();
// Check if task completed
if (newTask.isStopped()) {
// Self-tying complete! Consume the item
stack.shrink(1);
playerState.setCurrentTyingTask(null);
TiedUpMod.LOGGER.info(
"[SelfBondage] {} successfully self-tied",
player.getName().getString()
);
}
}
/**
* Handle self-bondage with a V2 bondage item.
* Uses V2TyingPlayerTask for progress, V2EquipmentHelper for equip.
@@ -355,7 +227,7 @@ public class PacketSelfBondage {
// Can't equip if arms are fully bound (need hands to put on accessories)
ItemStack currentBind = state.getEquipment(BodyRegionV2.ARMS);
if (!currentBind.isEmpty()) {
if (ItemBind.hasArmsBound(currentBind)) {
if (BindModeHelper.hasArmsBound(currentBind)) {
TiedUpMod.LOGGER.debug(
"[SelfBondage] {} can't self-{} - arms are bound",
player.getName().getString(),

View File

@@ -163,12 +163,9 @@ public class PacketSlaveItemManage {
ItemStack collarStack = targetState.getEquipment(
BodyRegionV2.NECK
);
if (
collarStack.getItem() instanceof
com.tiedup.remake.items.base.ItemCollar collar
) {
if (com.tiedup.remake.v2.bondage.CollarHelper.isCollar(collarStack)) {
if (
!collar.isOwner(collarStack, sender) &&
!com.tiedup.remake.v2.bondage.CollarHelper.isOwner(collarStack, sender) &&
!sender.hasPermissions(2)
) {
TiedUpMod.LOGGER.debug(
@@ -437,15 +434,14 @@ public class PacketSlaveItemManage {
if (
region == BodyRegionV2.ARMS &&
itemStack.getItem() instanceof
com.tiedup.remake.items.base.ItemBind bind
itemStack.getItem() instanceof com.tiedup.remake.items.base.IHasResistance resistanceItem
) {
int currentResistance = bind.getCurrentResistance(
int currentResistance = resistanceItem.getCurrentResistance(
itemStack,
target
);
int lockResistance = lockable.getLockResistance(); // Configurable via ModConfig
bind.setCurrentResistance(
resistanceItem.setCurrentResistance(
itemStack,
currentResistance + lockResistance
);
@@ -599,8 +595,7 @@ public class PacketSlaveItemManage {
) {
if (
collarStack.isEmpty() ||
!(collarStack.getItem() instanceof
com.tiedup.remake.items.base.ItemCollar collar)
!com.tiedup.remake.v2.bondage.CollarHelper.isCollar(collarStack)
) {
TiedUpMod.LOGGER.debug(
"[PacketSlaveItemManage] No collar for bondage service toggle"
@@ -609,7 +604,7 @@ public class PacketSlaveItemManage {
}
// Check if cell is configured (required for bondage service)
if (!collar.hasCellAssigned(collarStack)) {
if (!com.tiedup.remake.v2.bondage.CollarHelper.hasCellAssigned(collarStack)) {
TiedUpMod.LOGGER.debug(
"[PacketSlaveItemManage] Cannot enable bondage service: no cell configured"
);
@@ -623,8 +618,8 @@ public class PacketSlaveItemManage {
}
// Toggle bondage service
boolean currentState = collar.isBondageServiceEnabled(collarStack);
collar.setBondageServiceEnabled(collarStack, !currentState);
boolean currentState = com.tiedup.remake.v2.bondage.CollarHelper.isBondageServiceEnabled(collarStack);
com.tiedup.remake.v2.bondage.CollarHelper.setBondageServiceEnabled(collarStack, !currentState);
String newState = !currentState ? "enabled" : "disabled";
TiedUpMod.LOGGER.info(

View File

@@ -243,22 +243,23 @@ public class PacketBuyCaptive {
kidnappedState.getEquipment(BodyRegionV2.NECK);
if (
!collar.isEmpty() &&
collar.getItem() instanceof
com.tiedup.remake.items.base.ItemCollar collarItem
com.tiedup.remake.v2.bondage.CollarHelper.isCollar(collar)
) {
// Remove all existing owners from collar NBT
for (UUID ownerId : new java.util.ArrayList<>(
collarItem.getOwners(collar)
com.tiedup.remake.v2.bondage.CollarHelper.getOwners(collar)
)) {
collarItem.removeOwner(collar, ownerId);
com.tiedup.remake.v2.bondage.CollarHelper.removeOwner(collar, ownerId);
}
// Add buyer as new owner
collarItem.addOwner(
com.tiedup.remake.v2.bondage.CollarHelper.addOwner(
collar,
buyer.getUUID(),
buyer.getName().getString()
);
collarItem.setLocked(collar, false);
if (collar.getItem() instanceof com.tiedup.remake.items.base.ILockable lockable) {
lockable.setLocked(collar, false);
}
// Re-apply modified collar to persist NBT changes
kidnappedState.equip(BodyRegionV2.NECK, collar);