Closed squeek502 closed 6 years ago
I'll separate the constants I need out of RandomPatches
, but I'll also try and find out what's causing EntityPlayer
to load early.
With sorting index back at 1002 and AppleCore 3.1.4:
[main/DEBUG] [randompatches]: Patching class: net.minecraft.client.Minecraft
[main/DEBUG] [randompatches]: Patching method: func_175609_am
[main/DEBUG] [randompatches]: Patching method: func_152348_aa
[main/INFO] [STDOUT]: [squeek.applecore.asm.module.ModuleFoodStats:transform:30]: Modifying EntityPlayer
[main/DEBUG] [randompatches]: Patching class: net.minecraft.client.gui.GuiIngameMenu
[main/DEBUG] [randompatches]: Patching method: func_146284_a
Also tried eating bread, and it went fine.
I know this is old, but i would like to add that recently in 1.12.2 the mod Oversaturation was the cause of my eating and crashing.
Figured I'd cross-post this from https://github.com/squeek502/AppleCore/issues/129#issuecomment-414212825
This is an issue worth fixing (I know from experience, see https://github.com/squeek502/AppleCore/issues/19)
My best guess is that your coremod/transformer classes are (unintentionally) loading classes that they shouldn't be. Any class that is imported during transformer loading could fail to be transformed by any transformers that have not been registered in the load order.
I put in a debug print that potentially shows the issue. This is the log after SortingIndex is changed to 2000 in RandomPatches:
As you can imagine, if the load orders were reversed, then the
EntityPlayer
class would be sent to transformers before AppleCore's transformer was registered, meaning AppleCore would never have a chance to modify it.Best practice for core mods is to keep them as insular as possible--never import any Minecraft classes or any classes that might import Minecraft classes. Your
RPTransformer
class importscom.therandomlabs.randompatches.RandomPatches
, which in turn importsnet.minecraftforge.client.ClientCommandHandler
/net.minecraftforge.common.MinecraftForge
, which I'm assuming is causing this issue.Changing the sort order will fix it for now, but any coremod with a SortingIndex above yours can have similar conflicts.