Combat Enchantments[Fabric]

Combat Enchantments[Fabric]

258k Downloads

Incompatible with Quilt modloader

Parkanizor opened this issue ยท 6 comments

commented

Minecraft version: 1.19.2
Quilt version: 0.18.1-beta52
Quilted Fabric API version: 4.0.0-beta26
Combat Enchantments version: 2.14.2
Crash Report
Latest Log

Quilt is a fork of the Fabric modloader which is automatically compatible with most mods (out of the 300 I use, only 1 other is incompatible due to a mixin.) Unfortunately, it seems Combat Enchantments has a similar issue, and results in a startup crash. A possible fix would be much appreciated.

commented

I believe I was only using Combat Enchantments and Quilted Fabric API at the time. I usually make fresh instances for debugging crashes like this (and have since deleted that one) but the logs don't seem to show any other mods being present.

commented

I just ran my mod through the quilt mod loader and it worked fine(but I was using the fabric api not quilt). What files did you have in the mods folder at the time of running it?

commented

I just ran my mod through the quilt mod loader and it worked fine(but I was using the fabric api not quilt).

Yep, because it's incompatible with quilt api, not quilt itself.
Here's an important line I found in my log:

[20:47:52] [main/WARN]: @Redirect conflict. Skipping #quilt_item_extension:quilt_item_extension.mixins.json:bow.BowItemMixin from mod quilt_item_extension->@Redirect::redirectPullProgress(ILnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)F with priority 1000, already redirected by #cenchants:cenchants.mixins.json:CenchantsBowItemMixin from mod cenchants->@Redirect::onStoppedUsing(ILnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)F with priority 1000
Basically your bow @Redirect mixin disables quilt's api mixin, which obviously breaks the api.
There can't be two tow @Redirect's targeting the same method call.
This probably can be replaced by a @Inject with cancellation.

commented

Well it wasn't @Inject, but @ModifyVariable worked perfectly fine.
Replace your code with this

@ModifyVariable(at = @At("STORE"), method = "onStoppedUsing", ordinal = 0 )
    public float onStoppedUsing(float value, ItemStack stack, World world, LivingEntity user)
    {
        StatusEffectInstance barrageEffectInstance = user.getStatusEffect(CombatEnchants.BARRAGE_EFFECT);
        if(barrageEffectInstance != null)
        {
            if(barrageEffectInstance.getDuration() >= 20)
            {
                user.removeStatusEffect(CombatEnchants.BARRAGE_EFFECT);
                user.addStatusEffect(new StatusEffectInstance(CombatEnchants.BARRAGE_EFFECT, 20));
            }
            return 1;
        }
        return value;
    }

the result is this same, but doesn't crash with quilt api.
@dsfhdshdjtsb

commented

oh shoot didnt realize people were talking here. @SzczurekYT can you make a pull request with the new code?

commented

I was too lazy to do that as it's just a simple copy paste, but if you want then sure.