Toyed with heat couple
This commit is contained in:
parent
35b14aa38c
commit
23a4f53380
4 changed files with 55 additions and 20 deletions
|
@ -8,5 +8,5 @@ public interface IHeatProducer
|
|||
public boolean getCanProduceHeat(ForgeDirection dir);
|
||||
|
||||
/** Gets the amount of heat in joules this can output */
|
||||
public double getHeatAmmount(ForgeDirection dir);
|
||||
public float getHeatAmmount(ForgeDirection dir);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,59 @@
|
|||
package dark.core.common.machines;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import dark.api.energy.IHeatProducer;
|
||||
import dark.core.prefab.machine.TileEntityEnergyMachine;
|
||||
|
||||
/** Machine that turns heat into usable electrical energy
|
||||
*
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public class TileEntityHeatCouple extends TileEntityEnergyMachine
|
||||
{
|
||||
protected float tempture = 0.0f;
|
||||
protected float outputWatts = 0f;
|
||||
protected float heatJoules = 0f;
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (this.ticks % 10 == 0)
|
||||
{
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Vector3 loc = new Vector3(this).translate(new Vector3(side));
|
||||
TileEntity entity = loc.getTileEntity(this.worldObj);
|
||||
if (entity instanceof IHeatProducer && ((IHeatProducer) entity).getCanProduceHeat(side.getOpposite()))
|
||||
{
|
||||
this.heatJoules = ((IHeatProducer) entity).getHeatAmmount(side.getOpposite());
|
||||
}
|
||||
}
|
||||
this.outputWatts = heatJoules * .4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRequest(ForgeDirection direction)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProvide(ForgeDirection direction)
|
||||
{
|
||||
return this.outputWatts;
|
||||
}
|
||||
|
||||
public EnumSet<ForgeDirection> getOutputDirections()
|
||||
{
|
||||
return EnumSet.allOf(ForgeDirection.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import dark.core.prefab.machine.TileEntityEnergyMachine;
|
|||
|
||||
public class TileEntitySolarPanel extends TileEntityEnergyMachine
|
||||
{
|
||||
float wattOutput = 0;
|
||||
protected float wattOutput = 0;
|
||||
|
||||
public TileEntitySolarPanel()
|
||||
{
|
||||
|
@ -42,7 +42,6 @@ public class TileEntitySolarPanel extends TileEntityEnergyMachine
|
|||
this.wattOutput = 0;
|
||||
}
|
||||
}
|
||||
|
||||
this.wattOutput += this.wattOutput * (this.worldObj.provider instanceof ISolarLevel ? (int) ((ISolarLevel) this.worldObj.provider).getSolarEnergyMultiplier() : 0);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package dark.core.common.transmit;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import universalelectricity.compatibility.TileEntityUniversalConductor;
|
||||
import dark.core.prefab.IExtraInfo.IExtraTileEntityInfo;
|
||||
import dark.api.ColorCode;
|
||||
|
||||
public class TileEntityWire extends TileEntityUniversalConductor implements IExtraTileEntityInfo
|
||||
public class TileEntityWire extends TileEntityUniversalConductor
|
||||
{
|
||||
int updateTick = 0;
|
||||
protected int updateTick = 0;
|
||||
protected ColorCode color = ColorCode.BLACK;
|
||||
|
||||
@Override
|
||||
public float getResistance()
|
||||
|
@ -20,16 +20,4 @@ public class TileEntityWire extends TileEntityUniversalConductor implements IExt
|
|||
return BlockWire.ampMax;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExtraConfigs()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadExtraConfigs(Configuration config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue