diff --git a/src/main/java/com/builtbroken/assemblyline/generators/TileEntitySolarPanel.java b/src/main/java/com/builtbroken/assemblyline/generators/TileEntitySolarPanel.java index 077f1b622..a77a08030 100644 --- a/src/main/java/com/builtbroken/assemblyline/generators/TileEntitySolarPanel.java +++ b/src/main/java/com/builtbroken/assemblyline/generators/TileEntitySolarPanel.java @@ -11,7 +11,7 @@ public class TileEntitySolarPanel extends TileEntityGenerator { public TileEntitySolarPanel() { - super(0, 1); + super(0); } @Override @@ -20,6 +20,12 @@ public class TileEntitySolarPanel extends TileEntityGenerator return EnumSet.of(ForgeDirection.DOWN); } + @Override + public boolean hasFuel() + { + return this.JOULES_PER_TICK > 0; + } + @Override public void consumeFuel() { @@ -54,4 +60,17 @@ public class TileEntitySolarPanel extends TileEntityGenerator } } + + @Override + public long getEnergy(ForgeDirection from) + { + return 0; + } + + @Override + public long getEnergyCapacity(ForgeDirection from) + { + return 0; + } + } diff --git a/src/main/java/com/builtbroken/assemblyline/item/ItemReadoutTools.java b/src/main/java/com/builtbroken/assemblyline/item/ItemReadoutTools.java index e88e59ae7..a1af6a6bb 100644 --- a/src/main/java/com/builtbroken/assemblyline/item/ItemReadoutTools.java +++ b/src/main/java/com/builtbroken/assemblyline/item/ItemReadoutTools.java @@ -25,11 +25,13 @@ import buildcraft.api.power.IPowerReceptor; import cofh.api.energy.IEnergyStorage; import com.builtbroken.assemblyline.AssemblyLine; +import com.builtbroken.assemblyline.machine.TileEntityGenerator; import com.builtbroken.minecraft.DarkCore; import com.builtbroken.minecraft.fluid.FluidHelper; import com.builtbroken.minecraft.interfaces.IToolReadOut; import com.builtbroken.minecraft.interfaces.IToolReadOut.EnumTools; import com.builtbroken.minecraft.prefab.ItemBasic; +import com.builtbroken.minecraft.prefab.TileEntityEnergyMachine; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -159,6 +161,18 @@ public class ItemReadoutTools extends ItemBasic else if (tileEntity instanceof IEnergyContainer) { player.sendChatToPlayer(ChatMessageComponent.createFromText("E~:" + UnitDisplay.getDisplay(((IEnergyContainer) tileEntity).getEnergy(hitSide), Unit.JOULES, 2, false) + "/" + UnitDisplay.getDisplay(((IEnergyContainer) tileEntity).getEnergyCapacity(hitSide), Unit.JOULES, 2, false))); + if (tileEntity instanceof TileEntityEnergyMachine) + { + if (tileEntity instanceof TileEntityGenerator) + { + player.sendChatToPlayer(ChatMessageComponent.createFromText("E~Out:" + UnitDisplay.getDisplay(((TileEntityEnergyMachine) tileEntity).getJoulesPerTick(), Unit.JOULES, 2, true) + "/tick")); + } + else + { + player.sendChatToPlayer(ChatMessageComponent.createFromText("E~In:" + UnitDisplay.getDisplay(((TileEntityEnergyMachine) tileEntity).getJoulesPerTick(), Unit.JOULES, 2, true) + "/tick")); + + } + } } else if (tileEntity instanceof IEnergyStorage) { diff --git a/src/main/java/com/builtbroken/assemblyline/machine/TileEntityGenerator.java b/src/main/java/com/builtbroken/assemblyline/machine/TileEntityGenerator.java index 51d9f6188..7cd8b9bcc 100644 --- a/src/main/java/com/builtbroken/assemblyline/machine/TileEntityGenerator.java +++ b/src/main/java/com/builtbroken/assemblyline/machine/TileEntityGenerator.java @@ -30,10 +30,7 @@ public abstract class TileEntityGenerator extends TileEntityEnergyMachine super.updateEntity(); if (!this.worldObj.isRemote && this.enabled) { - if (this.burnTime <= 0) - { - this.consumeFuel(); - } + this.consumeFuel(); if (this.isFunctioning()) { this.burnTime--; @@ -53,7 +50,7 @@ public abstract class TileEntityGenerator extends TileEntityEnergyMachine return burnTime > 0; } - /** Called when the burn time is bellow 10 and the machine needs to keep running */ + /** Called each tick to handle anything fuel related */ public abstract void consumeFuel(); /* ********************************************