From 2a359409496620aaaad23fa1a3eae85a4297827d Mon Sep 17 00:00:00 2001 From: Calclavia Date: Wed, 26 Feb 2014 20:44:20 +0800 Subject: [PATCH] Generator can now reach up to 2 Megawatts, uses wires to limit --- .../electrical/generator/TileGenerator.java | 9 +++++---- .../electrical/wire/EnumWireMaterial.java | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/electrical/src/main/java/resonantinduction/electrical/generator/TileGenerator.java b/electrical/src/main/java/resonantinduction/electrical/generator/TileGenerator.java index 91d2f2b1..d1a3162b 100644 --- a/electrical/src/main/java/resonantinduction/electrical/generator/TileGenerator.java +++ b/electrical/src/main/java/resonantinduction/electrical/generator/TileGenerator.java @@ -27,7 +27,7 @@ public class TileGenerator extends TileElectrical implements IRotatable public TileGenerator() { - energy = new EnergyStorageHandler(10000); + energy = new EnergyStorageHandler(100000); } public byte toggleGearRatio() @@ -67,9 +67,10 @@ public class TileGenerator extends TileElectrical implements IRotatable if (receive > 0) { + double percentageUsed = (double) receive / ((double) mech.getTorque() * (double) mech.getAngularVelocity()); // TODO: Make sure this calculation/decrease is correct! - mech.setTorque((long) (mech.getTorque() * 0.9)); - mech.setAngularVelocity(mech.getAngularVelocity() * 0.9f); + mech.setTorque((long) (mech.getTorque() - (mech.getTorque() * percentageUsed))); + mech.setAngularVelocity((float) (mech.getAngularVelocity() - (mech.getAngularVelocity() * percentageUsed))); } } } @@ -89,7 +90,7 @@ public class TileGenerator extends TileElectrical implements IRotatable { if (extract > 0) { - long torqueRatio = (long) ((gearRatio + 1) / 3d * (energy.getMaxExtract())); + long torqueRatio = (long) ((gearRatio + 1) / 5d * (extract)); final float maxAngularVelocity = extract / (float) torqueRatio; diff --git a/electrical/src/main/java/resonantinduction/electrical/wire/EnumWireMaterial.java b/electrical/src/main/java/resonantinduction/electrical/wire/EnumWireMaterial.java index f3b4e06e..6875af1f 100644 --- a/electrical/src/main/java/resonantinduction/electrical/wire/EnumWireMaterial.java +++ b/electrical/src/main/java/resonantinduction/electrical/wire/EnumWireMaterial.java @@ -17,15 +17,15 @@ import codechicken.lib.colour.ColourRGBA; public enum EnumWireMaterial { /** 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("Tin", 3.1f, 1, 2000, 132, 132, 130), + TIN("Tin", 3.1f, 1, 100, 132, 132, 130), /** Iron: High Capacity */ - IRON("Iron", 3f, 3, 8000, 97, 102, 105), + IRON("Iron", 3f, 3, 800, 97, 102, 105), /** Aluminum: High Shock */ - ALUMINUM("Aluminum", 2.6f, 10, 3200, 215, 205, 181), + ALUMINUM("Aluminum", 2.6f, 10, 600, 215, 205, 181), /** 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("Superconductor", 0, 10, 1000000, 255, 255, 1);