feat(D-01/E): quickwins — debug toggle, HumanChairHelper move, collar equip
Q1: Remove F9 debug toggle from GltfAnimationApplier + delete dead
GltfRenderLayer + remove keybind registration
Q2: Move HumanChairHelper from state/ to util/ — pure utility with
no state dependency. 7 import updates.
Q3: Wire NECK collar equip flow in DataDrivenBondageItem:
- Target must be tied up (V1 rule preserved)
- Distance + line-of-sight validation
- Owner added to NBT before equip via CollarHelper.addOwner()
- V2EquipmentHelper handles conflict resolution
- ModSounds.COLLAR_PUT played on success
- OwnershipComponent.onEquipped registers in CollarRegistry
This commit is contained in:
61
src/main/java/com/tiedup/remake/util/HumanChairHelper.java
Normal file
61
src/main/java/com/tiedup/remake/util/HumanChairHelper.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.tiedup.remake.util;
|
||||
|
||||
import com.tiedup.remake.items.base.PoseType;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Centralizes human chair NBT tag keys and resolution logic.
|
||||
*
|
||||
* <p>The human chair mode is stored as NBT tags on the dog bind item.
|
||||
* This helper eliminates hardcoded string literals scattered across 7+ files.
|
||||
*/
|
||||
public final class HumanChairHelper {
|
||||
|
||||
/** NBT key indicating this bind is in human chair mode */
|
||||
public static final String NBT_KEY = "humanChairMode";
|
||||
|
||||
/** NBT key for the locked facing direction (degrees) */
|
||||
public static final String NBT_FACING_KEY = "humanChairFacing";
|
||||
|
||||
private HumanChairHelper() {}
|
||||
|
||||
/**
|
||||
* Check if a bind item is in human chair mode.
|
||||
*
|
||||
* @param bind The bind ItemStack to check
|
||||
* @return true if the bind has humanChairMode NBT set to true
|
||||
*/
|
||||
public static boolean isActive(ItemStack bind) {
|
||||
if (bind.isEmpty()) return false;
|
||||
CompoundTag tag = bind.getTag();
|
||||
return tag != null && tag.getBoolean(NBT_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the locked facing direction for human chair mode.
|
||||
*
|
||||
* @param bind The bind ItemStack
|
||||
* @return The facing angle in degrees, or 0 if not set
|
||||
*/
|
||||
public static float getFacing(ItemStack bind) {
|
||||
if (bind.isEmpty()) return 0f;
|
||||
CompoundTag tag = bind.getTag();
|
||||
return tag != null ? tag.getFloat(NBT_FACING_KEY) : 0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the effective pose type, overriding DOG to HUMAN_CHAIR
|
||||
* when the bind has humanChairMode enabled.
|
||||
*
|
||||
* @param base The base pose type from the bind item
|
||||
* @param bind The bind ItemStack (checked for humanChairMode NBT)
|
||||
* @return HUMAN_CHAIR if base is DOG and humanChairMode is active, otherwise base
|
||||
*/
|
||||
public static PoseType resolveEffectivePose(PoseType base, ItemStack bind) {
|
||||
if (base == PoseType.DOG && isActive(bind)) {
|
||||
return PoseType.HUMAN_CHAIR;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user