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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_ModHandler.RecipeBits;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegistrator, Runnable {
public ProcessingElectricButcherKnife() {
GregtechOrePrefixes.toolElectricButcherKnife.add(this);
}
@Override
public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
final String aModName, final ItemStack aStack) {
if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
if (aMaterial != Materials.Rubber) {
if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
&& (!aMaterial.contains(SubTag.NO_SMASHING))) {
}
}
}
}
@Override
public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName,
final String aModName, final ItemStack aStack) {
// TODO Auto-generated method stub
}
public void materialsLoops() {
final Materials[] i = Materials.values();
final int size = i.length;
Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
int used = 0;
Materials aMaterial = null;
for (int r = 0; r < size; r++) {
aMaterial = i[r];
if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber)
&& (aMaterial != Materials._NULL)) {
if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
&& (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT))
&& (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL))
&& (!aMaterial.contains(SubTag.NO_SMELTING))) {
Logger.MATERIALS("Generating Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial));
// Input 1
final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
if ((null != plate) && screw != null) {
addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
used++;
} else {
Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+" |");
}
// GT_ModHandler.addCraftingRecipe(,
// GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
// GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
// Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
// Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
// Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
} else {
Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial));
}
} else {
Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial));
}
}
Logger.INFO("Materials used for tool gen: " + used);
}
@Override
public void run() {
Logger.INFO("Generating Electric Butcher Knives for all valid GT Materials.");
this.materialsLoops();
}
public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
MetaGeneratedGregtechTools.ELECTRIC_BUTCHER_KNIFE,
1,
aMaterial,
Materials.Titanium,
new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L});
ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
GT_MetaGenerated_Tool_01.BUTCHERYKNIFE,
1,
aMaterial,
aMaterial,
null);
long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
if (aDura <= 32000) {
Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura);
return false;
}
return RecipeUtils.addShapedRecipe(
OrePrefixes.wireFine.get(Materials.Electrum), aInputCutter, OrePrefixes.wireFine.get(Materials.Electrum),
OrePrefixes.plate.get(aMaterial), CI.getElectricMotor(aVoltageTier, 1), OrePrefixes.plate.get(aMaterial),
OrePrefixes.screw.get(aMaterial), aBattery, OrePrefixes.screw.get(aMaterial),
aOutputStack);
}
}
|