|
10 | 10 | import gregtech.api.unification.material.info.MaterialFlag; |
11 | 11 | import gregtech.api.unification.material.info.MaterialFlags; |
12 | 12 | import gregtech.api.unification.material.info.MaterialIconSet; |
13 | | -import gregtech.api.unification.material.properties.*; |
| 13 | +import gregtech.api.unification.material.properties.BlastProperty; |
| 14 | +import gregtech.api.unification.material.properties.DustProperty; |
| 15 | +import gregtech.api.unification.material.properties.FluidPipeProperties; |
| 16 | +import gregtech.api.unification.material.properties.FluidProperty; |
| 17 | +import gregtech.api.unification.material.properties.GemProperty; |
| 18 | +import gregtech.api.unification.material.properties.IMaterialProperty; |
| 19 | +import gregtech.api.unification.material.properties.IngotProperty; |
| 20 | +import gregtech.api.unification.material.properties.ItemPipeProperties; |
| 21 | +import gregtech.api.unification.material.properties.MaterialProperties; |
| 22 | +import gregtech.api.unification.material.properties.OreProperty; |
| 23 | +import gregtech.api.unification.material.properties.PolymerProperty; |
| 24 | +import gregtech.api.unification.material.properties.PropertyKey; |
| 25 | +import gregtech.api.unification.material.properties.RotorProperty; |
| 26 | +import gregtech.api.unification.material.properties.ToolProperty; |
| 27 | +import gregtech.api.unification.material.properties.WireProperties; |
| 28 | +import gregtech.api.unification.material.properties.WoodProperty; |
14 | 29 | import gregtech.api.unification.material.registry.MaterialRegistry; |
15 | 30 | import gregtech.api.unification.stack.MaterialStack; |
16 | 31 | import gregtech.api.util.FluidTooltipUtil; |
|
35 | 50 | import stanhebben.zenscript.annotations.ZenMethod; |
36 | 51 | import stanhebben.zenscript.annotations.ZenOperator; |
37 | 52 |
|
38 | | -import java.util.*; |
| 53 | +import java.util.ArrayList; |
| 54 | +import java.util.Arrays; |
| 55 | +import java.util.Collection; |
| 56 | +import java.util.List; |
| 57 | +import java.util.Objects; |
39 | 58 | import java.util.function.Consumer; |
40 | 59 | import java.util.function.UnaryOperator; |
41 | 60 |
|
@@ -110,6 +129,14 @@ public Material setFormula(String formula, boolean withFormatting) { |
110 | 129 | return this; |
111 | 130 | } |
112 | 131 |
|
| 132 | + @ZenMethod |
| 133 | + public Material setComponents(MaterialStack... components) { |
| 134 | + this.materialInfo.setComponents(components); |
| 135 | + this.chemicalFormula = null; |
| 136 | + this.chemicalFormula = calculateChemicalFormula(); |
| 137 | + return this; |
| 138 | + } |
| 139 | + |
113 | 140 | public ImmutableList<MaterialStack> getMaterialComponents() { |
114 | 141 | return materialInfo.componentList; |
115 | 142 | } |
@@ -1172,5 +1199,10 @@ private void verifyInfo(MaterialProperties p, boolean averageRGB) { |
1172 | 1199 | } |
1173 | 1200 | } |
1174 | 1201 | } |
| 1202 | + |
| 1203 | + public MaterialInfo setComponents(MaterialStack... components) { |
| 1204 | + this.componentList = ImmutableList.copyOf(Arrays.asList(components)); |
| 1205 | + return this; |
| 1206 | + } |
1175 | 1207 | } |
1176 | 1208 | } |
0 commit comments