Crash while trying to add Apotheosis affix to Mjöllnir
noeppi-noeppi opened this issue · 7 comments
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:
- EnchantmentHelperMixin#apoth_getDamageBonus calls
AffixHelper.getAffixeshere. - This causes LootCategory.forItem to be called here.
LootCategory.forItemtests all the validators of the different loot categories in theItemStack, including theSWORDvalidator.- The validator for
LootCategory.SWORDqueries the attribute modifiers here. - Mjöllnir uses
EnchantmentHelper.getDamageBonusin its implementation ofgetAttributeModifiershere. - This causes
EnchantmentHelperMixin#apoth_getDamageBonusto be called forming an infinite loop and crashing with aStackOverflowError.
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.
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).
as it will cause the actual attack damage of the item to be
2x * getDamageBonus
I know that and it is intentional.
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 .
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).
IMC method
loot_category_overridehas been added to Apoth for 7.3.0 - the payload is aMap.Entry<Item, String>where the string is a loot category ID ("sword"in this case).
May I ask for an easy guide to do this as I am unfamiliar with coding that much