aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
diff options
context:
space:
mode:
authorKiwi <42833050+Kiwi233@users.noreply.github.com>2020-12-13 21:24:20 +0800
committerGitHub <noreply@github.com>2020-12-13 21:24:20 +0800
commitd567ee9f63c6e11f2b21f26687cfc2ecaed200a1 (patch)
tree8e4c275624a966c4482b90ad85cda2375c6a63b9 /src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
parentcec32d0a604156802eee3f9e8fefccb40a62d7ef (diff)
parent7ce77a615de68add2bb0fa71818b3e36241a02a7 (diff)
downloadGT5-Unofficial-d567ee9f63c6e11f2b21f26687cfc2ecaed200a1.tar.gz
GT5-Unofficial-d567ee9f63c6e11f2b21f26687cfc2ecaed200a1.tar.bz2
GT5-Unofficial-d567ee9f63c6e11f2b21f26687cfc2ecaed200a1.zip
Merge pull request #2 from GTNewHorizons/experimental
5.09.33.57
Diffstat (limited to 'src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java')
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
index 7e54fdb279..1951c37382 100644
--- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
+++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
@@ -2,6 +2,7 @@ package gregtech.loaders.oreprocessing;
import appeng.api.config.TunnelType;
import appeng.core.Api;
+import cpw.mods.fml.common.Optional;
import gregtech.GT_Mod;
import gregtech.api.enums.*;
import gregtech.api.util.GT_Log;
@@ -19,6 +20,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr
private Materials[] rubbers = {Materials.Rubber, Materials.StyreneButadieneRubber, Materials.Silicone};
private Materials[] syntheticRubbers = {Materials.StyreneButadieneRubber, Materials.Silicone};
+ private static Object tt;
public ProcessingWire() {
OrePrefixes.wireGt01.add(this);
OrePrefixes.wireGt02.add(this);
@@ -29,6 +31,16 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr
}
public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if (GT_Mod.gregtechproxy.mAE2Integration) {
+ if (tt == TunnelType.ME) {
+ try {
+ tt = TunnelType.valueOf("GT_POWER");
+ } catch (IllegalArgumentException ignored) {
+ tt = TunnelType.IC2_POWER;
+ }
+ }
+ }
+
int cableWidth;
OrePrefixes correspondingCable;
switch (aPrefix) {
@@ -83,7 +95,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), new Object[]{OrePrefixes.wireGt12.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)});
if (GT_Mod.gregtechproxy.mAE2Integration) {
- Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, TunnelType.IC2_POWER);
+ AE2addNewAttunement(aStack);
}
break;
default:
@@ -173,8 +185,30 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr
}
GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), GT_Utility.copyAmount(1L, new Object[]{aStack}), null, 100, 8);
if (GT_Mod.gregtechproxy.mAE2Integration) {
- Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, TunnelType.IC2_POWER);
- Api.INSTANCE.registries().p2pTunnel().addNewAttunement(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), TunnelType.IC2_POWER);
+ AE2AddNetAttunementCable(aStack, correspondingCable, aMaterial);
}
}
-}
+
+ //region AE2 compat
+ static {
+ if (GT_Mod.gregtechproxy.mAE2Integration)
+ setAE2Field();
+ }
+
+ @Optional.Method(modid = "appliedenergistics2")
+ private static void setAE2Field(){
+ tt = TunnelType.ME;
+ }
+
+ @Optional.Method(modid = "appliedenergistics2")
+ private void AE2addNewAttunement(ItemStack aStack){
+ Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, (TunnelType) tt);
+ }
+
+ @Optional.Method(modid = "appliedenergistics2")
+ private void AE2AddNetAttunementCable(ItemStack aStack, OrePrefixes correspondingCable, Materials aMaterial){
+ Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, (TunnelType) tt);
+ Api.INSTANCE.registries().p2pTunnel().addNewAttunement(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L),(TunnelType) tt);
+ }
+//end region
+} \ No newline at end of file