-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ra1 remove #29
Ra1 remove #29
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.
This refactor doesn't look like an improvement to me:
- What used to be a single line is now 5+ lines
- A lot of magic numbers are added, repeatedly. These should be in one place.
- There's no real reason why the original calls couldn't be retained as convenience methods, even if moved.
The best way forward is to add the addNnnRecipe
methods to GregtechPatches
that handle all the constants and the boilerplate, and perform the actual refactor by replacing GT_ModHandler references with GregtechPatches
or the local equivalent
You are like a year and a half late for a discussion on how ra2 works. this is just some final cleanup of the last bits that are left over from ra1. With the hindsight we have now I would say its been a big success. Recipes are much much easier to read and code now, there is much less magic numbers and hidden numbers, ra2 is much more consistent across machines, has better debug capabilities, etc. |
To be fair, that happens a lot with spotless 🧌
I'm not sure which numbers you're referring to. The EU/t, time, etc, is now explicit instead of implicit. It makes it much easier to see at a glance what it'll do rather than being buried in a helper method.
The real reason is maintainability and given all the mods that use RA1 are under our control and maintained by us, it makes life significantly easier to purge RA1 as RA2 is superior on multiple fronts and is being driven by the people who handle most of the recipes.
I have no opinions on this, I'll leave it to Chochem/Boubou/Dream who deal with recipes far more than I do. |
The details on how RA works in the background do not matter here. What I see and what I find offensive to my code is the amount of code duplication: if you suddenly need 5x the space to convey exactly the same idea, you're doing it wrong IMNSHO. |
I strongly disagree. |
GT_ModHandler.addExtractionRecipe(new ItemStack(ModBlocks.flower, 1, i), new ItemStack(ModItems.petal, 2, i)); Without looking, what does that do? GT_Values.RA.stdBuilder()
.itemInputs(new ItemStack(ModBlocks.flower, 1, i))
.itemOutputs(new ItemStack(ModItems.petal, 2, i))
.duration(20 * SECONDS)
.eut(2)
.addTo(extractorRecipes); Now how about that one? Oh, I see what the input is, the output, the duration, and the eu/t. Much better code IMHO. |
|
Quite funny though that on closer inspection, all the complaints about readability are about IC2 machines that have exactly one input and one output - "extract petals from flowers" calls, even if they are not formatted in builder style are quite obvious. In the meantime, all those complex GT machine calls with multi-inputs and fluids and probabilities where all these legibility arguments actually do make sense were left completely untouched, probably because they didn't go through the IC2 wrapping stuff and therefore raised no errors. Stuff's cleaned up to the point where you can see the context of recipes again. Have a nice day |
It's also a draft WIP PR, so those haven't been touched yet I'd wager. |
Compliled against the RA1 removal PR locally, it builds now. |
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.
Some recipes appear to have been dropped
src/main/java/net/fuzzycraft/botanichorizons/patches/GregtechPatches.java
Show resolved
Hide resolved
src/main/java/net/fuzzycraft/botanichorizons/patches/GregtechPatches.java
Show resolved
Hide resolved
Which ones? |
i see no recipes are droped |
change RA1 recipes to RA2
depends on GTNewHorizons/GT5-Unofficial#2713