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,6 +1,5 @@
|
||||
package com.tiedup.remake.client.events;
|
||||
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.network.ModNetwork;
|
||||
import com.tiedup.remake.network.selfbondage.PacketSelfBondage;
|
||||
import com.tiedup.remake.v2.bondage.BindModeHelper;
|
||||
@@ -166,8 +165,8 @@ public class SelfBondageInputHandler {
|
||||
private static boolean isSelfBondageItem(ItemStack stack) {
|
||||
if (stack.isEmpty()) return false;
|
||||
|
||||
// Collar cannot be self-equipped (V1 collar guard + V2 ownership component)
|
||||
if (stack.getItem() instanceof ItemCollar || CollarHelper.isCollar(stack)) {
|
||||
// Collar cannot be self-equipped (V2 ownership component)
|
||||
if (CollarHelper.isCollar(stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import static com.tiedup.remake.client.gui.util.GuiLayoutConstants.*;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.tiedup.remake.client.gui.util.GuiColors;
|
||||
import com.tiedup.remake.items.ItemGpsCollar;
|
||||
import com.tiedup.remake.v2.bondage.CollarHelper;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
@@ -370,9 +369,8 @@ public class SlaveEntryWidget
|
||||
// GPS zone status (right of health)
|
||||
if (hasGPSCollar()) {
|
||||
ItemStack collarStack = slave.getEquipment(BodyRegionV2.NECK);
|
||||
if (collarStack.getItem() instanceof ItemGpsCollar gps) {
|
||||
if (CollarHelper.hasGPS(collarStack)) {
|
||||
boolean inSafeZone = isInAnySafeZone(
|
||||
gps,
|
||||
collarStack,
|
||||
entity
|
||||
);
|
||||
@@ -570,17 +568,25 @@ public class SlaveEntryWidget
|
||||
}
|
||||
|
||||
private boolean isInAnySafeZone(
|
||||
ItemGpsCollar gps,
|
||||
ItemStack collarStack,
|
||||
LivingEntity entity
|
||||
) {
|
||||
if (!CollarHelper.isActive(collarStack)) return true;
|
||||
|
||||
var safeSpots = gps.getSafeSpots(collarStack);
|
||||
// Read safe spots from NBT
|
||||
net.minecraft.nbt.CompoundTag tag = collarStack.getTag();
|
||||
if (tag == null || !tag.contains("safeSpots", net.minecraft.nbt.Tag.TAG_LIST)) return true;
|
||||
net.minecraft.nbt.ListTag safeSpots = tag.getList("safeSpots", net.minecraft.nbt.Tag.TAG_COMPOUND);
|
||||
if (safeSpots.isEmpty()) return true;
|
||||
|
||||
for (var spot : safeSpots) {
|
||||
if (spot.isInside(entity)) {
|
||||
for (int i = 0; i < safeSpots.size(); i++) {
|
||||
net.minecraft.nbt.CompoundTag spot = safeSpots.getCompound(i);
|
||||
double x = spot.getDouble("x");
|
||||
double y = spot.getDouble("y");
|
||||
double z = spot.getDouble("z");
|
||||
int radius = spot.contains("radius") ? spot.getInt("radius") : 50;
|
||||
double dist = entity.distanceToSqr(x, y, z);
|
||||
if (dist <= (double) radius * radius) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user