aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gregtech/GT_Mod.java3
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java3
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java18
-rw-r--r--src/main/java/gregtech/loaders/postload/GT_AE2EnergyTunnelLoader.java27
4 files changed, 15 insertions, 36 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index e4fedf1fa1..27932b98c2 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -767,8 +767,7 @@ public class GT_Mod implements IGT_Mod {
new GT_CropLoader().run();
new GT_Worldgenloader().run();
new GT_CoverLoader().run();
- new GT_AE2EnergyTunnelLoader().run();
-
+
LoadArmorComponents.init();
GT_RecipeRegistrator.registerUsagesForMaterials(null, false, new ItemStack(Blocks.planks, 1), new ItemStack(Blocks.cobblestone, 1), new ItemStack(Blocks.stone, 1), new ItemStack(Items.leather, 1));
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
index 3373b142c4..02d6752bdd 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
@@ -24,7 +24,6 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Client;
import gregtech.common.covers.GT_Cover_SolarPanel;
-import gregtech.loaders.postload.PartP2PGTPower;
import ic2.api.energy.EnergyNet;
import ic2.api.energy.tile.IEnergyEmitter;
import ic2.api.energy.tile.IEnergySink;
@@ -423,8 +422,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
// AE2-p2p Compat
if (GT_Mod.gregtechproxy.mAE2Integration) {
- if (tTileEntity instanceof IEnergySource && tTileEntity instanceof IPartHost && ((IPartHost)tTileEntity).getPart(tDir) instanceof PartP2PGTPower && ((IEnergySource) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir))
- return true;
if (tTileEntity instanceof appeng.tile.powersink.IC2 && ((appeng.tile.powersink.IC2)tTileEntity).acceptsEnergyFrom((TileEntity)baseMetaTile, tDir))
return true;
}
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
index 7e54fdb279..63f4abcf65 100644
--- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
+++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
@@ -18,7 +18,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr
private Materials[] dielectrics = {Materials.PolyvinylChloride, Materials.Polydimethylsiloxane};
private Materials[] rubbers = {Materials.Rubber, Materials.StyreneButadieneRubber, Materials.Silicone};
private Materials[] syntheticRubbers = {Materials.StyreneButadieneRubber, Materials.Silicone};
-
+ static private TunnelType tt = TunnelType.ME;
public ProcessingWire() {
OrePrefixes.wireGt01.add(this);
OrePrefixes.wireGt02.add(this);
@@ -29,6 +29,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 +93,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);
+ Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, tt);
}
break;
default:
@@ -173,8 +183,8 @@ 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);
+ Api.INSTANCE.registries().p2pTunnel().addNewAttunement(aStack, tt);
+ Api.INSTANCE.registries().p2pTunnel().addNewAttunement(GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), tt);
}
}
}
diff --git a/src/main/java/gregtech/loaders/postload/GT_AE2EnergyTunnelLoader.java b/src/main/java/gregtech/loaders/postload/GT_AE2EnergyTunnelLoader.java
deleted file mode 100644
index a558696045..0000000000
--- a/src/main/java/gregtech/loaders/postload/GT_AE2EnergyTunnelLoader.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package gregtech.loaders.postload;
-
-import appeng.items.parts.PartType;
-import gregtech.GT_Mod;
-import gregtech.api.util.GT_Log;
-
-import java.lang.reflect.Field;
-
-public class GT_AE2EnergyTunnelLoader implements Runnable {
- @Override
- public void run() {
- if (GT_Mod.gregtechproxy.mAE2Integration) {
- try {
- load();
- } catch (Throwable e) {
- GT_Log.out.println("Failed to load P2P tunnel for GT electricity");
- e.printStackTrace(GT_Log.out);
- }
- }
- }
-
- public void load() throws Throwable {
- Field f = PartType.class.getDeclaredField("myPart");
- f.setAccessible(true);
- f.set(PartType.P2PTunnelEU, PartP2PGTPower.class);
- }
-}