[BUG] Recycling Recipes in the Fluid Extractor Registered Too Late
Describe the bug Hello. I know this repo is mostly dead, but I thought I would share this for anyone programming for GTCE and encountering issues with removing some fluid extractor recipes. Unfortunately, it appears as though some recipes get registered at the very end of the recipe registration sequence, i.e. with very low priority. This includes glass and its derivatives.
Outcome Removal with Crafttweaker for those recipes fails because they would not be found by the CT handler which runs prior to the registration sequence of these recipes. Moreover, mods subscribing to a Forge event with normal priority will not be able to override or remove those recipes either. The current solution I've found was to register an event with the lowest priority (see this for more information). Unfortunately, as I am barely experienced with Forge programming, I cannot suggest a fix at this time. Most likely, RecyclingRecipes class has to be initialized with a higher priority (it is currently initialized with the lowest priority); however, this will have side effects of failing to register recipes for late handlers which might add content (such as Crafttweaker itself).
Recipes are supposed to be registered during RegistryEvent.Register<IRecipe>, but often mods do not do this correctly and if you want compatibility with those mods, recipes have to be registered after they register theirs (and consequently those late-registered recipes are out of reach of CraftTweaker).
We have this problem with Shadows of Greg's Forestry compatibility for example, as Forestry is one such mod registering their recipes out of phase.
Not sure offhand if this is the case here as I've not looked at it yet, but figured it's worth mentioning.
Looking briefly at the code, we are registering during that event, but with the lowest priority. https://github.com/GregTechCE/GregTech/blob/7230afe080702521f35f550abdcabc85ab846817/src/main/java/gregtech/common/CommonProxy.java#L175-L188 You'd have to ensure that anything modifying the recipes registered there runs after that, so yes, you'd have to use the lowest priority too.
I figured that out myself as well after tracing back the places RecyclingRecipes was initialized. However, what baffles me is why do glass recipes specifically generate at such a late phase considering glass is a Vanilla resource (it could be because I also have Forestry along, and Forestry contains liquid glass, but honestly no idea). I have poked around with examining the recipe tree at different stages and it seems that most materials (with the exception of glass) generate their fluid extractor recipes earlier (i.e., with a higher priority).