Made multi-meter detail energy IO for my machines
This commit is contained in:
parent
ad24bb4a23
commit
5e3bbc9a05
3 changed files with 36 additions and 6 deletions
|
@ -11,7 +11,7 @@ public class TileEntitySolarPanel extends TileEntityGenerator
|
||||||
{
|
{
|
||||||
public TileEntitySolarPanel()
|
public TileEntitySolarPanel()
|
||||||
{
|
{
|
||||||
super(0, 1);
|
super(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,6 +20,12 @@ public class TileEntitySolarPanel extends TileEntityGenerator
|
||||||
return EnumSet.of(ForgeDirection.DOWN);
|
return EnumSet.of(ForgeDirection.DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasFuel()
|
||||||
|
{
|
||||||
|
return this.JOULES_PER_TICK > 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void consumeFuel()
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,13 @@ import buildcraft.api.power.IPowerReceptor;
|
||||||
import cofh.api.energy.IEnergyStorage;
|
import cofh.api.energy.IEnergyStorage;
|
||||||
|
|
||||||
import com.builtbroken.assemblyline.AssemblyLine;
|
import com.builtbroken.assemblyline.AssemblyLine;
|
||||||
|
import com.builtbroken.assemblyline.machine.TileEntityGenerator;
|
||||||
import com.builtbroken.minecraft.DarkCore;
|
import com.builtbroken.minecraft.DarkCore;
|
||||||
import com.builtbroken.minecraft.fluid.FluidHelper;
|
import com.builtbroken.minecraft.fluid.FluidHelper;
|
||||||
import com.builtbroken.minecraft.interfaces.IToolReadOut;
|
import com.builtbroken.minecraft.interfaces.IToolReadOut;
|
||||||
import com.builtbroken.minecraft.interfaces.IToolReadOut.EnumTools;
|
import com.builtbroken.minecraft.interfaces.IToolReadOut.EnumTools;
|
||||||
import com.builtbroken.minecraft.prefab.ItemBasic;
|
import com.builtbroken.minecraft.prefab.ItemBasic;
|
||||||
|
import com.builtbroken.minecraft.prefab.TileEntityEnergyMachine;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
@ -159,6 +161,18 @@ public class ItemReadoutTools extends ItemBasic
|
||||||
else if (tileEntity instanceof IEnergyContainer)
|
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)));
|
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)
|
else if (tileEntity instanceof IEnergyStorage)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,10 +30,7 @@ public abstract class TileEntityGenerator extends TileEntityEnergyMachine
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if (!this.worldObj.isRemote && this.enabled)
|
if (!this.worldObj.isRemote && this.enabled)
|
||||||
{
|
{
|
||||||
if (this.burnTime <= 0)
|
this.consumeFuel();
|
||||||
{
|
|
||||||
this.consumeFuel();
|
|
||||||
}
|
|
||||||
if (this.isFunctioning())
|
if (this.isFunctioning())
|
||||||
{
|
{
|
||||||
this.burnTime--;
|
this.burnTime--;
|
||||||
|
@ -53,7 +50,7 @@ public abstract class TileEntityGenerator extends TileEntityEnergyMachine
|
||||||
return burnTime > 0;
|
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();
|
public abstract void consumeFuel();
|
||||||
|
|
||||||
/* ********************************************
|
/* ********************************************
|
||||||
|
|
Loading…
Add table
Reference in a new issue