-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Some Recipes Being Out of Reach of CraftTweaker #133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like following these changes there are no recipes generated in GTCE machines from the Forestry centrifuge and squeezer recipe maps.
The indentation for your changes is also inconsistent with the existing formatting. Please use tabs for indentation and spaces for alignment.
if (!isForestryBeesDisabled()) | ||
proxy.postInit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this block even have any effect after your changes elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is still needed for ClientProxy registering the color handlers of the GT Combs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, you were using it as a stub so ClientProxy could override the superclass method. I forgot to consider the sidedness of the proxy
object's dependency injection, so it looked at a glance like we were unintentionally calling a method whose contents were just entirely moved elsewhere.
I see the issue. Apparently Forestry recipes are similarly generated after it is too late for CraftTweaker. So this means that the Comb Centrifuge and Extractor recipes for Forestry Combs will be out of reach unfortunately. |
It seems like the Forestry devs are still doing bugfixes on 1.12.2 so it might be beneficial to work with them on this. They should be doing their recipe registration during
|
The Forestry devs might still be doing bugfixes on 1.12.2, but they have not released a new version with those bug fixes since April of last year. I think in lieu of that, this PR should be merged and if the Forestry devs ever release a new version for 1.12.2 with the fixes that would be required for this PR, we can then add back the Forestry recipe adjustments as well as upgrade our dependency on the Forestry version. |
Yes, that's a fair point. There also hasn't been any subsequent activity since we filed the bug ticket to Forestry. I worry that because my explanation was a bit poor and Dan needed to correct it after their initial reply, that they are dismissing the problem after more or less replying "what are you on about." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look fine for what we can do right now. We'll need to keep track of whether the Forestry devs choose to address the item registration timing issues and can follow up with fixes if they do.
Unfortunately this means we aren't fully fixing the underlying issue ticket, but we know the nature of the problem now.
This PR restructures the loading order of the Forestry compat, as well as some autogenerated recipes (block compression, packer/unpacker, forge hammer, etc) which were all getting registered on the postInit event fire. Since there was some discussion on this in the issue thread this PR is addressing, I will explain to the best of my knowledge how the recipe registration order behaves.
Following the
preInit
event, Recipe Registration Events under the name ofRegistryEvent.Register<IRecipe>
are fired. These events can be given priorities through the@SubscribeEvent
annotation, but ultimately, all of these events will be fired before CraftTweaker scripts are run (excluding certain loaders, like#loader gregtech
, which is run inpreInit
). All recipe registration is intended to be done in these events, afterpreInit
and beforeinit
. While it is considered bad practice, if for whatever reason recipe generation must go after CraftTweaker, then it should be done as the very first thing on theinit
event firing.Now for whatever reason, these recipes were being registered in the
postInit
event, which is barely in time for JEI to pick them up and put them in its own recipe registry, not to mention well after CraftTweaker has finished running through all of its scripts.Here is a sample script that can be used to prove that the recipes from the original issue are being properly removed:
With this PR, I also verified that all other recipes are reachable by CT, since I did not see any reason why they should be done after. I also restructured the proxy slightly, since much of it was unnecessary and was only spreading the code out making it harder to follow.
Closes #84