fix(P1+P2): swarm review — UX fixes + V1 dead code cleanup

P1 — UX visible:
- Add 4 missing translations (leather_mittens, ball_gag_3d, taser, debug_wand)
- Fix earplugs resistance bucket: "blindfold" → "earplug"
- Split mixin config: core (require=1) + compat MCA (require=0)
- Bump PROTOCOL_VERSION from "1" to "2"
- Add debug_wand item model (no texture — debug only)
- Fix 3 display_name inconsistencies (chain, vine_seed, shock_collar_auto)

P2 — Dead code cleanup:
- Delete IHas3DModelConfig + Model3DConfig (zero imports)
- Remove MovementStyleResolver.resolveV1Fallback() + V1Fallback record + V1 constants
- Remove AnimationTickHandler V1 fallback block + buildAnimationId()
- Document PlayerEquipment.equipInRegion() bypass as intentional (force-equip paths)
This commit is contained in:
NotEvil
2026-04-16 10:58:44 +02:00
parent d75b74f9f9
commit 371a138b71
16 changed files with 58 additions and 264 deletions

View File

@@ -1,14 +1,10 @@
package com.tiedup.remake.v2.bondage.movement;
import com.tiedup.remake.items.base.PoseType;
import com.tiedup.remake.v2.bondage.BindModeHelper;
import com.tiedup.remake.v2.bondage.PoseTypeHelper;
import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemDefinition;
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenItemRegistry;
import java.util.Map;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.Nullable;
/**
* Resolves the winning movement style from a player's equipped bondage items.
@@ -18,32 +14,15 @@ import org.jetbrains.annotations.Nullable;
*
* <p>The winning item's {@link MovementModifier} (if present) overrides the style's
* default speed/jump values. Modifiers from lower-severity items are ignored.</p>
*
* <h3>V1 Compatibility (H6 fix)</h3>
* <p>V1 items (ItemBind) stored in V2 capability
* do not have data-driven definitions. This resolver provides a fallback that
* maps V1 bind mode + pose type to a {@link MovementStyle} with speed values matching
* the original V1 behavior, preventing double stacking between the legacy
* {@code RestraintEffectUtils} attribute modifier and the V2 modifier.</p>
*/
public final class MovementStyleResolver {
private MovementStyleResolver() {}
// --- V1 fallback speed values ---
// V1 used ADDITION(-0.09) on base 0.10 = 0.01 effective = 10% speed
// Expressed as MULTIPLY_BASE fraction: 0.10
private static final float V1_STANDARD_SPEED = 0.10f;
// V1 used ADDITION(-0.10) on base 0.10 = 0.00 effective = 0% speed
// Expressed as MULTIPLY_BASE fraction: 0.0 (fully immobile)
private static final float V1_IMMOBILIZED_SPEED = 0.0f;
/**
* Resolve the winning movement style from all equipped items.
*
* <p>Checks V2 data-driven definitions first, then falls back to V1 {@link ItemBind}
* introspection for items without data-driven definitions.</p>
* <p>Uses V2 data-driven definitions to determine movement style.</p>
*
* @param equipped map of region to ItemStack (from {@code IV2BondageEquipment.getAllEquipped()})
* @return the resolved movement, or {@link ResolvedMovement#NONE} if no styled items
@@ -66,7 +45,6 @@ public final class MovementStyleResolver {
ItemStack stack = entry.getValue();
if (stack.isEmpty()) continue;
// --- Try V2 data-driven definition first ---
DataDrivenItemDefinition def = DataDrivenItemRegistry.get(stack);
if (def != null && def.movementStyle() != null) {
MovementStyle style = def.movementStyle();
@@ -90,26 +68,6 @@ public final class MovementStyleResolver {
bestSeverity = severity;
bestRegionOrdinal = regionOrdinal;
}
continue;
}
// --- V1 fallback: ItemBind without data-driven definition ---
V1Fallback fallback = resolveV1Fallback(stack);
if (fallback != null) {
int severity = fallback.style.getSeverity();
int regionOrdinal = region.ordinal();
if (
severity > bestSeverity ||
(severity == bestSeverity &&
regionOrdinal < bestRegionOrdinal)
) {
bestStyle = fallback.style;
bestSpeed = fallback.speed;
bestJumpDisabled = fallback.jumpDisabled;
bestSeverity = severity;
bestRegionOrdinal = regionOrdinal;
}
}
}
@@ -119,56 +77,4 @@ public final class MovementStyleResolver {
return new ResolvedMovement(bestStyle, bestSpeed, bestJumpDisabled);
}
// ==================== V1 Fallback ====================
/**
* Attempt to derive a movement style from a V1 bind item.
*
* <p>Only items with legs bound produce a movement style. The mapping preserves
* the original V1 speed values:</p>
* <ul>
* <li>WRAP / LATEX_SACK: SHUFFLE at 0% speed (full immobilization), jump disabled</li>
* <li>DOG / HUMAN_CHAIR: CRAWL at V1 standard speed (10%), jump disabled</li>
* <li>STANDARD / STRAITJACKET: SHUFFLE at 10% speed, jump disabled</li>
* </ul>
*
* @param stack the ItemStack to inspect
* @return fallback resolution, or null if the item is not a V1 bind or legs are not bound
*/
@Nullable
private static V1Fallback resolveV1Fallback(ItemStack stack) {
if (!BindModeHelper.isBindItem(stack)) {
return null;
}
if (!BindModeHelper.hasLegsBound(stack)) {
return null;
}
PoseType poseType = PoseTypeHelper.getPoseType(stack);
return switch (poseType) {
case WRAP, LATEX_SACK -> new V1Fallback(
MovementStyle.SHUFFLE,
V1_IMMOBILIZED_SPEED,
true
);
case DOG, HUMAN_CHAIR -> new V1Fallback(
MovementStyle.CRAWL,
V1_STANDARD_SPEED,
true
);
default ->
// STANDARD, STRAITJACKET: shuffle at V1 standard speed
new V1Fallback(MovementStyle.SHUFFLE, V1_STANDARD_SPEED, true);
};
}
/** Internal holder for V1 fallback resolution result. */
private record V1Fallback(
MovementStyle style,
float speed,
boolean jumpDisabled
) {}
}