From 1fd0353225ea949bd16a2e5a7af05a45b7c09fce Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Fri, 29 Mar 2013 12:10:23 -0400 Subject: [PATCH] v5.5.1 Release *Cleaned up code. *Fixed BuildCraft reference. --- README.md | 2 +- .../mekanism/client/RenderUniversalCable.java | 10 +- .../mekanism/common/BlockTransmitter.java | 8 +- src/minecraft/mekanism/common/CableUtils.java | 182 ++++++++++++++++++ .../common/EnergyTransferProtocol.java | 4 +- .../mekanism/common/IC2EnergyHandler.java | 2 +- src/minecraft/mekanism/common/Mekanism.java | 12 +- .../mekanism/common/MekanismUtils.java | 162 ---------------- .../common/TileEntityElectricBlock.java | 6 +- .../mekanism/common/TileEntityEnergyCube.java | 2 +- .../common/TileEntityUniversalCable.java | 2 +- .../generators/common/MekanismGenerators.java | 2 +- .../common/TileEntityGenerator.java | 3 +- .../mekanism/tools/common/MekanismTools.java | 2 +- 14 files changed, 212 insertions(+), 187 deletions(-) create mode 100644 src/minecraft/mekanism/common/CableUtils.java diff --git a/README.md b/README.md index 1277685f5..5a929c4df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mekanism for Minecraft 1.4.7 # +# Mekanism for Minecraft 1.5.1 # Source code. More information can be found on the mod's forum post. diff --git a/src/minecraft/mekanism/client/RenderUniversalCable.java b/src/minecraft/mekanism/client/RenderUniversalCable.java index a8df7c092..0203b677c 100644 --- a/src/minecraft/mekanism/client/RenderUniversalCable.java +++ b/src/minecraft/mekanism/client/RenderUniversalCable.java @@ -2,7 +2,7 @@ package mekanism.client; import java.util.Arrays; -import mekanism.common.MekanismUtils; +import mekanism.common.CableUtils; import mekanism.common.TileEntityUniversalCable; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -28,15 +28,15 @@ public class RenderUniversalCable extends TileEntitySpecialRenderer boolean[] connectable = new boolean[] {false, false, false, false, false, false}; - TileEntity[] connectedAcceptors = MekanismUtils.getConnectedEnergyAcceptors(tileEntity); - TileEntity[] connectedCables = MekanismUtils.getConnectedCables(tileEntity); - TileEntity[] connectedOutputters = MekanismUtils.getConnectedOutputters(tileEntity); + TileEntity[] connectedAcceptors = CableUtils.getConnectedEnergyAcceptors(tileEntity); + TileEntity[] connectedCables = CableUtils.getConnectedCables(tileEntity); + TileEntity[] connectedOutputters = CableUtils.getConnectedOutputters(tileEntity); for(TileEntity tile : connectedAcceptors) { int side = Arrays.asList(connectedAcceptors).indexOf(tile); - if(MekanismUtils.canCableConnect(ForgeDirection.getOrientation(side), tileEntity)) + if(CableUtils.canConnectToAcceptor(ForgeDirection.getOrientation(side), tileEntity)) { connectable[side] = true; } diff --git a/src/minecraft/mekanism/common/BlockTransmitter.java b/src/minecraft/mekanism/common/BlockTransmitter.java index 1345c5c2a..e5576852d 100644 --- a/src/minecraft/mekanism/common/BlockTransmitter.java +++ b/src/minecraft/mekanism/common/BlockTransmitter.java @@ -79,15 +79,15 @@ public class BlockTransmitter extends Block } else if(world.getBlockMetadata(x, y, z) == 1) { - TileEntity[] connectedAcceptors = MekanismUtils.getConnectedEnergyAcceptors(tileEntity); - TileEntity[] connectedCables = MekanismUtils.getConnectedCables(tileEntity); - TileEntity[] connectedOutputters = MekanismUtils.getConnectedOutputters(tileEntity); + TileEntity[] connectedAcceptors = CableUtils.getConnectedEnergyAcceptors(tileEntity); + TileEntity[] connectedCables = CableUtils.getConnectedCables(tileEntity); + TileEntity[] connectedOutputters = CableUtils.getConnectedOutputters(tileEntity); for(TileEntity tile : connectedAcceptors) { int side = Arrays.asList(connectedAcceptors).indexOf(tile); - if(MekanismUtils.canCableConnect(ForgeDirection.getOrientation(side), tileEntity)) + if(CableUtils.canConnectToAcceptor(ForgeDirection.getOrientation(side), tileEntity)) { connectable[side] = true; } diff --git a/src/minecraft/mekanism/common/CableUtils.java b/src/minecraft/mekanism/common/CableUtils.java new file mode 100644 index 000000000..ef16b1a62 --- /dev/null +++ b/src/minecraft/mekanism/common/CableUtils.java @@ -0,0 +1,182 @@ +package mekanism.common; + +import ic2.api.energy.tile.IEnergyAcceptor; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.energy.tile.IEnergySource; + +import java.util.ArrayList; + +import mekanism.api.ICableOutputter; +import mekanism.api.IStrictEnergyAcceptor; +import mekanism.api.IUniversalCable; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import universalelectricity.core.block.IConnectionProvider; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import buildcraft.api.power.IPowerReceptor; + +public final class CableUtils +{ + /** + * Gets all the connected energy acceptors, whether IC2-based or BuildCraft-based, surrounding a specific tile entity. + * @param tileEntity - center tile entity + * @return TileEntity[] of connected acceptors + */ + public static TileEntity[] getConnectedEnergyAcceptors(TileEntity tileEntity) + { + TileEntity[] acceptors = new TileEntity[] {null, null, null, null, null, null}; + + for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) + { + TileEntity acceptor = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation); + + if(acceptor instanceof IStrictEnergyAcceptor || acceptor instanceof IEnergySink || (acceptor instanceof IPowerReceptor && !(acceptor instanceof IUniversalCable) && Mekanism.hooks.BuildCraftLoaded)) + { + acceptors[orientation.ordinal()] = acceptor; + } + } + + return acceptors; + } + + /** + * Gets all the connected cables around a specific tile entity. + * @param tileEntity - center tile entity + * @return TileEntity[] of connected cables + */ + public static TileEntity[] getConnectedCables(TileEntity tileEntity) + { + TileEntity[] cables = new TileEntity[] {null, null, null, null, null, null}; + + for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) + { + TileEntity cable = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation); + + if(cable instanceof IUniversalCable && ((IUniversalCable)cable).canTransferEnergy()) + { + cables[orientation.ordinal()] = cable; + } + } + + return cables; + } + + /** + * Gets all the connected cables around a specific tile entity. + * @param tileEntity - center tile entity + * @return TileEntity[] of connected cables + */ + public static TileEntity[] getConnectedOutputters(TileEntity tileEntity) + { + TileEntity[] outputters = new TileEntity[] {null, null, null, null, null, null}; + + for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) + { + TileEntity outputter = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation); + + if(outputter instanceof ICableOutputter && ((ICableOutputter)outputter).canOutputTo(orientation.getOpposite())) + { + outputters[orientation.ordinal()] = outputter; + } + } + + return outputters; + } + + /** + * Whether or not a cable can connect to a specific acceptor. + * @param side - side to check + * @param tileEntity - cable TileEntity + * @return whether or not the cable can connect to the specific side + */ + public static boolean canConnectToAcceptor(ForgeDirection side, TileEntity tile) + { + TileEntity tileEntity = VectorHelper.getTileEntityFromSide(tile.worldObj, new Vector3(tile.xCoord, tile.yCoord, tile.zCoord), side); + + if(tileEntity instanceof IStrictEnergyAcceptor && ((IStrictEnergyAcceptor)tileEntity).canReceiveEnergy(side.getOpposite())) + { + return true; + } + + if(tileEntity instanceof IConnectionProvider && ((IConnectionProvider)tileEntity).canConnect(side.getOpposite())) + { + return true; + } + + if(tileEntity instanceof IEnergyAcceptor && ((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(null, MekanismUtils.toIC2Direction(side).getInverse())) + { + return true; + } + + if(tileEntity instanceof ICableOutputter && ((ICableOutputter)tileEntity).canOutputTo(side.getOpposite())) + { + return true; + } + + if(tileEntity instanceof IPowerReceptor && !(tileEntity instanceof IUniversalCable) && Mekanism.hooks.BuildCraftLoaded) + { + if(!(tileEntity instanceof IEnergyAcceptor) || ((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(null, MekanismUtils.toIC2Direction(side).getInverse())) + { + if(!(tileEntity instanceof IEnergySource) || ((IEnergySource)tileEntity).emitsEnergyTo(null, MekanismUtils.toIC2Direction(side).getInverse())) + { + return true; + } + } + } + + return false; + } + + /** + * Emits a defined amount of energy to the network, distributing between IC2-based and BuildCraft-based acceptors. + * @param amount - amount to send + * @param sender - sending TileEntity + * @param facing - direction the TileEntity is facing + * @return rejected energy + */ + public static double emitEnergyToNetwork(double amount, TileEntity sender, ForgeDirection facing) + { + TileEntity pointer = VectorHelper.getTileEntityFromSide(sender.worldObj, new Vector3(sender.xCoord, sender.yCoord, sender.zCoord), facing); + + if(pointer instanceof IUniversalCable) + { + return new EnergyTransferProtocol(pointer, sender, amount, new ArrayList()).calculate(); + } + + return amount; + } + + /** + * Emits energy from all sides of a TileEntity. + * @param amount - amount to send + * @param pointer - sending TileEntity + * @return rejected energy + */ + public static double emitEnergyFromAllSides(double amount, TileEntity pointer) + { + if(pointer != null) + { + return new EnergyTransferProtocol(pointer, pointer, amount, new ArrayList()).calculate(); + } + + return amount; + } + + /** + * Emits energy from all sides of a TileEntity, while ignoring specific acceptors. + * @param amount - amount to send + * @param pointer - sending TileEntity + * @param ignored - ignored acceptors + * @return rejected energy + */ + public static double emitEnergyFromAllSidesIgnore(double amount, TileEntity pointer, ArrayList ignored) + { + if(pointer != null) + { + return new EnergyTransferProtocol(pointer, pointer, amount, ignored).calculate(); + } + + return amount; + } +} diff --git a/src/minecraft/mekanism/common/EnergyTransferProtocol.java b/src/minecraft/mekanism/common/EnergyTransferProtocol.java index eb30cbb69..4559bc66a 100644 --- a/src/minecraft/mekanism/common/EnergyTransferProtocol.java +++ b/src/minecraft/mekanism/common/EnergyTransferProtocol.java @@ -73,7 +73,7 @@ public class EnergyTransferProtocol */ public void loopThrough(TileEntity tile) { - TileEntity[] acceptors = MekanismUtils.getConnectedEnergyAcceptors(tile); + TileEntity[] acceptors = CableUtils.getConnectedEnergyAcceptors(tile); for(TileEntity acceptor : acceptors) { @@ -116,7 +116,7 @@ public class EnergyTransferProtocol iteratedCables.add(tile); - TileEntity[] tubes = MekanismUtils.getConnectedCables(tile); + TileEntity[] tubes = CableUtils.getConnectedCables(tile); for(TileEntity tube : tubes) { diff --git a/src/minecraft/mekanism/common/IC2EnergyHandler.java b/src/minecraft/mekanism/common/IC2EnergyHandler.java index fb99ed066..bd996e80d 100644 --- a/src/minecraft/mekanism/common/IC2EnergyHandler.java +++ b/src/minecraft/mekanism/common/IC2EnergyHandler.java @@ -39,6 +39,6 @@ public class IC2EnergyHandler } } - event.amount = (int)(MekanismUtils.emitEnergyFromAllSidesIgnore(event.amount*Mekanism.FROM_IC2, tileEntity, ignoredTiles)*Mekanism.TO_IC2); + event.amount = (int)(CableUtils.emitEnergyFromAllSidesIgnore(event.amount*Mekanism.FROM_IC2, tileEntity, ignoredTiles)*Mekanism.TO_IC2); } } diff --git a/src/minecraft/mekanism/common/Mekanism.java b/src/minecraft/mekanism/common/Mekanism.java index c3ca8acba..b46a72ff2 100644 --- a/src/minecraft/mekanism/common/Mekanism.java +++ b/src/minecraft/mekanism/common/Mekanism.java @@ -52,7 +52,7 @@ import cpw.mods.fml.relauncher.SideOnly; * @author AidanBrady * */ -@Mod(modid = "Mekanism", name = "Mekanism", version = "5.5.0") +@Mod(modid = "Mekanism", name = "Mekanism", version = "5.5.1") @NetworkMod(channels = {"Mekanism"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class Mekanism { @@ -74,7 +74,7 @@ public class Mekanism public static Configuration configuration; /** Mekanism version number */ - public static Version versionNumber = new Version(5, 5, 0); + public static Version versionNumber = new Version(5, 5, 1); /** Map of Teleporters */ public static Map> teleporters = new HashMap>(); @@ -161,10 +161,10 @@ public class Mekanism public static boolean controlCircuitOreDict = true; public static int obsidianTNTBlastRadius = 12; public static int obsidianTNTDelay = 100; - public static double TO_IC2 = .1; - public static double TO_BC = .04; - public static double FROM_IC2 = 10; - public static double FROM_BC = 25; + public static double TO_IC2; + public static double TO_BC; + public static double FROM_IC2; + public static double FROM_BC; /** Total ticks passed since thePlayer joined theWorld */ public static int ticksPassed = 0; diff --git a/src/minecraft/mekanism/common/MekanismUtils.java b/src/minecraft/mekanism/common/MekanismUtils.java index a05069a50..485d18582 100644 --- a/src/minecraft/mekanism/common/MekanismUtils.java +++ b/src/minecraft/mekanism/common/MekanismUtils.java @@ -466,168 +466,6 @@ public final class MekanismUtils world.updateAllLightTypes(x, y, z); } - /** - * Gets all the connected energy acceptors, whether IC2-based or BuildCraft-based, surrounding a specific tile entity. - * @param tileEntity - center tile entity - * @return TileEntity[] of connected acceptors - */ - public static TileEntity[] getConnectedEnergyAcceptors(TileEntity tileEntity) - { - TileEntity[] acceptors = new TileEntity[] {null, null, null, null, null, null}; - - for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity acceptor = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation); - - if(acceptor instanceof IStrictEnergyAcceptor || acceptor instanceof IEnergySink || (acceptor instanceof IPowerReceptor && !(acceptor instanceof IUniversalCable) && Mekanism.hooks.BuildCraftLoaded)) - { - acceptors[orientation.ordinal()] = acceptor; - } - } - - return acceptors; - } - - /** - * Gets all the connected cables around a specific tile entity. - * @param tileEntity - center tile entity - * @return TileEntity[] of connected cables - */ - public static TileEntity[] getConnectedCables(TileEntity tileEntity) - { - TileEntity[] cables = new TileEntity[] {null, null, null, null, null, null}; - - for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity cable = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation); - - if(cable instanceof IUniversalCable && ((IUniversalCable)cable).canTransferEnergy()) - { - cables[orientation.ordinal()] = cable; - } - } - - return cables; - } - - /** - * Gets all the connected cables around a specific tile entity. - * @param tileEntity - center tile entity - * @return TileEntity[] of connected cables - */ - public static TileEntity[] getConnectedOutputters(TileEntity tileEntity) - { - TileEntity[] outputters = new TileEntity[] {null, null, null, null, null, null}; - - for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity outputter = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation); - - if(outputter instanceof ICableOutputter && ((ICableOutputter)outputter).canOutputTo(orientation.getOpposite())) - { - outputters[orientation.ordinal()] = outputter; - } - } - - return outputters; - } - - /** - * Whether or not a cable can connect to a specific side. - * @param side - side to check - * @param tileEntity - cable TileEntity - * @return whether or not the cable can connect to the specific side - */ - public static boolean canCableConnect(ForgeDirection side, TileEntity tile) - { - TileEntity tileEntity = VectorHelper.getTileEntityFromSide(tile.worldObj, new Vector3(tile.xCoord, tile.yCoord, tile.zCoord), side); - - if(tileEntity instanceof IStrictEnergyAcceptor && ((IStrictEnergyAcceptor)tileEntity).canReceiveEnergy(side.getOpposite())) - { - return true; - } - - if(tileEntity instanceof IConnectionProvider && ((IConnectionProvider)tileEntity).canConnect(side.getOpposite())) - { - return true; - } - - if(tileEntity instanceof IEnergyAcceptor && ((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(null, toIC2Direction(side).getInverse())) - { - return true; - } - - if(tileEntity instanceof ICableOutputter && ((ICableOutputter)tileEntity).canOutputTo(side.getOpposite())) - { - return true; - } - - if(tileEntity instanceof IPowerReceptor && !(tileEntity instanceof IUniversalCable) && Mekanism.hooks.BuildCraftLoaded) - { - if(!(tileEntity instanceof IEnergyAcceptor) || ((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(null, toIC2Direction(side).getInverse())) - { - if(!(tileEntity instanceof IEnergySource) || ((IEnergySource)tileEntity).emitsEnergyTo(null, toIC2Direction(side).getInverse())) - { - return true; - } - } - } - - return false; - } - - /** - * Emits a defined amount of energy to the network, distributing between IC2-based and BuildCraft-based acceptors. - * @param amount - amount to send - * @param sender - sending TileEntity - * @param facing - direction the TileEntity is facing - * @return rejected energy - */ - public static double emitEnergyToNetwork(double amount, TileEntity sender, ForgeDirection facing) - { - TileEntity pointer = VectorHelper.getTileEntityFromSide(sender.worldObj, new Vector3(sender.xCoord, sender.yCoord, sender.zCoord), facing); - - if(pointer instanceof IUniversalCable) - { - return new EnergyTransferProtocol(pointer, sender, amount, new ArrayList()).calculate(); - } - - return amount; - } - - /** - * Emits energy from all sides of a TileEntity. - * @param amount - amount to send - * @param pointer - sending TileEntity - * @return rejected energy - */ - public static double emitEnergyFromAllSides(double amount, TileEntity pointer) - { - if(pointer != null) - { - return new EnergyTransferProtocol(pointer, pointer, amount, new ArrayList()).calculate(); - } - - return amount; - } - - /** - * Emits energy from all sides of a TileEntity, while ignoring specific acceptors. - * @param amount - amount to send - * @param pointer - sending TileEntity - * @param ignored - ignored acceptors - * @return rejected energy - */ - public static double emitEnergyFromAllSidesIgnore(double amount, TileEntity pointer, ArrayList ignored) - { - if(pointer != null) - { - return new EnergyTransferProtocol(pointer, pointer, amount, ignored).calculate(); - } - - return amount; - } - /** * Converts a ForgeDirection enum value to it's corresponding value in IndustrialCraft's 'Direction.' Using values()[ordinal()] will not work in this situation, * as IC2 uses different values from base MC direction theory. diff --git a/src/minecraft/mekanism/common/TileEntityElectricBlock.java b/src/minecraft/mekanism/common/TileEntityElectricBlock.java index 15b2921e2..7c520b19d 100644 --- a/src/minecraft/mekanism/common/TileEntityElectricBlock.java +++ b/src/minecraft/mekanism/common/TileEntityElectricBlock.java @@ -69,7 +69,11 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i if(!worldObj.isRemote) { - powerProvider.update(this); + if(powerProvider != null) + { + powerProvider.update(this); + } + ElectricityPack electricityPack = ElectricityNetworkHelper.consumeFromMultipleSides(this, getConsumingSides(), getRequest()); setJoules(getJoules()+electricityPack.getWatts()); } diff --git a/src/minecraft/mekanism/common/TileEntityEnergyCube.java b/src/minecraft/mekanism/common/TileEntityEnergyCube.java index 4990f9add..c127c6ad6 100644 --- a/src/minecraft/mekanism/common/TileEntityEnergyCube.java +++ b/src/minecraft/mekanism/common/TileEntityEnergyCube.java @@ -104,7 +104,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEn if(tileEntity instanceof IUniversalCable) { - setJoules(electricityStored - (Math.min(electricityStored, tier.OUTPUT) - MekanismUtils.emitEnergyToNetwork(Math.min(electricityStored, tier.OUTPUT), this, ForgeDirection.getOrientation(facing)))); + setJoules(electricityStored - (Math.min(electricityStored, tier.OUTPUT) - CableUtils.emitEnergyToNetwork(Math.min(electricityStored, tier.OUTPUT), this, ForgeDirection.getOrientation(facing)))); } else if(tileEntity instanceof IEnergyConductor && Mekanism.hooks.IC2Loaded) { diff --git a/src/minecraft/mekanism/common/TileEntityUniversalCable.java b/src/minecraft/mekanism/common/TileEntityUniversalCable.java index 6d07a03eb..8c2831879 100644 --- a/src/minecraft/mekanism/common/TileEntityUniversalCable.java +++ b/src/minecraft/mekanism/common/TileEntityUniversalCable.java @@ -83,6 +83,6 @@ class CablePowerProvider extends PowerProvider { ArrayList ignored = new ArrayList(); ignored.add(VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), from)); - MekanismUtils.emitEnergyFromAllSidesIgnore(quantity*Mekanism.FROM_BC, tileEntity, ignored); + CableUtils.emitEnergyFromAllSidesIgnore(quantity*Mekanism.FROM_BC, tileEntity, ignored); } } \ No newline at end of file diff --git a/src/minecraft/mekanism/generators/common/MekanismGenerators.java b/src/minecraft/mekanism/generators/common/MekanismGenerators.java index c5eefb86f..a0c21cb5b 100644 --- a/src/minecraft/mekanism/generators/common/MekanismGenerators.java +++ b/src/minecraft/mekanism/generators/common/MekanismGenerators.java @@ -22,7 +22,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; -@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.5.0", dependencies = "required-after:Mekanism") +@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.5.1", dependencies = "required-after:Mekanism") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MekanismGenerators { diff --git a/src/minecraft/mekanism/generators/common/TileEntityGenerator.java b/src/minecraft/mekanism/generators/common/TileEntityGenerator.java index 7eb4cd193..028d41047 100644 --- a/src/minecraft/mekanism/generators/common/TileEntityGenerator.java +++ b/src/minecraft/mekanism/generators/common/TileEntityGenerator.java @@ -20,6 +20,7 @@ import mekanism.api.ICableOutputter; import mekanism.api.IUniversalCable; import mekanism.client.IHasSound; import mekanism.client.Sound; +import mekanism.common.CableUtils; import mekanism.common.Mekanism; import mekanism.common.MekanismUtils; import mekanism.common.PacketHandler; @@ -98,7 +99,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem if(tileEntity instanceof IUniversalCable) { - setJoules(electricityStored - (Math.min(electricityStored, output) - MekanismUtils.emitEnergyToNetwork(Math.min(electricityStored, output), this, ForgeDirection.getOrientation(facing)))); + setJoules(electricityStored - (Math.min(electricityStored, output) - CableUtils.emitEnergyToNetwork(Math.min(electricityStored, output), this, ForgeDirection.getOrientation(facing)))); } else if(tileEntity instanceof IEnergyConductor && Mekanism.hooks.IC2Loaded) { diff --git a/src/minecraft/mekanism/tools/common/MekanismTools.java b/src/minecraft/mekanism/tools/common/MekanismTools.java index ab24607f1..a2003addb 100644 --- a/src/minecraft/mekanism/tools/common/MekanismTools.java +++ b/src/minecraft/mekanism/tools/common/MekanismTools.java @@ -22,7 +22,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.LanguageRegistry; -@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.5.0", dependencies = "required-after:Mekanism") +@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.5.1", dependencies = "required-after:Mekanism") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MekanismTools {