Skip to content

Commit e0d55c8

Browse files
Allow specifying the amount of fluid for chemical bath processing (#97)
1 parent 98e3bef commit e0d55c8

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/main/java/gregtech/api/unification/material/Material.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,12 @@ public Builder washedIn(Material m) {
696696
return this;
697697
}
698698

699+
public Builder washedIn(Material m, int washedAmount) {
700+
properties.ensureSet(PropertyKey.ORE);
701+
properties.getProperty(PropertyKey.ORE).setWashedIn(m, washedAmount);
702+
return this;
703+
}
704+
699705
public Builder separatedInto(Material... m) {
700706
properties.ensureSet(PropertyKey.ORE);
701707
properties.getProperty(PropertyKey.ORE).setSeparatedInto(m);

src/main/java/gregtech/api/unification/material/properties/OreProperty.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gregtech.api.unification.material.properties;
22

33
import gregtech.api.unification.material.Material;
4+
import org.apache.commons.lang3.tuple.Pair;
45

56
import javax.annotation.Nullable;
67
import java.util.ArrayList;
@@ -53,6 +54,14 @@ public class OreProperty implements IMaterialProperty<OreProperty> {
5354
@Nullable
5455
private Material washedIn;
5556

57+
/**
58+
* The amount of Material that the ore should be washed in
59+
* in the Chemical Bath.
60+
* <p>
61+
* Default 100 mb
62+
*/
63+
private int washedAmount = 100;
64+
5665
/**
5766
* During Electromagnetic Separation, this Ore will be separated
5867
* into this Material and the Material specified by this field.
@@ -105,9 +114,14 @@ public void setWashedIn(@Nullable Material m) {
105114
this.washedIn = m;
106115
}
107116

117+
public void setWashedIn(@Nullable Material m, int washedAmount) {
118+
this.washedIn = m;
119+
this.washedAmount = washedAmount;
120+
}
121+
108122
@Nullable
109-
public Material getWashedIn() {
110-
return this.washedIn;
123+
public Pair<Material, Integer> getWashedIn() {
124+
return Pair.of(this.washedIn, this.washedAmount);
111125
}
112126

113127
public void setSeparatedInto(Material... materials) {

src/main/java/gregtech/loaders/oreprocessing/OreRecipeHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import gregtech.api.unification.stack.UnificationEntry;
1515
import gregtech.api.util.GTUtility;
1616
import net.minecraft.item.ItemStack;
17+
import org.apache.commons.lang3.tuple.Pair;
1718

1819
import java.util.List;
1920

@@ -168,9 +169,10 @@ public static void processCrushedOre(OrePrefix crushedPrefix, Material material,
168169

169170
if (property.getWashedIn() != null) {
170171
Material washingByproduct = GTUtility.selectItemInList(3, material, property.getOreByProducts(), Material.class);
172+
Pair<Material, Integer> washedInTuple = property.getWashedIn();
171173
RecipeMaps.CHEMICAL_BATH_RECIPES.recipeBuilder()
172174
.input(crushedPrefix, material)
173-
.fluidInputs(property.getWashedIn().getFluid(property.getWashedIn() == Materials.SodiumPersulfate ? 100 : 1000))
175+
.fluidInputs(washedInTuple.getKey().getFluid(washedInTuple.getRight()))
174176
.outputs(crushedPurifiedOre)
175177
.chancedOutput(OreDictUnifier.get(OrePrefix.dust, washingByproduct, property.getByProductMultiplier()), 7000, 580)
176178
.chancedOutput(OreDictUnifier.get(OrePrefix.dust, Materials.Stone), 4000, 650)

0 commit comments

Comments
 (0)