Fixed power not draining

This commit is contained in:
DarkGuardsman 2013-09-21 18:03:49 -04:00
parent 9e38986f1e
commit bc18a27763

View file

@ -37,9 +37,9 @@ import dark.api.energy.IPowerLess;
import dark.core.common.ExternalModHandler;
/** Basic energy tile that can consume power
*
*
* Based off both UE universal electrical tile, and electrical tile prefabs
*
*
* @author DarkGuardsman */
public class TileEntityEnergyMachine extends TileEntityMachine implements IElectrical, IElectricalStorage, IEnergySink, IEnergySource, IPowerReceptor, IPowerLess
{
@ -223,6 +223,10 @@ public class TileEntityEnergyMachine extends TileEntityMachine implements IElect
// Register to the IC2 Network
if (!this.worldObj.isRemote)
{
if (this.isFunctioning())
{
this.consumePower(this.WATTS_PER_TICK, true);
}
if (!this.isAddedToEnergyNet)
{
this.initIC();
@ -413,7 +417,7 @@ public class TileEntityEnergyMachine extends TileEntityMachine implements IElect
}
/** Produces UE power towards a specific direction.
*
*
* @param outputDirection - The output direction. */
public void produceUE(ForgeDirection outputDirection)
{
@ -442,7 +446,7 @@ public class TileEntityEnergyMachine extends TileEntityMachine implements IElect
}
/** The electrical input direction.
*
*
* @return The direction that electricity is entered into the tile. Return null for no input. By
* default you can accept power from all sides. */
public EnumSet<ForgeDirection> getInputDirections()
@ -451,7 +455,7 @@ public class TileEntityEnergyMachine extends TileEntityMachine implements IElect
}
/** The electrical output direction.
*
*
* @return The direction that electricity is output from the tile. Return null for no output. By
* default it will return an empty EnumSet. */
public EnumSet<ForgeDirection> getOutputDirections()