diff --git a/src/main/java/gregtech/api/unification/material/Material.java b/src/main/java/gregtech/api/unification/material/Material.java index 18770e5325c..29c4c9fd9e4 100644 --- a/src/main/java/gregtech/api/unification/material/Material.java +++ b/src/main/java/gregtech/api/unification/material/Material.java @@ -10,7 +10,22 @@ import gregtech.api.unification.material.info.MaterialFlag; import gregtech.api.unification.material.info.MaterialFlags; import gregtech.api.unification.material.info.MaterialIconSet; -import gregtech.api.unification.material.properties.*; +import gregtech.api.unification.material.properties.BlastProperty; +import gregtech.api.unification.material.properties.DustProperty; +import gregtech.api.unification.material.properties.FluidPipeProperties; +import gregtech.api.unification.material.properties.FluidProperty; +import gregtech.api.unification.material.properties.GemProperty; +import gregtech.api.unification.material.properties.IMaterialProperty; +import gregtech.api.unification.material.properties.IngotProperty; +import gregtech.api.unification.material.properties.ItemPipeProperties; +import gregtech.api.unification.material.properties.MaterialProperties; +import gregtech.api.unification.material.properties.OreProperty; +import gregtech.api.unification.material.properties.PolymerProperty; +import gregtech.api.unification.material.properties.PropertyKey; +import gregtech.api.unification.material.properties.RotorProperty; +import gregtech.api.unification.material.properties.ToolProperty; +import gregtech.api.unification.material.properties.WireProperties; +import gregtech.api.unification.material.properties.WoodProperty; import gregtech.api.unification.material.registry.MaterialRegistry; import gregtech.api.unification.stack.MaterialStack; import gregtech.api.util.FluidTooltipUtil; @@ -35,7 +50,11 @@ import stanhebben.zenscript.annotations.ZenMethod; import stanhebben.zenscript.annotations.ZenOperator; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Objects; import java.util.function.Consumer; import java.util.function.UnaryOperator; @@ -110,6 +129,14 @@ public Material setFormula(String formula, boolean withFormatting) { return this; } + @ZenMethod + public Material setComponents(MaterialStack... components) { + this.materialInfo.setComponents(components); + this.chemicalFormula = null; + this.chemicalFormula = calculateChemicalFormula(); + return this; + } + public ImmutableList getMaterialComponents() { return materialInfo.componentList; } @@ -1172,5 +1199,10 @@ private void verifyInfo(MaterialProperties p, boolean averageRGB) { } } } + + public MaterialInfo setComponents(MaterialStack... components) { + this.componentList = ImmutableList.copyOf(Arrays.asList(components)); + return this; + } } }