blob: 2272df0e2af1424c8e04b889042788d9a4075e8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
package gtPlusPlus.xmod.gregtech.loaders;
import static gregtech.api.recipe.RecipeMaps.compressorRecipes;
import static gregtech.api.recipe.RecipeMaps.cutterRecipes;
import static gregtech.api.recipe.RecipeMaps.hammerRecipes;
import static gregtech.api.recipe.RecipeMaps.latheRecipes;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
import java.util.HashSet;
import java.util.Set;
import gregtech.api.enums.GTValues;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
public class RecipeGenMetalRecipe extends RecipeGenBase {
public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>();
static {
MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap);
}
public RecipeGenMetalRecipe(final Material M) {
this.toGenerate = M;
mRecipeGenMap.add(this);
}
@Override
public void run() {
generateRecipes(this.toGenerate);
}
private void generateRecipes(final Material material) {
Logger.WARNING("Generating Metal recipes for " + material.getLocalizedName());
if (ItemUtils.checkForInvalidItems(material.getIngot(1))
&& ItemUtils.checkForInvalidItems(material.getBlock(1))) {
GTValues.RA.stdBuilder()
.itemInputs(material.getIngot(9))
.itemOutputs(material.getBlock(1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
Logger.WARNING("Compress Block Recipe: " + material.getLocalizedName() + " - Success");
}
if (ItemUtils.checkForInvalidItems(material.getIngot(1))
&& ItemUtils.checkForInvalidItems(material.getRod(1))) {
GTValues.RA.stdBuilder()
.itemInputs(material.getIngot(1))
.itemOutputs(material.getRod(1), material.getSmallDust(2))
.duration(Math.max(material.getMass() / 8L, 1L))
.eut(material.vVoltageMultiplier)
.addTo(latheRecipes);
Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Success");
}
if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) {
GTValues.RA.stdBuilder()
.itemInputs(material.getRod(1))
.itemOutputs(material.getBolt(4))
.duration(Math.max(material.getMass() * 2L, 1L))
.eut(material.vVoltageMultiplier)
.addTo(cutterRecipes);
Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Success");
}
if (ItemUtils.checkForInvalidItems(material.getRod(1))
&& ItemUtils.checkForInvalidItems(material.getLongRod(1))) {
GTValues.RA.stdBuilder()
.itemInputs(material.getRod(2))
.itemOutputs(material.getLongRod(1))
.duration((int) Math.max(material.getMass(), 1L))
.eut(16)
.addTo(hammerRecipes);
Logger.WARNING("Hammer Long Rod Recipe: " + material.getLocalizedName() + " - Success");
GTValues.RA.stdBuilder()
.itemInputs(material.getLongRod(1))
.itemOutputs(material.getRod(2))
.duration(Math.max(material.getMass(), 1L))
.eut(4)
.addTo(cutterRecipes);
}
if (ItemUtils.checkForInvalidItems(material.getBolt(1))
&& ItemUtils.checkForInvalidItems(material.getScrew(1))) {
GTValues.RA.stdBuilder()
.itemInputs(material.getBolt(1))
.itemOutputs(material.getScrew(1))
.duration(Math.max(material.getMass() / 8L, 1L))
.eut(4)
.addTo(latheRecipes);
Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Success");
}
}
}
|