Generator can now reach up to 2 Megawatts, uses wires to limit
This commit is contained in:
parent
900b597e89
commit
2a35940949
2 changed files with 10 additions and 9 deletions
|
@ -27,7 +27,7 @@ public class TileGenerator extends TileElectrical implements IRotatable
|
||||||
|
|
||||||
public TileGenerator()
|
public TileGenerator()
|
||||||
{
|
{
|
||||||
energy = new EnergyStorageHandler(10000);
|
energy = new EnergyStorageHandler(100000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte toggleGearRatio()
|
public byte toggleGearRatio()
|
||||||
|
@ -67,9 +67,10 @@ public class TileGenerator extends TileElectrical implements IRotatable
|
||||||
|
|
||||||
if (receive > 0)
|
if (receive > 0)
|
||||||
{
|
{
|
||||||
|
double percentageUsed = (double) receive / ((double) mech.getTorque() * (double) mech.getAngularVelocity());
|
||||||
// TODO: Make sure this calculation/decrease is correct!
|
// TODO: Make sure this calculation/decrease is correct!
|
||||||
mech.setTorque((long) (mech.getTorque() * 0.9));
|
mech.setTorque((long) (mech.getTorque() - (mech.getTorque() * percentageUsed)));
|
||||||
mech.setAngularVelocity(mech.getAngularVelocity() * 0.9f);
|
mech.setAngularVelocity((float) (mech.getAngularVelocity() - (mech.getAngularVelocity() * percentageUsed)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +90,7 @@ public class TileGenerator extends TileElectrical implements IRotatable
|
||||||
{
|
{
|
||||||
if (extract > 0)
|
if (extract > 0)
|
||||||
{
|
{
|
||||||
long torqueRatio = (long) ((gearRatio + 1) / 3d * (energy.getMaxExtract()));
|
long torqueRatio = (long) ((gearRatio + 1) / 5d * (extract));
|
||||||
|
|
||||||
final float maxAngularVelocity = extract / (float) torqueRatio;
|
final float maxAngularVelocity = extract / (float) torqueRatio;
|
||||||
|
|
||||||
|
|
|
@ -17,15 +17,15 @@ import codechicken.lib.colour.ColourRGBA;
|
||||||
public enum EnumWireMaterial
|
public enum EnumWireMaterial
|
||||||
{
|
{
|
||||||
/** Copper: General. */
|
/** Copper: General. */
|
||||||
COPPER("Copper", 1.68f, 5, 300, 184, 115, 51),
|
COPPER("Copper", 1.68f, 5, 200, 184, 115, 51),
|
||||||
/** Tin: Low shock, cheap */
|
/** Tin: Low shock, cheap */
|
||||||
TIN("Tin", 3.1f, 1, 2000, 132, 132, 130),
|
TIN("Tin", 3.1f, 1, 100, 132, 132, 130),
|
||||||
/** Iron: High Capacity */
|
/** Iron: High Capacity */
|
||||||
IRON("Iron", 3f, 3, 8000, 97, 102, 105),
|
IRON("Iron", 3f, 3, 800, 97, 102, 105),
|
||||||
/** Aluminum: High Shock */
|
/** Aluminum: High Shock */
|
||||||
ALUMINUM("Aluminum", 2.6f, 10, 3200, 215, 205, 181),
|
ALUMINUM("Aluminum", 2.6f, 10, 600, 215, 205, 181),
|
||||||
/** Aluminum: Low Resistance */
|
/** Aluminum: Low Resistance */
|
||||||
SILVER("Silver", 1.59f, 5, 4000, 192, 192, 192),
|
SILVER("Silver", 1.59f, 5, 700, 192, 192, 192),
|
||||||
/** Superconductor: Over-powered */
|
/** Superconductor: Over-powered */
|
||||||
SUPERCONDUCTOR("Superconductor", 0, 10, 1000000, 255, 255, 1);
|
SUPERCONDUCTOR("Superconductor", 0, 10, 1000000, 255, 255, 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue