diff --git a/common/mekanism/api/GasNetwork.java b/common/mekanism/api/GasNetwork.java index 137fd2208..e5a4dda1a 100644 --- a/common/mekanism/api/GasNetwork.java +++ b/common/mekanism/api/GasNetwork.java @@ -182,7 +182,7 @@ public class GasNetwork extends DynamicNetwork { TileEntity connectedBlockA = connectedBlocks[countOne]; - if(MekanismUtils.checkNetwork(connectedBlockA, GasNetwork.class) && !dealtWith[countOne]) + if(MekanismUtils.checkTransmissionType(connectedBlockA, TransmissionType.GAS) && !dealtWith[countOne]) { NetworkFinder finder = new NetworkFinder(((TileEntity)splitPoint).worldObj, Object3D.get(connectedBlockA), Object3D.get((TileEntity)splitPoint)); List partNetwork = finder.exploreNetwork(); @@ -191,7 +191,7 @@ public class GasNetwork extends DynamicNetwork { TileEntity connectedBlockB = connectedBlocks[countTwo]; - if(MekanismUtils.checkNetwork(connectedBlockB, GasNetwork.class) && !dealtWith[countTwo]) + if(MekanismUtils.checkTransmissionType(connectedBlockB, TransmissionType.GAS) && !dealtWith[countTwo]) { if(partNetwork.contains(Object3D.get(connectedBlockB))) { @@ -206,7 +206,7 @@ public class GasNetwork extends DynamicNetwork { TileEntity nodeTile = node.getTileEntity(((TileEntity)splitPoint).worldObj); - if(MekanismUtils.checkNetwork(nodeTile, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(nodeTile, TransmissionType.GAS)) { if(nodeTile != splitPoint) { @@ -236,7 +236,7 @@ public class GasNetwork extends DynamicNetwork { TileEntity nodeTile = node.getTileEntity(((TileEntity)tube).worldObj); - if(MekanismUtils.checkNetwork(nodeTile, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(nodeTile, TransmissionType.GAS)) { ((ITransmitter)nodeTile).removeFromNetwork(); newTubes.add((ITransmitter)nodeTile); @@ -271,7 +271,7 @@ public class GasNetwork extends DynamicNetwork public void loopAll(Object3D location) { - if(MekanismUtils.checkNetwork(location.getTileEntity(worldObj), GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(location.getTileEntity(worldObj), TransmissionType.GAS)) { iterated.add(location); } @@ -284,7 +284,7 @@ public class GasNetwork extends DynamicNetwork { TileEntity tileEntity = obj.getTileEntity(worldObj); - if(MekanismUtils.checkNetwork(tileEntity, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(tileEntity, TransmissionType.GAS)) { loopAll(obj); } diff --git a/common/mekanism/api/GasTransmission.java b/common/mekanism/api/GasTransmission.java index ea42dbb10..5ae5060f2 100644 --- a/common/mekanism/api/GasTransmission.java +++ b/common/mekanism/api/GasTransmission.java @@ -27,7 +27,7 @@ public final class GasTransmission { TileEntity tube = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj); - if(MekanismUtils.checkNetwork(tube, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(tube, TransmissionType.GAS)) { tubes[orientation.ordinal()] = tube; } @@ -92,7 +92,7 @@ public final class GasTransmission { TileEntity pointer = Object3D.get(sender).getFromSide(facing).getTileEntity(sender.worldObj); - if(MekanismUtils.checkNetwork(pointer, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(pointer, TransmissionType.GAS)) { return ((ITransmitter)pointer).getNetwork().emit(amount, type, sender); } @@ -118,7 +118,7 @@ public final class GasTransmission { TileEntity sideTile = Object3D.get(pointer).getFromSide(side).getTileEntity(pointer.worldObj); - if(MekanismUtils.checkNetwork(sideTile, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(sideTile, TransmissionType.GAS)) { networks.add(((ITransmitter)sideTile).getNetwork()); } diff --git a/common/mekanism/api/ITransmitter.java b/common/mekanism/api/ITransmitter.java index dbf4ae4f5..f6c0c5828 100644 --- a/common/mekanism/api/ITransmitter.java +++ b/common/mekanism/api/ITransmitter.java @@ -4,6 +4,13 @@ import net.minecraft.tileentity.TileEntity; public interface ITransmitter { + /** + * Get the transmitter's transmission type + * + * @return TransmissionType this transmitter uses + */ + public TransmissionType getTransmissionType(); + /** * Gets the network currently in use by this transmitter segment. * @return network this transmitter is using diff --git a/common/mekanism/api/TransmissionType.java b/common/mekanism/api/TransmissionType.java new file mode 100644 index 000000000..7c026ec36 --- /dev/null +++ b/common/mekanism/api/TransmissionType.java @@ -0,0 +1,9 @@ +package mekanism.api; + +public enum TransmissionType +{ + ENERGY, + FLUID, + GAS, + ITEM; +} diff --git a/common/mekanism/common/CableUtils.java b/common/mekanism/common/CableUtils.java index c0202b052..0122be282 100644 --- a/common/mekanism/common/CableUtils.java +++ b/common/mekanism/common/CableUtils.java @@ -13,6 +13,7 @@ import mekanism.api.ICableOutputter; import mekanism.api.IStrictEnergyAcceptor; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.block.IElectrical; @@ -58,7 +59,7 @@ public final class CableUtils { TileEntity cable = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj); - if(MekanismUtils.checkNetwork(cable, EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(cable, TransmissionType.ENERGY)) { cables[orientation.ordinal()] = cable; } @@ -192,7 +193,7 @@ public final class CableUtils { TileEntity pointer = Object3D.get(sender).getFromSide(facing).getTileEntity(sender.worldObj); - if(MekanismUtils.checkNetwork(pointer, EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(pointer, TransmissionType.ENERGY)) { ITransmitter cable = (ITransmitter)pointer; @@ -225,7 +226,7 @@ public final class CableUtils { TileEntity sideTile = Object3D.get(pointer).getFromSide(side).getTileEntity(pointer.worldObj); - if(MekanismUtils.checkNetwork(sideTile, EnergyNetwork.class) && !ignored.contains(sideTile)) + if(MekanismUtils.checkTransmissionType(sideTile, TransmissionType.ENERGY) && !ignored.contains(sideTile)) { networks.add(((ITransmitter)sideTile).getNetwork()); } diff --git a/common/mekanism/common/EnergyNetwork.java b/common/mekanism/common/EnergyNetwork.java index 0ad9b5549..1b0885517 100644 --- a/common/mekanism/common/EnergyNetwork.java +++ b/common/mekanism/common/EnergyNetwork.java @@ -283,7 +283,7 @@ public class EnergyNetwork extends DynamicNetwork { TileEntity connectedBlockA = connectedBlocks[countOne]; - if(MekanismUtils.checkNetwork(connectedBlockA, EnergyNetwork.class) && !dealtWith[countOne]) + if(MekanismUtils.checkTransmissionType(connectedBlockA, TransmissionType.ENERGY) && !dealtWith[countOne]) { NetworkFinder finder = new NetworkFinder(((TileEntity)splitPoint).worldObj, Object3D.get(connectedBlockA), Object3D.get((TileEntity)splitPoint)); List partNetwork = finder.exploreNetwork(); @@ -292,7 +292,7 @@ public class EnergyNetwork extends DynamicNetwork { TileEntity connectedBlockB = connectedBlocks[countTwo]; - if(MekanismUtils.checkNetwork(connectedBlockB, EnergyNetwork.class) && !dealtWith[countTwo]) + if(MekanismUtils.checkTransmissionType(connectedBlockB, TransmissionType.ENERGY) && !dealtWith[countTwo]) { if(partNetwork.contains(Object3D.get(connectedBlockB))) { @@ -307,7 +307,7 @@ public class EnergyNetwork extends DynamicNetwork { TileEntity nodeTile = node.getTileEntity(((TileEntity)splitPoint).worldObj); - if(MekanismUtils.checkNetwork(nodeTile, EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(nodeTile, TransmissionType.ENERGY)) { if(nodeTile != splitPoint) { @@ -373,7 +373,7 @@ public class EnergyNetwork extends DynamicNetwork public void loopAll(Object3D location) { - if(MekanismUtils.checkNetwork(location.getTileEntity(worldObj), EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(location.getTileEntity(worldObj), TransmissionType.ENERGY)) { iterated.add(location); } @@ -386,7 +386,7 @@ public class EnergyNetwork extends DynamicNetwork { TileEntity tileEntity = obj.getTileEntity(worldObj); - if(MekanismUtils.checkNetwork(tileEntity, EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(tileEntity, TransmissionType.ENERGY)) { loopAll(obj); } diff --git a/common/mekanism/common/FluidNetwork.java b/common/mekanism/common/FluidNetwork.java index 613abeb09..127f95a30 100644 --- a/common/mekanism/common/FluidNetwork.java +++ b/common/mekanism/common/FluidNetwork.java @@ -12,6 +12,7 @@ import java.util.Set; import mekanism.api.DynamicNetwork; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; @@ -184,7 +185,7 @@ public class FluidNetwork extends DynamicNetwork { TileEntity connectedBlockA = connectedBlocks[countOne]; - if(MekanismUtils.checkNetwork(connectedBlockA, FluidNetwork.class) && !dealtWith[countOne]) + if(MekanismUtils.checkTransmissionType(connectedBlockA, TransmissionType.FLUID) && !dealtWith[countOne]) { NetworkFinder finder = new NetworkFinder(((TileEntity)splitPoint).worldObj, Object3D.get(connectedBlockA), Object3D.get((TileEntity)splitPoint)); List partNetwork = finder.exploreNetwork(); @@ -193,7 +194,7 @@ public class FluidNetwork extends DynamicNetwork { TileEntity connectedBlockB = connectedBlocks[countTwo]; - if(MekanismUtils.checkNetwork(connectedBlockB, FluidNetwork.class) && !dealtWith[countTwo]) + if(MekanismUtils.checkTransmissionType(connectedBlockB, TransmissionType.FLUID) && !dealtWith[countTwo]) { if(partNetwork.contains(Object3D.get(connectedBlockB))) { @@ -208,7 +209,7 @@ public class FluidNetwork extends DynamicNetwork { TileEntity nodeTile = node.getTileEntity(((TileEntity)splitPoint).worldObj); - if(MekanismUtils.checkNetwork(nodeTile, FluidNetwork.class)) + if(MekanismUtils.checkTransmissionType(nodeTile, TransmissionType.FLUID)) { if(nodeTile != splitPoint) { @@ -239,7 +240,7 @@ public class FluidNetwork extends DynamicNetwork { TileEntity nodeTile = node.getTileEntity(((TileEntity)pipe).worldObj); - if(MekanismUtils.checkNetwork(nodeTile, FluidNetwork.class)) + if(MekanismUtils.checkTransmissionType(nodeTile, TransmissionType.FLUID)) { ((ITransmitter)nodeTile).removeFromNetwork(); newPipes.add((ITransmitter)nodeTile); @@ -274,7 +275,7 @@ public class FluidNetwork extends DynamicNetwork public void loopAll(Object3D location) { - if(MekanismUtils.checkNetwork(location.getTileEntity(worldObj), FluidNetwork.class)) + if(MekanismUtils.checkTransmissionType(location.getTileEntity(worldObj), TransmissionType.FLUID)) { iterated.add(location); } @@ -287,7 +288,7 @@ public class FluidNetwork extends DynamicNetwork { TileEntity tileEntity = obj.getTileEntity(worldObj); - if(MekanismUtils.checkNetwork(tileEntity, FluidNetwork.class)) + if(MekanismUtils.checkTransmissionType(tileEntity, TransmissionType.FLUID)) { loopAll(obj); } diff --git a/common/mekanism/common/InventoryNetwork.java b/common/mekanism/common/InventoryNetwork.java index eca983ce7..b3bc26136 100644 --- a/common/mekanism/common/InventoryNetwork.java +++ b/common/mekanism/common/InventoryNetwork.java @@ -11,6 +11,7 @@ import java.util.Set; import mekanism.api.DynamicNetwork; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -126,7 +127,7 @@ public class InventoryNetwork extends DynamicNetwork partNetwork = finder.exploreNetwork(); @@ -135,7 +136,7 @@ public class InventoryNetwork extends DynamicNetwork)nodeTile).removeFromNetwork(); newTransporters.add((ITransmitter)nodeTile); @@ -216,7 +217,7 @@ public class InventoryNetwork extends DynamicNetwork= ENERGY_PER_USE) { diff --git a/common/mekanism/common/MekanismUtils.java b/common/mekanism/common/MekanismUtils.java index f3d5448e8..c9e1ea449 100644 --- a/common/mekanism/common/MekanismUtils.java +++ b/common/mekanism/common/MekanismUtils.java @@ -16,6 +16,7 @@ import mekanism.api.IConfigurable; import mekanism.api.ITransmitter; import mekanism.api.ITransmitterNetwork; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import mekanism.common.IFactory.RecipeType; import mekanism.common.IRedstoneControl.RedstoneControl; import mekanism.common.PacketHandler.Transmission; @@ -960,11 +961,11 @@ public final class MekanismUtils return false; } - public static boolean checkNetwork(TileEntity tileEntity, Class networkClass) + public static boolean checkTransmissionType(TileEntity tileEntity, TransmissionType type) { if(tileEntity instanceof ITransmitter) { - if(((ITransmitter)tileEntity).getNetwork().getClass() == networkClass) + if(((ITransmitter)tileEntity).getTransmissionType() == type) { return true; } diff --git a/common/mekanism/common/PipeUtils.java b/common/mekanism/common/PipeUtils.java index 5093f6b25..a6c88b8af 100644 --- a/common/mekanism/common/PipeUtils.java +++ b/common/mekanism/common/PipeUtils.java @@ -4,6 +4,7 @@ import java.util.Arrays; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.fluids.FluidTankInfo; @@ -24,7 +25,7 @@ public final class PipeUtils { TileEntity pipe = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj); - if(MekanismUtils.checkNetwork(pipe, FluidNetwork.class)) + if(MekanismUtils.checkTransmissionType(pipe, TransmissionType.FLUID)) { pipes[orientation.ordinal()] = pipe; } diff --git a/common/mekanism/common/TileEntityEnergyCube.java b/common/mekanism/common/TileEntityEnergyCube.java index cb936d94c..e579c7fa6 100644 --- a/common/mekanism/common/TileEntityEnergyCube.java +++ b/common/mekanism/common/TileEntityEnergyCube.java @@ -15,6 +15,7 @@ import java.util.HashSet; import mekanism.api.ICableOutputter; import mekanism.api.IStrictEnergyAcceptor; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import mekanism.common.IRedstoneControl.RedstoneControl; import mekanism.common.Tier.EnergyCubeTier; import net.minecraft.item.ItemStack; @@ -74,7 +75,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEn if(electricityStored > 0) { - if(MekanismUtils.checkNetwork(tileEntity, EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(tileEntity, TransmissionType.ENERGY)) { setEnergy(electricityStored - (Math.min(electricityStored, tier.OUTPUT) - CableUtils.emitEnergyToNetwork(Math.min(electricityStored, tier.OUTPUT), this, ForgeDirection.getOrientation(facing)))); return; diff --git a/common/mekanism/common/TileEntityLogisticalTransporter.java b/common/mekanism/common/TileEntityLogisticalTransporter.java index 3f861dcab..6a96cd6b2 100644 --- a/common/mekanism/common/TileEntityLogisticalTransporter.java +++ b/common/mekanism/common/TileEntityLogisticalTransporter.java @@ -5,6 +5,7 @@ import java.util.HashSet; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import mekanism.common.PacketHandler.Transmission; import mekanism.common.network.PacketDataRequest; import net.minecraft.nbt.NBTTagCompound; @@ -22,6 +23,12 @@ public class TileEntityLogisticalTransporter extends TileEntityTransmitter)transporter).getNetwork(false) != null) + if(MekanismUtils.checkTransmissionType(transporter, getTransmissionType()) && ((ITransmitter)transporter).getNetwork(false) != null) { connectedNets.add(((ITransmitter)transporter).getNetwork()); } @@ -92,7 +99,7 @@ public class TileEntityLogisticalTransporter extends TileEntityTransmitter)tileEntity).getNetwork()); } diff --git a/common/mekanism/common/TileEntityMechanicalPipe.java b/common/mekanism/common/TileEntityMechanicalPipe.java index 5fdd32ba1..f0fd8f4fa 100644 --- a/common/mekanism/common/TileEntityMechanicalPipe.java +++ b/common/mekanism/common/TileEntityMechanicalPipe.java @@ -6,6 +6,7 @@ import java.util.HashSet; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import mekanism.common.PacketHandler.Transmission; import mekanism.common.network.PacketDataRequest; import net.minecraft.nbt.NBTTagCompound; @@ -51,6 +52,12 @@ public class TileEntityMechanicalPipe extends TileEntityTransmitter)pipe).getNetwork(false) != null) + if(MekanismUtils.checkTransmissionType(pipe, getTransmissionType()) && ((ITransmitter)pipe).getNetwork(false) != null) { connectedNets.add(((ITransmitter)pipe).getNetwork()); } @@ -120,7 +127,7 @@ public class TileEntityMechanicalPipe extends TileEntityTransmitter)tileEntity).getNetwork()); } diff --git a/common/mekanism/common/TileEntityPressurizedTube.java b/common/mekanism/common/TileEntityPressurizedTube.java index 0e67a8ee7..654d63ccd 100644 --- a/common/mekanism/common/TileEntityPressurizedTube.java +++ b/common/mekanism/common/TileEntityPressurizedTube.java @@ -8,6 +8,7 @@ import mekanism.api.GasTransmission; import mekanism.api.ITransmitter; import mekanism.api.ITubeConnection; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; @@ -19,6 +20,12 @@ public class TileEntityPressurizedTube extends TileEntityTransmitter /** The scale of the gas (0F -> 1F) currently inside this tube. */ public float gasScale; + @Override + public TransmissionType getTransmissionType() + { + return TransmissionType.ITEM; + } + @Override public GasNetwork getNetwork(boolean createIfNull) { @@ -29,7 +36,7 @@ public class TileEntityPressurizedTube extends TileEntityTransmitter for(TileEntity tube : adjacentTubes) { - if(MekanismUtils.checkNetwork(tube, GasNetwork.class) && ((ITransmitter)tube).getNetwork(false) != null) + if(MekanismUtils.checkTransmissionType(tube, TransmissionType.GAS) && ((ITransmitter)tube).getNetwork(false) != null) { connectedNets.add(((ITransmitter)tube).getNetwork()); } @@ -88,7 +95,7 @@ public class TileEntityPressurizedTube extends TileEntityTransmitter { TileEntity tileEntity = Object3D.get(this).getFromSide(side).getTileEntity(worldObj); - if(MekanismUtils.checkNetwork(tileEntity, GasNetwork.class)) + if(MekanismUtils.checkTransmissionType(tileEntity, TransmissionType.GAS)) { getNetwork().merge(((ITransmitter)tileEntity).getNetwork()); } diff --git a/common/mekanism/common/TileEntityTransmitter.java b/common/mekanism/common/TileEntityTransmitter.java index f3fa06a26..2702e99e2 100644 --- a/common/mekanism/common/TileEntityTransmitter.java +++ b/common/mekanism/common/TileEntityTransmitter.java @@ -3,6 +3,7 @@ package mekanism.common; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mekanism.api.ITransmitter; +import mekanism.api.TransmissionType; import mekanism.api.TransmitterNetworkRegistry; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; @@ -38,7 +39,7 @@ public abstract class TileEntityTransmitter extends TileEntity implements ITr @Override public boolean areNetworksEqual(TileEntity tileEntity) { - return tileEntity instanceof ITransmitter && getNetwork().getClass() == ((ITransmitter)tileEntity).getNetwork().getClass(); + return tileEntity instanceof ITransmitter && getTransmissionType() == ((ITransmitter)tileEntity).getTransmissionType(); } @Override diff --git a/common/mekanism/common/TileEntityUniversalCable.java b/common/mekanism/common/TileEntityUniversalCable.java index 76a68c149..038cf8bbb 100644 --- a/common/mekanism/common/TileEntityUniversalCable.java +++ b/common/mekanism/common/TileEntityUniversalCable.java @@ -4,6 +4,7 @@ import java.util.HashSet; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; @@ -24,6 +25,12 @@ public class TileEntityUniversalCable extends TileEntityTransmitter)cable).getNetwork(false) != null) + if(MekanismUtils.checkTransmissionType(cable, TransmissionType.ENERGY) && ((ITransmitter)cable).getNetwork(false) != null) { connectedNets.add(((ITransmitter)cable).getNetwork()); } @@ -99,7 +106,7 @@ public class TileEntityUniversalCable extends TileEntityTransmitter)tileEntity).getNetwork()); } diff --git a/common/mekanism/common/TransporterUtils.java b/common/mekanism/common/TransporterUtils.java index 4f6bc8547..69f5a0217 100644 --- a/common/mekanism/common/TransporterUtils.java +++ b/common/mekanism/common/TransporterUtils.java @@ -4,6 +4,7 @@ import java.util.Arrays; import mekanism.api.ITransmitter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.tileentity.TileEntity; @@ -24,7 +25,7 @@ public final class TransporterUtils { TileEntity transporter = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj); - if(MekanismUtils.checkNetwork(transporter, InventoryNetwork.class)) + if(MekanismUtils.checkTransmissionType(transporter, TransmissionType.ITEM)) { transporters[orientation.ordinal()] = transporter; } diff --git a/common/mekanism/generators/common/TileEntityGenerator.java b/common/mekanism/generators/common/TileEntityGenerator.java index a6f674bba..1b33b90b5 100644 --- a/common/mekanism/generators/common/TileEntityGenerator.java +++ b/common/mekanism/generators/common/TileEntityGenerator.java @@ -12,6 +12,7 @@ import java.util.EnumSet; import mekanism.api.ICableOutputter; import mekanism.api.Object3D; +import mekanism.api.TransmissionType; import mekanism.client.IHasSound; import mekanism.common.CableUtils; import mekanism.common.EnergyNetwork; @@ -104,7 +105,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem if(electricityStored > 0) { - if(MekanismUtils.checkNetwork(tileEntity, EnergyNetwork.class)) + if(MekanismUtils.checkTransmissionType(tileEntity, TransmissionType.ENERGY)) { setEnergy(electricityStored - (Math.min(electricityStored, output) - CableUtils.emitEnergyToNetwork(Math.min(electricityStored, output), this, ForgeDirection.getOrientation(facing)))); }