Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with Quilt modloader #21

Closed
Parkanizor opened this issue Jan 24, 2023 · 6 comments
Closed

Incompatible with Quilt modloader #21

Parkanizor opened this issue Jan 24, 2023 · 6 comments

Comments

@Parkanizor
Copy link

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.

@dsfhdshdjtsb
Copy link
Owner

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?

@Parkanizor
Copy link
Author

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.

@SzczurekYT
Copy link
Contributor

SzczurekYT commented Feb 24, 2023

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.

@SzczurekYT
Copy link
Contributor

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

@dsfhdshdjtsb
Copy link
Owner

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

@SzczurekYT
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants