``Item#onCraftedBy`` not called upon crafting an item
nonamecrackers2 opened this issue ยท 4 comments
When crafting using ImmersiveMC, the method Item#onCraftedBy
is not called. While only used by maps in the vanilla game, it breaks functionality implemented by other mods that override onCraftedBy
. If you want to replicate the bug, install "Cracker's Wither Storm Mod" (any version), along with ImmersiveMC of course, and try to craft the Formidibomb using a crafting table using the immersive crafting system. The Formidibomb, when hovered over in the inventory menu, should have a timer applied to it, but it does not. This is because onCraftedBy
is not called. Crafting the Formidibomb using the vanilla crafting table GUI does not have this problem.
I believe to fix this issue, all you would need to do is call ItemStack#onCraftedBy
in the Swap
class when an item is crafted by any crafting station. This would also fix items not being counted towards being crafted in the statistics menu.
Looking at this a bit more closely, I may want to do a more ideal call using ResultSlot
so we get both the onCraftedBy()
call and (Neo)Forge's event hooks called.
Would probably be super hack-y though, needs further investigation.
EDIT: Going to skip the event for now. If it's needed by some mod, I'll add it likely by just firing the event directly.