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:
@@ -1,5 +1,8 @@
|
||||
package com.tiedup.remake.items.base;
|
||||
|
||||
import com.tiedup.remake.v2.bondage.component.AdjustableComponent;
|
||||
import com.tiedup.remake.v2.bondage.component.ComponentType;
|
||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -56,9 +59,12 @@ public class AdjustmentHelper {
|
||||
return tag.getFloat(NBT_ADJUSTMENT_Y);
|
||||
}
|
||||
|
||||
// Fallback to item's default adjustment
|
||||
if (stack.getItem() instanceof IAdjustable adj) {
|
||||
return adj.getDefaultAdjustment();
|
||||
// Fallback to item's default adjustment from V2 AdjustableComponent
|
||||
AdjustableComponent comp = DataDrivenBondageItem.getComponent(
|
||||
stack, ComponentType.ADJUSTABLE, AdjustableComponent.class
|
||||
);
|
||||
if (comp != null) {
|
||||
return comp.getDefaultValue();
|
||||
}
|
||||
|
||||
return DEFAULT_VALUE;
|
||||
@@ -127,16 +133,15 @@ public class AdjustmentHelper {
|
||||
* Check if an ItemStack's item supports adjustment.
|
||||
*
|
||||
* @param stack The ItemStack to check
|
||||
* @return true if the item implements IAdjustable and canBeAdjusted() returns true
|
||||
* @return true if the item has an AdjustableComponent
|
||||
*/
|
||||
public static boolean isAdjustable(ItemStack stack) {
|
||||
if (stack.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (stack.getItem() instanceof IAdjustable adj) {
|
||||
return adj.canBeAdjusted();
|
||||
}
|
||||
return false;
|
||||
return DataDrivenBondageItem.getComponent(
|
||||
stack, ComponentType.ADJUSTABLE, AdjustableComponent.class
|
||||
) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user