AgriCraft

AgriCraft

30M Downloads

AppleCoreHelper May Not See AppleCore as Loaded (Possibly Intermittent Issue)

crawford42 opened this issue ยท 2 comments

commented

While testing a private mod pack last night, I noticed that potato and carrot seeds grew at the Vanilla rate rather than the Hunger Overhaul speed. Everything I could find in forums, etc. said it should Just Work, so I started digging into the source.

I believe the static initialization in AppleCoreHelper is being called before the FML Loader has loaded/registered AppleCore, and is getting an incorrect answer as to whether AppleCore is loaded. Static blocks and variable initializations are called when the class is loaded; there's no guarantee as to when that might happen. Sometimes it might be OK, sometimes it won't. It may depend on the order in which the JAR files were added to the mod directory!

I recommend moving this initialization to a static method and calling that method from AgriCraft.postInit, so it's done at a stage when the FML should have AppleCore loaded.

I'll try to have a pull request for this tonight or tomorrow.

commented

You will PR this? okay thanks, I won't touch it then, also please PR it to 1.3-bugfix, thanks.

commented

Looking a bit more, I see the ModIntegration class is a better place to call it from.