Skip to content

Commit

Permalink
rebase and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kumquat-ir committed Aug 8, 2021
1 parent 1b1e19a commit 7a2e24b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/main/java/gregtech/integration/jei/GTJeiPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ public void register(IModRegistry registry) {

//Material Tree
List<MaterialTree> materialTreeList = new CopyOnWriteArrayList<>();
for (Material material : Material.MATERIAL_REGISTRY) {
if (material instanceof DustMaterial) {
materialTreeList.add(new MaterialTree((DustMaterial) material));
for (Material material : MaterialRegistry.MATERIAL_REGISTRY) {
if (material.hasProperty(PropertyKey.DUST)) {
materialTreeList.add(new MaterialTree(material));
}
}
registry.addRecipes(materialTreeList, GTValues.MODID + ":" + "material_tree");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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.material.Material;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.api.unification.ore.OrePrefix;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
Expand Down Expand Up @@ -34,7 +34,7 @@ public class MaterialTree implements IRecipeWrapper {
OrePrefix.gear,
OrePrefix.frameGt,
OrePrefix.nugget,
OrePrefix.pipeNormal,
OrePrefix.pipeNormalFluid,
OrePrefix.plate,
OrePrefix.plateDense,
OrePrefix.gemChipped,
Expand All @@ -57,7 +57,7 @@ public class MaterialTree implements IRecipeWrapper {
private final long avgP;
private final long avgN;

public MaterialTree(DustMaterial material) {
public MaterialTree(Material 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) {
Expand All @@ -69,10 +69,9 @@ public MaterialTree(DustMaterial material) {
this.itemInputs.add(matItemsStack);
}

FluidStack matFluid = material.getFluid(1000);
List<FluidStack> matFluidsStack = new ArrayList<>();
if (matFluid != null) {
matFluidsStack.add(matFluid);
if (material.hasProperty(PropertyKey.FLUID)) {
matFluidsStack.add(material.getFluid(1000));
}
this.fluidInputs.add(matFluidsStack);

Expand All @@ -81,8 +80,8 @@ public MaterialTree(DustMaterial material) {
avgM = material.getAverageMass();
avgP = material.getAverageProtons();
avgN = material.getAverageNeutrons();
if (material instanceof IngotMaterial) {
blastTemp = ((IngotMaterial) material).blastFurnaceTemperature;
if (material.hasProperty(PropertyKey.BLAST)) {
blastTemp = material.getBlastTemperature();
}
else {
blastTemp = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class MaterialTreeCategory extends PrimitiveRecipeCategory<MaterialTree,
129, 85, // gear 15
129, 117, // frameGt
54, 85, // nugget
54, 117, // pipeNormal
54, 117, // pipeNormalFluid
54, 147, // plate
79, 135, // plateDense 20
79, 135, // gemChipped (override)
Expand Down Expand Up @@ -178,7 +178,7 @@ public void drawExtras(Minecraft minecraft) {
drawArrow(minecraft, "up_14", 160, 103, itemExists.get(27) && itemExists.get(28));
// wire -> fine wire
drawArrow(minecraft, "down_12", 160, 135, itemExists.get(27) && itemExists.get(26));
// plate -> normal pipe
// plate -> normal fluid pipe
drawArrow(minecraft, "up_12", 60, 135, itemExists.get(19) && itemExists.get(18));
// hot ingot -> ingot
drawArrow(minecraft, "down_16", 35, 85, itemExists.get(3) && itemExists.get(4));
Expand Down

0 comments on commit 7a2e24b

Please sign in to comment.