-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add Material Tree JEI page #48
Closed
Closed
Changes from 8 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
8be19b9
Add material tree jei page
kumquat-ir 592f34f
Add fluid and fluid container
kumquat-ir 16f86c5
More material info, revert to DustMaterial, remove fluid containers, …
kumquat-ir e8c2593
first draft layout
kumquat-ir 700a80f
New layout, only show slots that are filled
kumquat-ir b4749e9
Add arrows, clean things up
kumquat-ir f0271b1
Add Unbreaking to base enchant list (#49)
BraggestSage833 4443807
Add Multiblock cached value invalidation on structure deform (#51)
ALongStringOfNumbers b8f69de
Fixed Material Casting and Added RecipeMap Bracket Handler (#47)
idcppl 812b005
suggested improvements
kumquat-ir 0056465
remove `getTimer()` and add `isFirstTick()`
serenibyss b870b15
remove deprecated `IMetaItemStats`
serenibyss ab2f9c0
dump deprecated recipe property methods
serenibyss 3a82954
make recipe properties easier to use
serenibyss 4857d38
remove possible empty spaces between info text
kumquat-ir 0e9d8c7
further small property cleanup
serenibyss 7f6fab9
Implement Item Pipes
brachy84 7b8f5e4
fix lignite composition
serenibyss e09f13d
add Coal Gas and Coal Tar processing
serenibyss 00fa71c
use non-deprecated JEI methods, change icon to aluminium ingot
kumquat-ir 512ae6f
Cleanup the usage of some deprecated JEI method (#54)
ALongStringOfNumbers 4da3dbc
add a ton of fluid pipes
TechLord22 8b840fe
Update some dependencies (#55)
ALongStringOfNumbers ba98780
new quantum chest texture
TechLord22 5b5ec62
Allow Multiblocks to share hatches (#12)
BraggestSage833 09bd434
add steam venting to multiblocks
TechLord22 33770b6
Add recipes for nearly all vanilla items (#56)
TechLord22 a0c0a03
Cleanup findRecipe calls (#57)
ALongStringOfNumbers cf82f95
set `makeObfSourceJar` false
serenibyss 049897d
Material API Overhaul (#58)
serenibyss b7e2f15
MaterialIconSet Specific Fluid Textures (#61)
TechLord22 455cd7b
make less merge conflicts for brachy
serenibyss 93a296d
change some colors and iconsets, add BRIGHT iconset
TechLord22 4aabcb0
add `colorAverage()` builder call
serenibyss 54ba2e9
clean up warnings in RecipeBuilder
serenibyss 1529aae
fix transformer textures not updating properly
TechLord22 eb091ed
fix incorrect gem_vertical fluid sprite registration
TechLord22 8022707
improve transformer rendering update logic
TechLord22 c7fb654
:monkey:
serenibyss bd584ab
de-Enum OrePrefix
serenibyss 64ba7ff
Add material tree jei page
kumquat-ir 7d71d97
Add fluid and fluid container
kumquat-ir c55e24e
More material info, revert to DustMaterial, remove fluid containers, …
kumquat-ir 04b6e94
first draft layout
kumquat-ir 39c57f0
New layout, only show slots that are filled
kumquat-ir 5ee3ad5
Add arrows, clean things up
kumquat-ir 00a4d95
suggested improvements
kumquat-ir 856956c
remove possible empty spaces between info text
kumquat-ir 4cabda1
use non-deprecated JEI methods, change icon to aluminium ingot
kumquat-ir c183803
Merge remote-tracking branch 'origin/materialtree' into materialtree
kumquat-ir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
src/main/java/gregtech/integration/jei/recipe/primitive/MaterialTree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
package gregtech.integration.jei.recipe.primitive; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import gregtech.api.unification.OreDictUnifier; | ||
import gregtech.api.unification.material.type.DustMaterial; | ||
import gregtech.api.unification.material.type.IngotMaterial; | ||
import gregtech.api.unification.ore.OrePrefix; | ||
import mezz.jei.api.ingredients.IIngredients; | ||
import mezz.jei.api.recipe.IRecipeWrapper; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
public class MaterialTree implements IRecipeWrapper { | ||
private final static ImmutableList<OrePrefix> PREFIXES = ImmutableList.of( | ||
OrePrefix.dust, | ||
OrePrefix.dustSmall, | ||
OrePrefix.dustTiny, | ||
OrePrefix.ingotHot, | ||
OrePrefix.ingot, | ||
OrePrefix.gem, | ||
OrePrefix.block, | ||
OrePrefix.stick, | ||
OrePrefix.stickLong, | ||
OrePrefix.spring, | ||
OrePrefix.gemFlawless, | ||
OrePrefix.bolt, | ||
OrePrefix.screw, | ||
OrePrefix.gemExquisite, | ||
OrePrefix.ring, | ||
OrePrefix.gear, | ||
OrePrefix.frameGt, | ||
OrePrefix.nugget, | ||
OrePrefix.pipeNormal, | ||
OrePrefix.plate, | ||
OrePrefix.plateDense, | ||
OrePrefix.gemChipped, | ||
OrePrefix.gearSmall, | ||
OrePrefix.gemFlawed, | ||
OrePrefix.foil, | ||
OrePrefix.lens, | ||
OrePrefix.wireFine, | ||
OrePrefix.wireGtSingle, | ||
OrePrefix.cableGtSingle | ||
); | ||
|
||
private final List<List<ItemStack>> itemInputs = new ArrayList<>(); | ||
private final List<List<FluidStack>> fluidInputs = new ArrayList<>(); | ||
|
||
private final String name; | ||
private final String formula; | ||
private final int blastTemp; | ||
private final long avgM; | ||
private final long avgP; | ||
private final long avgN; | ||
|
||
public MaterialTree(DustMaterial material) { | ||
// adding an empty list to itemInputs/fluidInputs makes checking if a prefix exists much easier | ||
List<ItemStack> inputDusts = new ArrayList<>(); | ||
for (OrePrefix prefix : PREFIXES) { | ||
inputDusts.add(OreDictUnifier.get(prefix, material)); | ||
} | ||
for (ItemStack stack : inputDusts) { | ||
List<ItemStack> matItemsStack = new ArrayList<>(); | ||
matItemsStack.add(stack); | ||
this.itemInputs.add(matItemsStack); | ||
} | ||
|
||
FluidStack matFluid = material.getFluid(1000); | ||
List<FluidStack> matFluidsStack = new ArrayList<>(); | ||
if (matFluid != null) { | ||
matFluidsStack.add(matFluid); | ||
} | ||
this.fluidInputs.add(matFluidsStack); | ||
|
||
name = material.getLocalizedName(); | ||
formula = material.getChemicalFormula(); | ||
avgM = material.getAverageMass(); | ||
avgP = material.getAverageProtons(); | ||
avgN = material.getAverageNeutrons(); | ||
if (material instanceof IngotMaterial) { | ||
blastTemp = ((IngotMaterial) material).blastFurnaceTemperature; | ||
} | ||
else { | ||
blastTemp = 0; | ||
} | ||
} | ||
|
||
@Override | ||
public void getIngredients(IIngredients ingredients) { | ||
ingredients.setInputLists(ItemStack.class, this.itemInputs); | ||
ingredients.setInputLists(FluidStack.class, this.fluidInputs); | ||
// these don't get displayed, but allow the material tree to show up on left *or* right click | ||
ingredients.setOutputLists(ItemStack.class, this.itemInputs); | ||
ingredients.setOutputLists(FluidStack.class, this.fluidInputs); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Init with the non-deprecated |
||
} | ||
|
||
public String getMaterialName() { | ||
return name; | ||
} | ||
|
||
public String getMaterialFormula() { | ||
return formula; | ||
} | ||
|
||
public long getAvgM() { | ||
return avgM; | ||
} | ||
|
||
public long getAvgP() { | ||
return avgP; | ||
} | ||
|
||
public long getAvgN() { | ||
return avgN; | ||
} | ||
|
||
public int getBlastTemp() { | ||
return blastTemp; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
One thing that I think would be good for this class is a tooltip method for adding tooltips to the items in the material page to notify users of how the materials are made. For example an Aluminum Rod would have the tooltip:
In addition, tooltips would give you the opportunity to mention any recipe properties. You have a line showing the EBF coils, however for the fluid, if it was made in a Fusion Reactor, you could have a tooltip on it:
Made in Fusion Reactor MK 2