Skip to content

Commit 7cddc54

Browse files
committed
drop ec support
1 parent 61d38d1 commit 7cddc54

File tree

9 files changed

+34
-39
lines changed

9 files changed

+34
-39
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
deobfCompile 'curse.maven:baubles-227083:2518667' //baubles
5656
compileOnly 'curse.maven:opencomputers-223008:4630537' //oc
5757
compileOnly "curse.maven:mekanism-ce-399904:4804509" //mek-ce
58-
compileOnly "curse.maven:ae-additions-extra-cells-2-fork-493962:3814371" //aeadditions
58+
compileOnly "curse.maven:mekanism-energistics-1027681:5389347" //mekeng
5959
}
6060

6161
minecraft {

src/main/java/com/glodblock/github/common/tile/TileFluidPacketDecoder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
import com.glodblock.github.loader.FCItems;
2929
import com.glodblock.github.util.ModAndClassUtil;
3030
import com.glodblock.github.util.Util;
31-
import com.the9grounds.aeadditions.api.gas.IAEGasStack;
32-
import com.the9grounds.aeadditions.api.gas.IGasStorageChannel;
33-
import com.the9grounds.aeadditions.integration.mekanism.gas.AEGasStack;
31+
import com.mekeng.github.common.me.data.IAEGasStack;
32+
import com.mekeng.github.common.me.data.impl.AEGasStack;
33+
import com.mekeng.github.common.me.storage.IGasStorageChannel;
3434
import mekanism.api.gas.GasStack;
3535
import net.minecraft.item.ItemStack;
3636
import net.minecraft.nbt.NBTTagCompound;
@@ -118,7 +118,7 @@ public TickRateModulation tickingRequest(@Nonnull IGridNode node, int ticksSince
118118
inventory.setStackInSlot(0, ItemStack.EMPTY);
119119
return TickRateModulation.SLEEP;
120120
}
121-
IAEStack aeGas = new AEGasStack(gas);
121+
IAEStack aeGas = AEGasStack.of(gas);
122122
IEnergyGrid energyGrid = node.getGrid().getCache(IEnergyGrid.class);
123123
IMEMonitor gasGrid = node.getGrid().<IStorageGrid>getCache(IStorageGrid.class)
124124
.getInventory(AEApi.instance().storage().getStorageChannel(IGasStorageChannel.class));
@@ -127,7 +127,7 @@ public TickRateModulation tickingRequest(@Nonnull IGridNode node, int ticksSince
127127
if (remaining.getStackSize() == aeGas.getStackSize()) {
128128
return TickRateModulation.SLOWER;
129129
}
130-
inventory.setStackInSlot(0, FakeGases.packGas2Packet((GasStack) ((IAEGasStack) remaining).getGasStack()));
130+
inventory.setStackInSlot(0, FakeGases.packGas2Packet(((IAEGasStack) remaining).getGasStack()));
131131
return TickRateModulation.FASTER;
132132
} else {
133133
inventory.setStackInSlot(0, ItemStack.EMPTY);

src/main/java/com/glodblock/github/common/tile/TileGasDiscretizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
import com.glodblock.github.common.item.fake.FakeItemRegister;
3333
import com.glodblock.github.integration.mek.FakeGases;
3434
import com.glodblock.github.util.Util;
35-
import com.the9grounds.aeadditions.api.gas.IAEGasStack;
36-
import com.the9grounds.aeadditions.api.gas.IGasStorageChannel;
35+
import com.mekeng.github.common.me.data.IAEGasStack;
36+
import com.mekeng.github.common.me.storage.IGasStorageChannel;
3737
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
3838

3939
import javax.annotation.Nullable;

src/main/java/com/glodblock/github/coremod/CoreModHooks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
import com.glodblock.github.util.SetBackedMachineSet;
5959
import com.google.common.base.Preconditions;
6060
import com.google.common.collect.Sets;
61-
import com.the9grounds.aeadditions.api.gas.IAEGasStack;
62-
import com.the9grounds.aeadditions.api.gas.IGasStorageChannel;
61+
import com.mekeng.github.common.me.data.IAEGasStack;
62+
import com.mekeng.github.common.me.storage.IGasStorageChannel;
6363
import mekanism.api.gas.GasStack;
6464
import net.minecraft.inventory.InventoryCrafting;
6565
import net.minecraft.item.ItemStack;

src/main/java/com/glodblock/github/integration/mek/FakeGases.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import com.glodblock.github.common.item.ItemGasPacket;
77
import com.glodblock.github.common.item.fake.FakeItemHandler;
88
import com.glodblock.github.common.item.fake.FakeItemRegister;
9-
import com.the9grounds.aeadditions.api.gas.IAEGasStack;
10-
import com.the9grounds.aeadditions.integration.mekanism.gas.AEGasStack;
9+
import com.mekeng.github.common.me.data.IAEGasStack;
10+
import com.mekeng.github.common.me.data.impl.AEGasStack;
1111
import mekanism.api.gas.Gas;
1212
import mekanism.api.gas.GasRegistry;
1313
import mekanism.api.gas.GasStack;
@@ -60,7 +60,7 @@ public IAEGasStack getAEStack(@Nullable IAEItemStack stack) {
6060
if (gas == null || gas.getGas() == null) {
6161
return null;
6262
}
63-
IAEGasStack gasStack = new AEGasStack(gas);
63+
IAEGasStack gasStack = AEGasStack.of(gas);
6464
gasStack.setStackSize(stack.getStackSize());
6565
return gasStack;
6666
}
@@ -140,7 +140,7 @@ public IAEGasStack getAEStack(@Nullable IAEItemStack stack) {
140140
if (gas == null || gas.getGas() == null) {
141141
return null;
142142
}
143-
return new AEGasStack(gas);
143+
return AEGasStack.of(gas);
144144
}
145145

146146
@Override

src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.glodblock.github.inventory;
22

33
import appeng.api.config.FuzzyMode;
4-
import appeng.api.networking.IGridNode;
54
import appeng.api.parts.IPart;
65
import appeng.fluids.helper.DualityFluidInterface;
76
import appeng.fluids.helper.IFluidInterfaceHost;
@@ -21,8 +20,7 @@
2120
import com.glodblock.github.integration.mek.FakeGases;
2221
import com.glodblock.github.util.Ae2Reflect;
2322
import com.glodblock.github.util.ModAndClassUtil;
24-
import com.the9grounds.aeadditions.part.PartECBase;
25-
import com.the9grounds.aeadditions.tileentity.TileEntityGasInterface;
23+
import com.mekeng.github.common.me.duality.IGasInterfaceHost;
2624
import mekanism.api.gas.GasStack;
2725
import mekanism.api.gas.GasTankInfo;
2826
import mekanism.api.gas.IGasHandler;
@@ -150,7 +148,7 @@ public ItemStack addItems(ItemStack toBeAdded) {
150148
GasStack gas = FakeItemRegister.getStack(toBeAdded);
151149
if (invGases != null && posInterface != null) {
152150
TileEntity te = (TileEntity) facingTE;
153-
IGridNode node = getGasInterfaceGrid(te, facing);
151+
AENetworkProxy node = getGasInterfaceGrid(te, facing);
154152
IGasHandler gasHandler = (IGasHandler) invGases;
155153
if (!isSameGrid(node)) {
156154
if (gas != null && gas.getGas() != null) {
@@ -167,7 +165,7 @@ public ItemStack addItems(ItemStack toBeAdded) {
167165
for (EnumFacing dir : EnumFacing.values()) {
168166
TileEntity te = posInterface.getWorld().getTileEntity(posInterface.getPos().add(dir.getDirectionVec()));
169167
if (te != null) {
170-
IGridNode node = getGasInterfaceGrid(te, dir);
168+
AENetworkProxy node = getGasInterfaceGrid(te, dir);
171169
if (node != null && isSameGrid(node)) {
172170
continue;
173171
}
@@ -187,7 +185,7 @@ public ItemStack addItems(ItemStack toBeAdded) {
187185
if (invGases != null && posInterface != null) {
188186
GasStack gas = FakeItemRegister.getStack(toBeAdded);
189187
TileEntity te = (TileEntity) facingTE;
190-
IGridNode node = getGasInterfaceGrid(te, facing);
188+
AENetworkProxy node = getGasInterfaceGrid(te, facing);
191189
IGasHandler gasHandler = (IGasHandler) invGases;
192190
if (!isSameGrid(node)) {
193191
if (gas != null && gas.getGas() != null) {
@@ -269,7 +267,7 @@ public ItemStack simulateAdd(ItemStack toBeSimulated) {
269267
GasStack gas = FakeItemRegister.getStack(toBeSimulated);
270268
if (invGases != null && posInterface != null) {
271269
TileEntity te = (TileEntity) facingTE;
272-
IGridNode node = getGasInterfaceGrid(te, facing);
270+
AENetworkProxy node = getGasInterfaceGrid(te, facing);
273271
IGasHandler gasHandler = (IGasHandler) invGases;
274272
if (!isSameGrid(node)) {
275273
if (gas != null && gas.getGas() != null) {
@@ -295,7 +293,7 @@ public ItemStack simulateAdd(ItemStack toBeSimulated) {
295293
if (interFTE != null && isSameGrid(interFTE)) {
296294
continue;
297295
}
298-
IGridNode node = getGasInterfaceGrid(te, dir);
296+
AENetworkProxy node = getGasInterfaceGrid(te, dir);
299297
if (isSameGrid(node)) {
300298
continue;
301299
}
@@ -318,7 +316,7 @@ public ItemStack simulateAdd(ItemStack toBeSimulated) {
318316
if (invGases != null && posInterface != null) {
319317
GasStack gas = FakeItemRegister.getStack(toBeSimulated);
320318
TileEntity te = (TileEntity) facingTE;;
321-
IGridNode node = getGasInterfaceGrid(te, facing);
319+
AENetworkProxy node = getGasInterfaceGrid(te, facing);
322320
IGasHandler gasHandler = (IGasHandler) invGases;
323321
if (!isSameGrid(node)) {
324322
if (gas != null) {
@@ -419,13 +417,13 @@ protected static IFluidInterfaceHost getFluidInterfaceTE(TileEntity te, EnumFaci
419417
return null;
420418
}
421419

422-
protected static IGridNode getGasInterfaceGrid(@Nullable TileEntity te, EnumFacing face) {
423-
if (te instanceof TileEntityGasInterface) {
424-
return Ae2Reflect.getGasInterfaceGrid(te);
420+
protected static AENetworkProxy getGasInterfaceGrid(@Nullable TileEntity te, EnumFacing face) {
421+
if (te instanceof IGasInterfaceHost) {
422+
return Ae2Reflect.getGasInterfaceGrid(((IGasInterfaceHost) te).getDualityGasInterface());
425423
} else if (te instanceof TileCableBus) {
426424
IPart part = ((TileCableBus) te).getPart(face.getOpposite());
427-
if (part instanceof PartECBase) {
428-
return part.getGridNode();
425+
if (part instanceof IGasInterfaceHost) {
426+
return Ae2Reflect.getGasInterfaceGrid(((IGasInterfaceHost) part).getDualityGasInterface());
429427
}
430428
}
431429
return null;
@@ -463,7 +461,7 @@ private boolean isSameGrid(IFluidInterfaceHost target) {
463461
return false;
464462
}
465463

466-
private boolean isSameGrid(IGridNode target) {
464+
private boolean isSameGrid(AENetworkProxy target) {
467465
if (this.self != null && target != null) {
468466
try {
469467
AENetworkProxy proxy = Ae2Reflect.getInterfaceProxy(this.self);

src/main/java/com/glodblock/github/util/Ae2Reflect.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import appeng.api.definitions.IItemDefinition;
44
import appeng.api.networking.IGrid;
5-
import appeng.api.networking.IGridNode;
65
import appeng.api.networking.crafting.ICraftingCPU;
76
import appeng.api.networking.security.IActionSource;
87
import appeng.api.storage.data.IAEItemStack;
@@ -19,7 +18,7 @@
1918
import appeng.tile.inventory.AppEngInternalInventory;
2019
import appeng.util.inv.ItemSlot;
2120
import appeng.util.inv.filter.IAEItemFilter;
22-
import com.the9grounds.aeadditions.tileentity.TileEntityGasInterface;
21+
import com.mekeng.github.common.me.duality.impl.DualityGasInterface;
2322
import net.minecraft.inventory.Container;
2423
import net.minecraft.inventory.InventoryCrafting;
2524
import net.minecraft.world.World;
@@ -52,7 +51,7 @@ public class Ae2Reflect {
5251
private static final Field fContainerOpenContext_y;
5352
private static final Field fContainerOpenContext_z;
5453
private static final Field fCraftingCPURecord_cpu;
55-
private static final Field fTileEntityGasInterface_node;
54+
private static final Field fDualityGasInterface_gridProxy;
5655

5756
static {
5857
try {
@@ -78,9 +77,9 @@ public class Ae2Reflect {
7877
fContainerOpenContext_z = reflectField(ContainerOpenContext.class, "z");
7978
fCraftingCPURecord_cpu = reflectField(CraftingCPURecord.class, "cpu");
8079
if (ModAndClassUtil.GAS) {
81-
fTileEntityGasInterface_node = reflectField(TileEntityGasInterface.class, "node");
80+
fDualityGasInterface_gridProxy = reflectField(DualityGasInterface.class, "gridProxy");
8281
} else {
83-
fTileEntityGasInterface_node = null;
82+
fDualityGasInterface_gridProxy = null;
8483
}
8584
} catch (Exception e) {
8685
throw new IllegalStateException("Failed to initialize AE2 reflection hacks!", e);
@@ -260,8 +259,8 @@ public static ICraftingCPU getCraftingCPU(CraftingCPURecord owner) {
260259
return readField(owner, fCraftingCPURecord_cpu);
261260
}
262261

263-
public static IGridNode getGasInterfaceGrid(Object owner) {
264-
return readField(owner, fTileEntityGasInterface_node);
262+
public static AENetworkProxy getGasInterfaceGrid(Object owner) {
263+
return readField(owner, fDualityGasInterface_gridProxy);
265264
}
266265

267266
}

src/main/java/com/glodblock/github/util/ModAndClassUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static void init() {
3232
OC = true;
3333
}
3434

35-
if (Loader.isModLoaded("mekanism") && Loader.isModLoaded("aeadditions")) {
35+
if (Loader.isModLoaded("mekanism") && Loader.isModLoaded("mekeng")) {
3636
GAS = true;
3737
}
3838
}

src/main/java/com/glodblock/github/util/Util.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import appeng.api.storage.data.IAEFluidStack;
1111
import appeng.api.storage.data.IAEItemStack;
1212
import appeng.api.storage.data.IItemList;
13-
import appeng.container.interfaces.IInventorySlotAware;
1413
import appeng.core.localization.PlayerMessages;
1514
import appeng.fluids.util.AEFluidInventory;
1615
import appeng.fluids.util.AEFluidStack;
@@ -34,7 +33,6 @@
3433
import net.minecraft.nbt.NBTTagCompound;
3534
import net.minecraft.network.PacketBuffer;
3635
import net.minecraft.util.EnumFacing;
37-
import net.minecraft.util.EnumHand;
3836
import net.minecraft.util.math.BlockPos;
3937
import net.minecraft.world.World;
4038
import net.minecraftforge.fluids.FluidStack;

0 commit comments

Comments
 (0)