Shadows-of-Fire / Apotheosis

All things that should have been.
Other
169 stars 128 forks source link

Crash while trying to add Apotheosis affix to Mjöllnir #1157

Closed noeppi-noeppi closed 7 months ago

noeppi-noeppi commented 7 months ago

This is a duplicate of #929 which, contrary to what is said there, is still is not fixed in the latest 1.20.1 version. The problem is a stack overflow involving an apotheosis mixin to EnchantmentHelper:

The crash can be triggered by putting Mjöllnir into a reforging table and hover over the suggested affix combinations.

I want this issue to be fixed, however, I can't see any good way to do that in MythicBotany, therefore it would be great if Apotheosis could provide some way (maybe through IMC) in which a mod can set the default LootCategory of an item preventing the validators from being called. This would allow me to set the loot category of Mjöllnir to SWORD manually and prevent the infinite loop.

FireFrost76 commented 7 months ago

Thanks in advance for looking into this guys , Love both the mods

Shadows-of-Fire commented 7 months ago

The previous issue was caused by the same circularity issue but with enchantment levels rather than getDamageBonus - my opinion here is that you should not be calling getDamageBonus in this method, as it will cause the actual attack damage of the item to be 2x * getDamageBonus (which is probably unintentional).

noeppi-noeppi commented 7 months ago

as it will cause the actual attack damage of the item to be 2x * getDamageBonus

I know that and it is intentional.

FireFrost76 commented 7 months ago

it does it with no enchants on it also , just clicking the reforger , any level of reforging a plain hammer , with no enchants causes the crash also , this is in ATM 9 , but the previous one was in atm 7 ? one of the ATM worked perfect I think it was 6 no crashes at all from enchanted or unenchanted . 2x dmg is great , silent gears weapons do 5-8k , and the morgan is capped recently to 5k do the damage isnt a big deal .

Shadows-of-Fire commented 7 months ago

IMC method loot_category_override has been added to Apoth for 7.3.0 - the payload is a Map.Entry<Item, String> where the string is a loot category ID ("sword" in this case).