MrCrayfish / GoblinTraders

Adds goblins that trade speical items with the player!
MIT License
52 stars 37 forks source link

[1.18.1] Incompatibility with Apotheosis #54

Closed Shadows-of-Fire closed 2 years ago

Shadows-of-Fire commented 2 years ago

Hi, I believe I'm having a similar issue to #53

Apotheosis allows enchantments to exceed their default max level, but your little anvil mixin prevents that from working at all - because you are imposing a hard cap w.r.t the default max of the enchantment.

Typically I would just point my redirector coremod at your classes calling Enchantment#getMaxLevel and be done with it, however, you are calling it from within a mixin, so that's not a valid option.

https://github.com/MrCrayfish/GoblinTraders/blob/70381543cea4dbd1fa536e25f5eb106b5c307ddc/src/main/java/com/mrcrayfish/goblintraders/mixin/RepairContainerMixin.java#L46-L49

For Apotheosis to be compatible, you would need to place this call in another class, and call that other class from your mixin, (so I can point my coremod at your class, the same as I do with Quark right here.

The other option would be to add a config value on your end that pack makers could flip off. You might also be able to use the anvil events rather than a mixin, which would be easier to add configuration to.

MrCrayfish commented 2 years ago

I can definitely move the method to another class so it can be patched on your end. Does there need to be an exact signature so it can be targetted in your coremod or is it fine keeping it exactly the same (with the addition of a static modifer since it'd be moved)?

Shadows-of-Fire commented 2 years ago

There's no particular requirements, it just needs to be in a non-mixin class so I can point the coremod at it. The coremod scans for any calls to replaced methods (in this case, getMaxLevel) and just redirects them to mine.

khaos-dei commented 2 years ago

Same thing is happening in version 1.16.5

MrCrayfish commented 2 years ago

I saw your messages on Forge Discord, sorry I haven't got around to this. I am quite busy with lots of projects.

MrCrayfish commented 2 years ago

See com.mrcrayfish.goblintraders.Hooks