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

Incompatability with Trinkets Mod #15

Closed
geeebn opened this issue Jun 21, 2020 · 5 comments
Closed

Incompatability with Trinkets Mod #15

geeebn opened this issue Jun 21, 2020 · 5 comments
Assignees
Labels
mod conflict Conflicts with another mod

Comments

@geeebn
Copy link

geeebn commented Jun 21, 2020

Seems like there is an incompatibility with the Trinkets 2.4.2 Mod
(and The Hallow Mod since it packages Trinkets 2.3.0)
Tried an Instance with just Fabric API, Sewing Machine and Trinkets. Same Issue.
As per my best attempt of capturing logs below

latest.log

Love your mod, seems to be the only fabric server based mod with some form of chunk protections

@GStefanowich
Copy link
Owner

Thanks for including the log file

This seems to be a conflict with both mods overriding how experience applies to armor.

  • I override the method to fix how XP is applied to mending armor pieces, to allow only mending of equipment that is damaged; compared to how vanilla will attempt to "repair" even if the armor is not damaged.
  • Trinkets seems to override it apply XP to any equiped trinkets that the player is wearing

The Trinket mod seems to handle their additional slots very strangely, as there's a dedicated TrinketsApi.getTrinketComponent() method for fetching equipped trinkets, rather than including them in the getEquipment method.

TLDR; I'll have to try and figure out a solution for this, it may just have to be adding a config option to disable my Mixin, so that mending returns to vanilla handling.

@GStefanowich
Copy link
Owner

I've gone ahead and raised an issue with the Trinket mod, as this is a mutual problem.

@emilyploszaj
Copy link

Hi, the 1.16 versions of Trinkets will now no longer load the mixin to prevent this crash. And, in order to make fixing this issue on your side as easy as possible I have created a file, dev.emi.trinkets.extern.TrinketsMending that contains some of the behavior I use to get trinkets. This file was added in Trinkets version 2.6.2. This should make it easy for you to do something like:

if (FabricLoader.getInstance().isModLoaded("trinkets")) {
    // Call a class that imports TrinketsMending and call TrinketsMending.getAllValidEquipment
} else {
    // Get a list of valid equipment like you already do
}
// Pick the item that you want

This way you can build against trinkets but not require it to run your mod. TrinketsMending.getAllValidEquipment returns all vanilla equipment that have taken damage and have mending and all trinkets that have the same. All Trinkets are arbitrarily considered to be in the EquipmentSlot.MAINHAND, but that's not something I think you need to worry about.

@GStefanowich
Copy link
Owner

Sorry for the late response on this, been pretty busy with work this week.

Thanks @emilyploszaj for the code example.

I'll most likely be updating my mods to 1.16 this next weekend, if not earlier. There were a couple features I was working on implementing when 1.16 was released, that I'd like to finish before starting a version update.

@GStefanowich
Copy link
Owner

Cleaning up this issue since spreading out XP was added some time in 1.16 by mojang

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

No branches or pull requests

3 participants