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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
package ggfab;
import static gregtech.api.enums.ToolDictNames.*;
import static gregtech.common.items.IDMetaTool01.*;
import static gregtech.common.items.MetaGeneratedTool01.INSTANCE;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import ggfab.api.GGFabRecipeMaps;
import ggfab.api.GigaGramFabAPI;
import ggfab.items.GGMetaItemDumbItems;
import ggfab.mte.MTEAdvAssLine;
import ggfab.mte.MTELinkedInputBus;
import ggfab.util.GGUtils;
import gregtech.api.GregTechAPI;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SoundResource;
import gregtech.api.metatileentity.implementations.MTEBasicMachineWithRecipe;
import gregtech.api.util.ProcessingArrayManager;
@Mod(
modid = GGConstants.MODID,
version = GGConstants.VERSION,
name = GGConstants.MODNAME,
acceptedMinecraftVersions = "[1.7.10]",
dependencies = "required-after:IC2;required-before:gregtech")
public class GigaGramFab {
public GigaGramFab() {
// initialize the textures
// noinspection ResultOfMethodCallIgnored
BlockIcons.OVERLAY_FRONT_ADV_ASSLINE.name();
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
GregTechAPI.sAfterGTPreload.add(() -> {
GGItemList.AdvAssLine
.set(new MTEAdvAssLine(13532, "ggfab.machine.adv_assline", "Advanced Assembly Line").getStackForm(1));
GGItemList.LinkedInputBus.set(
new MTELinkedInputBus(13533, "ggfab.machine.linked_input_bus", "Linked Input Bus", 5).getStackForm(1));
GGItemList.ToolCast_MV.set(
new MTEBasicMachineWithRecipe(
13534,
"ggfab.toolcast.tier.mv",
"Basic Tool Casting Machine",
2,
"Cheap Crafting Tool for you!",
GGFabRecipeMaps.toolCastRecipes,
1,
4,
32000,
SoundResource.NONE,
MTEBasicMachineWithRecipe.SpecialEffects.MAIN_RANDOM_SPARKS,
"TOOL_CAST",
new Object[] { "PGP", "WMW", "CBC", 'M', MTEBasicMachineWithRecipe.X.HULL, 'P',
MTEBasicMachineWithRecipe.X.PUMP, 'C', MTEBasicMachineWithRecipe.X.CIRCUIT, 'W',
MTEBasicMachineWithRecipe.X.WIRE, 'G', MTEBasicMachineWithRecipe.X.GLASS, 'B',
ItemList.Shape_Empty.get(1L) }).getStackForm(1L));
GGItemList.ToolCast_HV.set(
new MTEBasicMachineWithRecipe(
13535,
"ggfab.toolcast.tier.hv",
"Advanced Tool Casting Machine",
3,
"Cheap Crafting Tool for you!",
GGFabRecipeMaps.toolCastRecipes,
1,
4,
64000,
SoundResource.NONE,
MTEBasicMachineWithRecipe.SpecialEffects.MAIN_RANDOM_SPARKS,
"TOOL_CAST",
new Object[] { "PGP", "WMW", "CBC", 'M', MTEBasicMachineWithRecipe.X.HULL, 'P',
MTEBasicMachineWithRecipe.X.PUMP, 'C', MTEBasicMachineWithRecipe.X.CIRCUIT, 'W',
MTEBasicMachineWithRecipe.X.WIRE, 'G', MTEBasicMachineWithRecipe.X.GLASS, 'B',
ItemList.Shape_Empty.get(1L) }).getStackForm(1L));
GGItemList.ToolCast_EV.set(
new MTEBasicMachineWithRecipe(
13536,
"ggfab.toolcast.tier.ev",
"Master Tool Casting Machine",
4,
"Cheap Crafting Tool for you!",
GGFabRecipeMaps.toolCastRecipes,
1,
4,
128000,
SoundResource.NONE,
MTEBasicMachineWithRecipe.SpecialEffects.MAIN_RANDOM_SPARKS,
"TOOL_CAST",
new Object[] { "PGP", "WMW", "CBC", 'M', MTEBasicMachineWithRecipe.X.HULL, 'P',
MTEBasicMachineWithRecipe.X.PUMP, 'C', MTEBasicMachineWithRecipe.X.CIRCUIT, 'W',
MTEBasicMachineWithRecipe.X.WIRE, 'G', MTEBasicMachineWithRecipe.X.GLASS, 'B',
ItemList.Shape_Empty.get(1L) }).getStackForm(1L));
long plate = OrePrefixes.plate.mMaterialAmount, ingot = OrePrefixes.ingot.mMaterialAmount,
screw = OrePrefixes.screw.mMaterialAmount, rod = OrePrefixes.stick.mMaterialAmount;
GigaGramFabAPI.addSingleUseToolType(craftingToolFile, INSTANCE.mToolStats.get((short) FILE.ID), 2 * plate);
GigaGramFabAPI
.addSingleUseToolType(craftingToolWrench, INSTANCE.mToolStats.get((short) WRENCH.ID), 6 * ingot);
GigaGramFabAPI
.addSingleUseToolType(craftingToolCrowbar, INSTANCE.mToolStats.get((short) CROWBAR.ID), 3 * rod);
GigaGramFabAPI.addSingleUseToolType(
craftingToolWireCutter,
INSTANCE.mToolStats.get((short) WIRECUTTER.ID),
3 * plate + 2 * rod + screw);
GigaGramFabAPI.addSingleUseToolType(
craftingToolHardHammer,
INSTANCE.mToolStats.get((short) HARDHAMMER.ID),
6 * ingot);
GigaGramFabAPI.addSingleUseToolType(
craftingToolSoftHammer,
INSTANCE.mToolStats.get((short) SOFTMALLET.ID),
6 * ingot);
GigaGramFabAPI.addSingleUseToolType(
craftingToolScrewdriver,
INSTANCE.mToolStats.get((short) SCREWDRIVER.ID),
2 * rod);
GigaGramFabAPI.addSingleUseToolType(craftingToolSaw, INSTANCE.mToolStats.get((short) SAW.ID), 2 * plate);
ProcessingArrayManager.addRecipeMapToPA("ggfab.toolcast", GGFabRecipeMaps.toolCastRecipes);
});
GregTechAPI.sBeforeGTPostload.add(new ComponentRecipeLoader());
GregTechAPI.sBeforeGTPostload.add(new SingleUseToolRecipeLoader());
ConfigurationHandler.INSTANCE.init(event.getSuggestedConfigurationFile());
initDumbItem1();
}
@Mod.EventHandler
public void init(FMLInitializationEvent event) {}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {}
private void initDumbItem1() {
GGMetaItemDumbItems i1 = new GGMetaItemDumbItems("ggfab.d1");
int id = 0;
int idShape = 30;
final int budget = idShape;
String prefix = "One_Use_craftingTool";
String prefix2 = "Shape_One_Use_craftingTool";
for (GGItemList i : GGItemList.values()) {
ItemStack stack = null;
if (i.name()
.startsWith(prefix)) {
stack = i1.addItem(
id++,
"Single Use " + GGUtils.processSentence(
i.name()
.substring(prefix.length()),
' ',
true,
true),
null,
i,
i.name()
.substring("One_Use_".length()));
} else if (i.name()
.startsWith(prefix2)) {
stack = i1.addItem(
idShape++,
"Tool Casting Mold (" + GGUtils.processSentence(
i.name()
.substring(prefix2.length()),
' ',
true,
true) + ")",
null,
i);
}
if (stack != null) {
i.set(stack);
}
}
if (id >= budget || idShape >= 2 * budget || idShape - id != budget) throw new AssertionError();
}
}
|