Some generator and wind turbine render fixes

This commit is contained in:
Calclavia 2014-01-31 21:31:47 +08:00
parent 510135601e
commit 0562b19dc8
5 changed files with 24 additions and 10 deletions

View file

@ -45,6 +45,7 @@ public class TileFirebox extends TileElectricalInventory implements IPacketSende
/**
*
* It takes 338260 J to boile water.
* TODO: Make desert faster, col biomes slower.
*/
private final long requiredBoilWaterEnergy = 338260;

View file

@ -39,6 +39,14 @@ public class RenderGenerator extends TileEntitySpecialRenderer implements ICusto
// Rotate the model
switch (facingDirection)
{
case 0:
GL11.glRotatef(90, 1, 0, 0);
GL11.glTranslatef(0, -1, -1);
break;
case 1:
GL11.glRotatef(-90, 1, 0, 0);
GL11.glTranslatef(0, -1, 1);
break;
case 2:
GL11.glRotatef(180, 0f, 1f, 0f);
break;

View file

@ -38,17 +38,16 @@ public class TileGenerator extends TileElectrical implements IRotatable
@Override
public void updateEntity()
{
if (!isInversed)
{
receiveMechanical(this.getDirection());
receiveMechanical(this.getDirection().getOpposite());
receiveMechanical(getDirection());
receiveMechanical(getDirection().getOpposite());
produce();
}
else
{
produceMechanical(this.getDirection());
produceMechanical(this.getDirection().getOpposite());
produceMechanical(getDirection());
produceMechanical(getDirection().getOpposite());
}
}
@ -68,8 +67,9 @@ public class TileGenerator extends TileElectrical implements IRotatable
if (receive > 0)
{
mech.setTorque((long) (mech.getTorque() * 0.5));
mech.setAngularVelocity(mech.getAngularVelocity() * 0.5f);
// TODO: Make sure this calculation/decrease is correct!
mech.setTorque((long) (mech.getTorque() * 0.9));
mech.setAngularVelocity(mech.getAngularVelocity() * 0.9f);
}
}
}

View file

@ -7,7 +7,7 @@ public class TileSolarPanel extends TileElectrical
{
public TileSolarPanel()
{
this.energy = new EnergyStorageHandler(200);
this.energy = new EnergyStorageHandler(400);
this.ioMap = 728;
}

View file

@ -27,8 +27,7 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
{
public TileWindTurbine()
{
maxPower = 50;
torque = 50;
maxPower = 300;
}
@Override
@ -55,6 +54,12 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
super.updateEntity();
}
@Override
public boolean canConnect(ForgeDirection direction)
{
return false;
}
public long getWindPower()
{
BiomeGenBase biome = worldObj.getBiomeGenForCoords(xCoord, zCoord);