Some turbine fixes and tweaks

This commit is contained in:
Calclavia 2014-02-05 13:06:05 +08:00
parent dcfdb7ad03
commit 82e03d45fd
3 changed files with 16 additions and 32 deletions

View file

@ -64,13 +64,13 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
{ {
if (angularVelocity > 0) if (angularVelocity > 0)
{ {
torque += 10; torque += 1;
angularVelocity += 0.1f; angularVelocity += 0.01f;
} }
else else
{ {
torque -= 10; torque -= 1;
angularVelocity -= 0.1f; angularVelocity -= 0.01f;
} }
manualCrankTime--; manualCrankTime--;

View file

@ -25,8 +25,8 @@ public class TileWaterTurbine extends TileTurbine implements IMechanical
{ {
public TileWaterTurbine() public TileWaterTurbine()
{ {
maxPower = 800; maxPower = 300;
torque = 500; torque = defaultTorque;
} }
@Override @Override

View file

@ -25,11 +25,6 @@ import calclavia.lib.prefab.turbine.TileTurbine;
*/ */
public class TileWindTurbine extends TileTurbine implements IMechanical public class TileWindTurbine extends TileTurbine implements IMechanical
{ {
public TileWindTurbine()
{
maxPower = 500;
}
@Override @Override
public void invalidate() public void invalidate()
{ {
@ -45,13 +40,18 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
*/ */
if (getDirection().offsetY == 0) if (getDirection().offsetY == 0)
{ {
maxPower = 100;
getMultiBlock().get().power += getWindPower(); getMultiBlock().get().power += getWindPower();
} }
else
{
maxPower = 1000;
}
if (!getMultiBlock().isConstructed()) if (!getMultiBlock().isConstructed())
torque = defaultTorque / 10; torque = defaultTorque / 6;
else else
torque = defaultTorque; torque = defaultTorque / 2;
super.updateEntity(); super.updateEntity();
} }
@ -66,13 +66,11 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
{ {
BiomeGenBase biome = worldObj.getBiomeGenForCoords(xCoord, zCoord); BiomeGenBase biome = worldObj.getBiomeGenForCoords(xCoord, zCoord);
boolean hasBonus = biome instanceof BiomeGenOcean || biome instanceof BiomeGenPlains || biome == BiomeGenBase.river; boolean hasBonus = biome instanceof BiomeGenOcean || biome instanceof BiomeGenPlains || biome == BiomeGenBase.river;
return (long) ((worldObj.canBlockSeeTheSky(xCoord, yCoord + 4, zCoord) ? (((float) yCoord + 4) / 256) * 200 : 0) + (hasBonus ? 80 : 0)) * (worldObj.isRaining() ? 2 : 1);
}
@Override if (!worldObj.canBlockSeeTheSky(xCoord, yCoord + 4, zCoord))
public void onProduce() return 0;
{
return (long) (((((float) yCoord + 4) / 256) * maxPower) + (hasBonus ? 80 : 0)) * (worldObj.isRaining() ? 2 : 1);
} }
@Override @Override
@ -86,20 +84,6 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
} }
} }
@Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbt = new NBTTagCompound();
writeToNBT(nbt);
return ResonantInduction.PACKET_TILE.getPacket(this, (byte) 1, nbt);
}
@Override
public void sendPowerUpdate()
{
PacketHandler.sendPacketToClients(ResonantInduction.PACKET_TILE.getPacket(this, (byte) 2, angularVelocity), this.worldObj, new Vector3(this), 25);
}
/** /**
* Mechanical Methods * Mechanical Methods
* *