-
Notifications
You must be signed in to change notification settings - Fork 212
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
Item Material Information Refactor #2591
base: 1.20.1
Are you sure you want to change the base?
Conversation
# Conflicts: # src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java # src/main/java/com/gregtechceu/gtceu/api/recipe/ToolHeadReplaceRecipe.java # src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java # src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java # src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/GCYMRecipes.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityLoader.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java # src/main/java/com/gregtechceu/gtceu/integration/kjs/GregTechKubeJSPlugin.java
…o yo/material-decomp-refactor # Conflicts: # src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/ComputerRecipes.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityMachineRecipeLoader.java
… into yo/material-decomp-refactor
… into yo/material-decomp-refactor # Conflicts: # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityLoader.java
… into yo/material-decomp-refactor # Conflicts: # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/RecyclingRecipes.java
src/main/java/com/gregtechceu/gtceu/client/renderer/BlockHighlightRenderer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/forge/ForgeCommonEventListener.java
Outdated
Show resolved
Hide resolved
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 no true issues for final commit, but I would definitely like some if statement blocks to be unwrapped and inverted for clarity for statement guarding.
I'll eventually get around to writing more JavaDocs when I don't think I'm gonna fail getting my degree because of capstone 😭
src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java
Outdated
Show resolved
Hide resolved
...a/com/gregtechceu/gtceu/integration/ae2/machine/trait/MEPatternBufferProxyRecipeHandler.java
Outdated
Show resolved
Hide resolved
… into yo/material-decomp-refactor # Conflicts: # src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/CraftingRecipeLoader.java # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MiscRecipeLoader.java
src/main/java/com/gregtechceu/gtceu/integration/kjs/GregTechKubeJSPlugin.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/stack/ItemMaterialInfo.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/stack/MaterialEntry.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/stack/MaterialEntry.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java
Show resolved
Hide resolved
…o where we make recipes for those items
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.
its fine ig
wait for someone to do a thorough review though, I just read changes from last review
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.
logic looks good but run spotlessApply
wrong pr |
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.
you missed a unification entry so the build is failing.
we also need to try and replace those concurrent collections in ItemMaterialData
with fast ones and see if it breaks.
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 want to look over all the streams too - there's a lot of long/nested ones that could probably be simplified. Will do it whenever I get on my pc.
Can you do more extensive testing with and without kube and make sure we didn't need those concurrent maps?
src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/ItemMaterialData.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/stack/MaterialEntry.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/stack/MaterialEntry.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/ItemMaterialData.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/ItemMaterialData.java
Outdated
Show resolved
Hide resolved
...a/com/gregtechceu/gtceu/integration/ae2/machine/trait/MEPatternBufferProxyRecipeHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gregtechceu/gtceu/api/recipe/ingredient/SizedIngredient.java
Outdated
Show resolved
Hide resolved
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 can't mark the line in this review since the file hasn't been changed, but look at MaterialStack.isEmpty()
it checks if the material is air, air is a valid material it should be GTMaterials.NULL
imo.
Also consider adding an empty material stack to MaterialStack
:
public static final MaterialStack EMPTY = new MaterialStack(GTMaterials.NULL, 0);
that way we could make all the material stack helper methods @NotNull
and replace all the materialStack.material() == GTMaterial.Null
checks with materialStack.isEmpty()
which makes more sense and is easier to work with imo.
…aterial-decomp-refactor # Conflicts: # src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java
What
Overhauls and breaks apart the various methods of
ChemicalHelper
into material related functions and the newItemMaterialInfo
methods, also renamesUnificationEntry
to the more suitableMaterialEntry
.Removes most of
MaterialInfoLoader
in favor of the more procedural method of generating item material stacks as mentioned inGTRecipeBuilder
Additional Information
GTRecipeBuilder
s now temporarily store allMaterialStack
information for use in item decomposition information for recycling recipes if desiredItem decomposition material information also no longer depends on recipe order for material computation (ex needing to register iron plate decomp before iron furnace decomp)
GTRecipeBuilder
allows for fluid inputs using aMaterial
andamount
instead of just theFluidStack
if desiredPotential Incompatibilities
KubeJS recipes should be fine out of the box, just need to use the
addMaterialInfo
helper method if they want added decomp