|
1 | | -package gregtech.loaders.oreprocessing; |
2 | | - |
3 | | -import appeng.api.config.TunnelType; |
4 | | -import appeng.core.Api; |
5 | | -import cpw.mods.fml.common.Optional; |
6 | | -import gregtech.GT_Mod; |
7 | | -import gregtech.api.enums.*; |
8 | | -import gregtech.api.util.GT_Log; |
9 | | -import gregtech.api.util.GT_ModHandler; |
10 | | -import gregtech.api.util.GT_OreDictUnificator; |
11 | | -import gregtech.api.util.GT_Utility; |
12 | | -import gregtech.common.GT_Proxy; |
13 | | -import net.minecraft.item.ItemStack; |
14 | | - |
15 | | -import java.util.ArrayList; |
16 | | - |
17 | | -public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistrator { |
18 | | - |
19 | | - private Materials[] dielectrics = {Materials.PolyvinylChloride, Materials.Polydimethylsiloxane}; |
20 | | - private Materials[] rubbers = {Materials.Rubber, Materials.StyreneButadieneRubber, Materials.Silicone}; |
21 | | - private Materials[] syntheticRubbers = {Materials.StyreneButadieneRubber, Materials.Silicone}; |
22 | | - |
23 | | - private static Object tt; |
24 | | - public ProcessingWire() { |
25 | | - OrePrefixes.wireGt01.add(this); |
26 | | - OrePrefixes.wireGt02.add(this); |
27 | | - OrePrefixes.wireGt04.add(this); |
28 | | - OrePrefixes.wireGt08.add(this); |
29 | | - OrePrefixes.wireGt12.add(this); |
30 | | - OrePrefixes.wireGt16.add(this); |
31 | | - } |
32 | | - |
33 | | - @Override |
34 | | - public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { |
35 | | - if (GT_Mod.gregtechproxy.mAE2Integration) { |
36 | | - if (tt == TunnelType.ME) { |
37 | | - try { |
38 | | - tt = TunnelType.valueOf("GT_POWER"); |
39 | | - } catch (IllegalArgumentException ignored) { |
40 | | - tt = TunnelType.IC2_POWER; |
41 | | - } |
42 | | - } |
43 | | - } |
44 | | - |
45 | | - int cableWidth; |
46 | | - OrePrefixes correspondingCable; |
47 | | - OrePrefixes correspondingWire; |
48 | | - if (!aMaterial.contains(SubTag.YES_CABLES)) { |
49 | | - return; |
50 | | - } |
51 | | - switch (aPrefix) { |
52 | | - case wireGt01: |
53 | | - cableWidth = 1; |
54 | | - correspondingCable = OrePrefixes.cableGt01; |
55 | | - if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial) && !aMaterial.contains(SubTag.NO_WORKING)) { |
56 | | - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), GT_Proxy.tBits, new Object[]{"Xx", 'X', OrePrefixes.plate.get(aMaterial)}); |
57 | | - } |
58 | | - break; |
59 | | - case wireGt08: |
60 | | - cableWidth = 8; |
61 | | - correspondingCable = OrePrefixes.cableGt08; |
62 | | - correspondingWire = OrePrefixes.wireGt08; |
63 | | - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 8L), new Object[]{aOreDictName}); |
64 | | - GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, aStack), new Object[]{OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial),OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial)}); |
65 | | - GT_Values.RA.addAssemblerRecipe(GT_Utility.getIntegratedCircuit(8), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 8L),GT_OreDictUnificator.get(correspondingWire, aMaterial, 1L), 6, 8); |
66 | | - break; |
67 | | - |
68 | | - case wireGt16 : |
69 | | - cableWidth = 16; |
70 | | - correspondingCable = OrePrefixes.cableGt16; |
71 | | - correspondingWire = OrePrefixes.wireGt16; |
72 | | - GT_Values.RA.addAssemblerRecipe(GT_Utility.getIntegratedCircuit(16), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 64L),GT_OreDictUnificator.get(correspondingWire, aMaterial, 1L), 300, 24); |
73 | | - if (GT_Mod.gregtechproxy.mAE2Integration) { |
74 | | - AE2addNewAttunement(aStack); |
75 | | - } |
76 | | - break; |
77 | | - default: |
78 | | - GT_Log.err.println("OrePrefix " + aPrefix.name() + " cannot be registered as a cable for Material " + aMaterial.mName); |
79 | | - return; |
80 | | - } |
81 | | - |
82 | | - |
83 | | - |
84 | | - int costMultiplier = cableWidth / 4 + 1; |
85 | | - |
86 | | - |
87 | | - switch (aMaterial.mName){ |
88 | | - case "RedAlloy":case "Cobalt": case "Lead": case "Tin": case "Zinc":case "SolderingAlloy": |
89 | | - ArrayList<Object> craftingListRubber = new ArrayList<>(); |
90 | | - craftingListRubber.add(aOreDictName); |
91 | | - for (int i = 0; i < costMultiplier; i++) { |
92 | | - craftingListRubber.add(OrePrefixes.plate.get(Materials.Rubber)); |
93 | | - } |
94 | | - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), craftingListRubber.toArray()); |
95 | | -// GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plate.get(Materials.Rubber), costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, 8); |
96 | | -// GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 2L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 1L), 100, 8); |
97 | | - GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 3L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), GT_OreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 2L), 140, 16); |
98 | | - GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 4L), GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.cableGt08, aMaterial, 1L), 200, 16); |
99 | | -// GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 4L), GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.cableGt04, aMaterial, 1L), 300, 24); |
100 | | - case "Iron": case "Nickel": case "Cupronickel": case "Copper": case "AnnealedCopper": |
101 | | - /*case "Kanthal":*/ case "Gold": case "Electrum": case "Silver": case "Blue Alloy": |
102 | | - case "Nichrome": /*case "Steel":*/ /*case "BlackSteel":*/ /*case "Titanium":*/ /*case "Aluminium":*/ case "BlueAlloy" : |
103 | | - |
104 | | - case "RedstoneAlloy": |
105 | | - GT_Values.RA.addAssemblerRecipe(aStack, GT_Utility.getIntegratedCircuit(24), Materials.Rubber.getMolten(144 * costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 120, 8); |
106 | | - |
107 | | - break; |
108 | | - } |
109 | | -// GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), GT_Utility.copyAmount(1L, aStack), null, 100, 8); |
110 | | - if (GT_Mod.gregtechproxy.mAE2Integration) { |
111 | | - AE2AddNetAttunementCable(aStack, correspondingCable, aMaterial); |
112 | | - } |
113 | | - } |
114 | | - |
115 | | - //region AE2 compat |
116 | | - static { |
117 | | - if (GT_Mod.gregtechproxy.mAE2Integration) |
118 | | - setAE2Field(); |
119 | | - } |
120 | | - |
121 | | - @Optional.Method(modid = "appliedenergistics2") |
122 | | - private static void setAE2Field(){ |
123 | | - tt = TunnelType.ME; |
124 | | - } |
125 | | - |
126 | | - @Optional.Method(modid = "appliedenergistics2") |
127 | | - private void AE2addNewAttunement(ItemStack aStack){ |
128 | | - Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, (TunnelType) tt); |
129 | | - } |
130 | | - |
131 | | - @Optional.Method(modid = "appliedenergistics2") |
132 | | - private void AE2AddNetAttunementCable(ItemStack aStack, OrePrefixes correspondingCable, Materials aMaterial){ |
133 | | - Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, (TunnelType) tt); |
134 | | - Api.INSTANCE.registries().p2pTunnel().addNewAttunement(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L),(TunnelType) tt); |
135 | | - } |
136 | | -//end region |
137 | | -} |
| 1 | +//package gregtech.loaders.oreprocessing; |
| 2 | +// |
| 3 | +//import appeng.api.config.TunnelType; |
| 4 | +//import appeng.core.Api; |
| 5 | +//import cpw.mods.fml.common.Optional; |
| 6 | +//import gregtech.GT_Mod; |
| 7 | +//import gregtech.api.enums.*; |
| 8 | +//import gregtech.api.util.GT_Log; |
| 9 | +//import gregtech.api.util.GT_ModHandler; |
| 10 | +//import gregtech.api.util.GT_OreDictUnificator; |
| 11 | +//import gregtech.api.util.GT_Utility; |
| 12 | +//import gregtech.common.GT_Proxy; |
| 13 | +//import net.minecraft.item.ItemStack; |
| 14 | +// |
| 15 | +//import java.util.ArrayList; |
| 16 | +// |
| 17 | +//public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistrator { |
| 18 | +// |
| 19 | +// private Materials[] dielectrics = {Materials.PolyvinylChloride, Materials.Polydimethylsiloxane}; |
| 20 | +// private Materials[] rubbers = {Materials.Rubber, Materials.StyreneButadieneRubber, Materials.Silicone}; |
| 21 | +// private Materials[] syntheticRubbers = {Materials.StyreneButadieneRubber, Materials.Silicone}; |
| 22 | +// |
| 23 | +// private static Object tt; |
| 24 | +// public ProcessingWire() { |
| 25 | +// OrePrefixes.wireGt01.add(this); |
| 26 | +// OrePrefixes.wireGt02.add(this); |
| 27 | +// OrePrefixes.wireGt04.add(this); |
| 28 | +// OrePrefixes.wireGt08.add(this); |
| 29 | +// OrePrefixes.wireGt12.add(this); |
| 30 | +// OrePrefixes.wireGt16.add(this); |
| 31 | +// } |
| 32 | +// |
| 33 | +// @Override |
| 34 | +// public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { |
| 35 | +// if (GT_Mod.gregtechproxy.mAE2Integration) { |
| 36 | +// if (tt == TunnelType.ME) { |
| 37 | +// try { |
| 38 | +// tt = TunnelType.valueOf("GT_POWER"); |
| 39 | +// } catch (IllegalArgumentException ignored) { |
| 40 | +// tt = TunnelType.IC2_POWER; |
| 41 | +// } |
| 42 | +// } |
| 43 | +// } |
| 44 | +// |
| 45 | +// int cableWidth; |
| 46 | +// OrePrefixes correspondingCable; |
| 47 | +// OrePrefixes correspondingWire; |
| 48 | +// if (!aMaterial.contains(SubTag.YES_CABLES)) { |
| 49 | +// return; |
| 50 | +// } |
| 51 | +// switch (aPrefix) { |
| 52 | +// case wireGt01: |
| 53 | +// cableWidth = 1; |
| 54 | +// correspondingCable = OrePrefixes.cableGt01; |
| 55 | +// if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial) && !aMaterial.contains(SubTag.NO_WORKING)) { |
| 56 | +// GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), GT_Proxy.tBits, new Object[]{"Xx", 'X', OrePrefixes.plate.get(aMaterial)}); |
| 57 | +// } |
| 58 | +// break; |
| 59 | +// case wireGt08: |
| 60 | +// cableWidth = 8; |
| 61 | +// correspondingCable = OrePrefixes.cableGt08; |
| 62 | +// correspondingWire = OrePrefixes.wireGt08; |
| 63 | +// GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 8L), new Object[]{aOreDictName}); |
| 64 | +// GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, aStack), new Object[]{OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial),OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial)}); |
| 65 | +// GT_Values.RA.addAssemblerRecipe(GT_Utility.getIntegratedCircuit(8), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 8L),GT_OreDictUnificator.get(correspondingWire, aMaterial, 1L), 6, 8); |
| 66 | +// break; |
| 67 | +// |
| 68 | +// case wireGt16 : |
| 69 | +// cableWidth = 16; |
| 70 | +// correspondingCable = OrePrefixes.cableGt16; |
| 71 | +// correspondingWire = OrePrefixes.wireGt16; |
| 72 | +// GT_Values.RA.addAssemblerRecipe(GT_Utility.getIntegratedCircuit(16), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 64L),GT_OreDictUnificator.get(correspondingWire, aMaterial, 1L), 300, 24); |
| 73 | +// if (GT_Mod.gregtechproxy.mAE2Integration) { |
| 74 | +// AE2addNewAttunement(aStack); |
| 75 | +// } |
| 76 | +// break; |
| 77 | +// default: |
| 78 | +// GT_Log.err.println("OrePrefix " + aPrefix.name() + " cannot be registered as a cable for Material " + aMaterial.mName); |
| 79 | +// return; |
| 80 | +// } |
| 81 | +// |
| 82 | +// |
| 83 | +// |
| 84 | +// int costMultiplier = cableWidth / 4 + 1; |
| 85 | +// |
| 86 | +// |
| 87 | +// switch (aMaterial.mName){ |
| 88 | +// case "RedAlloy":case "Cobalt": case "Lead": case "Tin": case "Zinc":case "SolderingAlloy": |
| 89 | +// ArrayList<Object> craftingListRubber = new ArrayList<>(); |
| 90 | +// craftingListRubber.add(aOreDictName); |
| 91 | +// for (int i = 0; i < costMultiplier; i++) { |
| 92 | +// craftingListRubber.add(OrePrefixes.plate.get(Materials.Rubber)); |
| 93 | +// } |
| 94 | +// GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), craftingListRubber.toArray()); |
| 95 | +//// GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plate.get(Materials.Rubber), costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, 8); |
| 96 | +//// GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 2L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 1L), 100, 8); |
| 97 | +// GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 3L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), GT_OreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 2L), 140, 16); |
| 98 | +// GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 4L), GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.cableGt08, aMaterial, 1L), 200, 16); |
| 99 | +//// GT_Values.RA.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 4L), GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.cableGt04, aMaterial, 1L), 300, 24); |
| 100 | +// case "Iron": case "Nickel": case "Cupronickel": case "Copper": case "AnnealedCopper": |
| 101 | +// /*case "Kanthal":*/ case "Gold": case "Electrum": case "Silver": case "Blue Alloy": |
| 102 | +// case "Nichrome": /*case "Steel":*/ /*case "BlackSteel":*/ /*case "Titanium":*/ /*case "Aluminium":*/ case "BlueAlloy" : |
| 103 | +// |
| 104 | +// case "RedstoneAlloy": |
| 105 | +// GT_Values.RA.addAssemblerRecipe(aStack, GT_Utility.getIntegratedCircuit(24), Materials.Rubber.getMolten(144 * costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 120, 8); |
| 106 | +// |
| 107 | +// break; |
| 108 | +// } |
| 109 | +//// GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), GT_Utility.copyAmount(1L, aStack), null, 100, 8); |
| 110 | +// if (GT_Mod.gregtechproxy.mAE2Integration) { |
| 111 | +// AE2AddNetAttunementCable(aStack, correspondingCable, aMaterial); |
| 112 | +// } |
| 113 | +// } |
| 114 | +// |
| 115 | +// //region AE2 compat |
| 116 | +// static { |
| 117 | +// if (GT_Mod.gregtechproxy.mAE2Integration) |
| 118 | +// setAE2Field(); |
| 119 | +// } |
| 120 | +// |
| 121 | +// @Optional.Method(modid = "appliedenergistics2") |
| 122 | +// private static void setAE2Field(){ |
| 123 | +// tt = TunnelType.ME; |
| 124 | +// } |
| 125 | +// |
| 126 | +// @Optional.Method(modid = "appliedenergistics2") |
| 127 | +// private void AE2addNewAttunement(ItemStack aStack){ |
| 128 | +// Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, (TunnelType) tt); |
| 129 | +// } |
| 130 | +// |
| 131 | +// @Optional.Method(modid = "appliedenergistics2") |
| 132 | +// private void AE2AddNetAttunementCable(ItemStack aStack, OrePrefixes correspondingCable, Materials aMaterial){ |
| 133 | +// Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, (TunnelType) tt); |
| 134 | +// Api.INSTANCE.registries().p2pTunnel().addNewAttunement(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L),(TunnelType) tt); |
| 135 | +// } |
| 136 | +////end region |
| 137 | +//} |
0 commit comments