TheWinABagel / ZenithAttributes

A port of Apotheosis attributes to fabric
MIT License
2 stars 5 forks source link

[0.2.5] Redirect conflict with Obscure API #32

Closed muon-rw closed 1 month ago

muon-rw commented 1 month ago

Critical injection failure: Redirector penetration(FFF)F in obscure_api.mixins.json:attributes.LivingEntityMixin from mod obscure_api failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap obscureapi-refmap.json

It seems that https://github.com/TheWinABagel/ZenithAttributes/commit/fbebc7e781b210b04da6a9037319f780e1d08f7c changing zenith_attributes$applyArmorPenplyArmorPen from @ModifyExpressionValue to @Redirect is the source of the conflict.

I'm not sure if this was an intentional or an accidental regression from the refactor.

from ObscureAPI:

        method = {"applyArmorToDamage"},
        at = @At(
    value = "INVOKE",
    target = "Lnet/minecraft/entity/DamageUtil;getDamageLeft(FFF)F"
)
    )
    private float penetration(float damage, float armor, float armorToughness) {
        if (this.sourceApplyArmorToDamage == null) {
            return class_1280.method_5496(damage, armor, armorToughness);
        } else {
            class_1297 var6 = this.sourceApplyArmorToDamage.method_5526();
            float var10000;
            if (var6 instanceof class_1309) {
                class_1309 living = (class_1309)var6;
                var10000 = ObscureAPIAttributes.getPenetration(living);
            } else {
                var10000 = 0.0F;
            }

            float penetration = var10000;
            return class_1280.method_5496(damage, armor * (1.0F - penetration), armorToughness * (1.0F - penetration));
        }
    }