Skip to content

Commit 4cb9684

Browse files
committed
fix gt for 1.7 !
1 parent 211a082 commit 4cb9684

File tree

1 file changed

+67
-67
lines changed

1 file changed

+67
-67
lines changed

src/main/java/net/deepacat/createpowerlines/GTAddonImpl.java

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package net.deepacat.createpowerlines;
22

3-
import com.google.common.collect.ImmutableList;
43
import com.gregtechceu.gtceu.api.GTCEuAPI;
54
import com.gregtechceu.gtceu.api.GTValues;
65
import com.gregtechceu.gtceu.api.addon.GTAddon;
@@ -40,6 +39,7 @@
4039
import java.util.function.Consumer;
4140

4241
import static com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData.ITEM_MATERIAL_INFO;
42+
import static com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData.getMaterialInfo;
4343

4444
@GTAddon
4545
public class GTAddonImpl implements IGTAddon {
@@ -105,78 +105,78 @@ public void addRecipes(Consumer<FinishedRecipe> out) {
105105
ConnectorType[] connectors = this.connectors[i];
106106
if (connectors == null) continue;
107107

108-
ItemMaterialInfo hull = ITEM_MATERIAL_INFO.get(GTMachines.HULL[i].getBlock());
108+
ItemMaterialInfo hull = getMaterialInfo(GTMachines.HULL[i].getBlock());
109109
List<MaterialStack> hullMats = hull.getMaterials();
110110

111-
// Material gtWireMat = hullMats.get(1).material();
112-
// Material tierMat = hullMats.get(0).material();
113-
//
114-
// TagKey<Item> hullPlate = ChemicalHelper.getTag(TagPrefix.plate, tierMat);
115-
// TagKey<Item> wirePlate = ChemicalHelper.getTag(TagPrefix.plate, gtWireMat);
116-
//
117-
// WireMaterial wireMat = wireMats.get(gtWireMat);
118-
// Object[] circuits = new Object[]{
119-
// CustomTags.CIRCUITS_ARRAY[i],
120-
// GTMachines.ENERGY_CONVERTER_1A[i].getItem(),
121-
// GTMachines.ENERGY_CONVERTER_4A[i].getItem(),
122-
// GTMachines.ENERGY_CONVERTER_8A[i].getItem(),
123-
// GTMachines.ENERGY_CONVERTER_16A[i].getItem()
124-
// };
125-
// for (int j = 0; j < connectors.length; ++j) {
126-
// ConnectorType connector = connectors[j];
127-
// VanillaRecipeHelper.addShapedRecipe(out,
128-
// new ResourceLocation(CreatePowerlines.MODID, connector.id), connector.blockEntry.asStack(),
129-
// "WWW", "PSP", "PCP",
130-
// 'W', wirePlate,
131-
// 'P', hullPlate,
132-
// 'S', wireMat.spool.get(), 'C', circuits[j]);
133-
// }
111+
Material gtWireMat = hullMats.get(0).material();
112+
Material tierMat = hullMats.get(2).material();
113+
114+
TagKey<Item> hullPlate = ChemicalHelper.getTag(TagPrefix.plate, tierMat);
115+
TagKey<Item> wirePlate = ChemicalHelper.getTag(TagPrefix.plate, gtWireMat);
116+
117+
WireMaterial wireMat = wireMats.get(gtWireMat);
118+
Object[] circuits = new Object[]{
119+
CustomTags.CIRCUITS_ARRAY[i],
120+
GTMachines.ENERGY_CONVERTER_1A[i].getItem(),
121+
GTMachines.ENERGY_CONVERTER_4A[i].getItem(),
122+
GTMachines.ENERGY_CONVERTER_8A[i].getItem(),
123+
GTMachines.ENERGY_CONVERTER_16A[i].getItem()
124+
};
125+
for (int j = 0; j < connectors.length; ++j) {
126+
ConnectorType connector = connectors[j];
127+
VanillaRecipeHelper.addShapedRecipe(out,
128+
new ResourceLocation(CreatePowerlines.MODID, connector.id), connector.blockEntry.asStack(),
129+
"WWW", "PSP", "PCP",
130+
'W', wirePlate,
131+
'P', hullPlate,
132+
'S', wireMat.spool.get(), 'C', circuits[j]);
133+
}
134134
}
135135
}
136136

137137
if (connectors == null) return;
138138

139-
// if (Config.GT_WIRE_RECIPES.get()) {
140-
// for (Map.Entry<Material, WireMaterial> entry : wireMats.entrySet()) {
141-
// Material gtWireMat = entry.getKey();
142-
// WireMaterial wireMat = entry.getValue();
143-
// GTRecipeTypes.WIREMILL_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "wires/" + wireMat.wireId()))
144-
// .inputItems(TagPrefix.ingot, gtWireMat)
145-
// .outputItems(new ItemStack(wireMat.wire.get(), 2))
146-
// .circuitMeta(5).duration(200).EUt(7).save(out);
147-
// VanillaRecipeHelper.addShapedRecipe(out,
148-
// new ResourceLocation(CreatePowerlines.MODID, "spools/" + wireMat.spoolId()),
149-
// new ItemStack(wireMat.spool.get()),
150-
// "WWW", "WSW", "WWW",
151-
// 'S', WireMaterials.EMPTY_SPOOL.get(),
152-
// 'W', wireMat.wire.get());
153-
// }
154-
// }
155-
//
156-
// // Gregged spool manual recipe
157-
// VanillaRecipeHelper.addShapedRecipe(out,
158-
// new ResourceLocation(CreatePowerlines.MODID, "empty_spool"), WireMaterials.EMPTY_SPOOL.asStack(2),
159-
// "III", " N ", "III",
160-
// 'I', new MaterialEntry(TagPrefix.ingot, GTMaterials.Iron),
161-
// 'N', new MaterialEntry(TagPrefix.nugget, GTMaterials.Iron)
162-
// );
163-
//
164-
// // Gregged relay manual recipe
165-
// int outAmt = 1;
166-
// for (FluidStack fluid : new FluidStack[]{
167-
// GTMaterials.Polyethylene.getFluid(1152),
168-
// GTMaterials.Polytetrafluoroethylene.getFluid(576),
169-
// GTMaterials.Polybenzimidazole.getFluid(288)
170-
// }) {
171-
// String fluidName = ForgeRegistries.FLUIDS.getKey(fluid.getFluid()).getPath();
172-
// GTRecipeTypes.ASSEMBLER_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "relay/" + fluidName))
173-
// .inputItems(TagPrefix.wireGtOctal, GTMaterials.Copper)
174-
// .inputItems(TagPrefix.plateDense, GTMaterials.Steel, 2)
175-
// .inputItems(GTMachines.HULL[1])
176-
// .inputFluids(fluid)
177-
// .outputItems(ConnectorTypes.RELAY.blockEntry.asStack(outAmt))
178-
// .circuitMeta(1).duration(200).EUt(7).save(out);
179-
// outAmt *= 2;
180-
// }
139+
if (Config.GT_WIRE_RECIPES.get()) {
140+
for (Map.Entry<Material, WireMaterial> entry : wireMats.entrySet()) {
141+
Material gtWireMat = entry.getKey();
142+
WireMaterial wireMat = entry.getValue();
143+
GTRecipeTypes.WIREMILL_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "wires/" + wireMat.wireId()))
144+
.inputItems(TagPrefix.ingot, gtWireMat)
145+
.outputItems(new ItemStack(wireMat.wire.get(), 2))
146+
.circuitMeta(5).duration(200).EUt(7).save(out);
147+
VanillaRecipeHelper.addShapedRecipe(out,
148+
new ResourceLocation(CreatePowerlines.MODID, "spools/" + wireMat.spoolId()),
149+
new ItemStack(wireMat.spool.get()),
150+
"WWW", "WSW", "WWW",
151+
'S', WireMaterials.EMPTY_SPOOL.get(),
152+
'W', wireMat.wire.get());
153+
}
154+
}
155+
156+
// Gregged spool manual recipe
157+
VanillaRecipeHelper.addShapedRecipe(out,
158+
new ResourceLocation(CreatePowerlines.MODID, "empty_spool"), WireMaterials.EMPTY_SPOOL.asStack(2),
159+
"III", " N ", "III",
160+
'I', new MaterialEntry(TagPrefix.ingot, GTMaterials.Iron),
161+
'N', new MaterialEntry(TagPrefix.nugget, GTMaterials.Iron)
162+
);
163+
164+
// Gregged relay manual recipe
165+
int outAmt = 1;
166+
for (FluidStack fluid : new FluidStack[]{
167+
GTMaterials.Polyethylene.getFluid(1152),
168+
GTMaterials.Polytetrafluoroethylene.getFluid(576),
169+
GTMaterials.Polybenzimidazole.getFluid(288)
170+
}) {
171+
String fluidName = ForgeRegistries.FLUIDS.getKey(fluid.getFluid()).getPath();
172+
GTRecipeTypes.ASSEMBLER_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "relay/" + fluidName))
173+
.inputItems(TagPrefix.wireGtOctal, GTMaterials.Copper)
174+
.inputItems(TagPrefix.plateDense, GTMaterials.Steel, 2)
175+
.inputItems(GTMachines.HULL[1])
176+
.inputFluids(fluid)
177+
.outputItems(ConnectorTypes.RELAY.blockEntry.asStack(outAmt))
178+
.circuitMeta(1).duration(200).EUt(7).save(out);
179+
outAmt *= 2;
180+
}
181181
}
182182
}

0 commit comments

Comments
 (0)