Tweaked some mechanical mechanics

This commit is contained in:
Calclavia 2014-02-16 00:53:11 +08:00
parent 08c0aad457
commit 0d736a612f
7 changed files with 16 additions and 17 deletions

View file

@ -130,6 +130,8 @@ public class TileLevitator extends TileAdvanced implements IPacketReceiver, IPac
{
item.setEntityItemStack(remains);
}
//TODO: Add redstone pulse?
}
}
}

View file

@ -65,12 +65,12 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
{
if (angularVelocity > 0)
{
torque += 3;
torque += 5;
angularVelocity += 0.02f;
}
else
{
torque -= 3;
torque -= 5;
angularVelocity -= 0.02f;
}
@ -83,12 +83,12 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
switch (tier)
{
default:
torque *= 0.9f;
angularVelocity *= 0.95f;
torque *= 0.97f;
angularVelocity *= 0.98f;
break;
case 1:
torque *= 0.95f;
angularVelocity *= 0.9f;
torque *= 0.98f;
angularVelocity *= 0.97f;
break;
case 2:
torque *= 0.99f;

View file

@ -55,8 +55,8 @@ public class PartGearShaft extends PartMechanical
if (!this.world().isRemote)
{
// Decelerate the gear.
torque *= 0.95f;
angularVelocity *= 0.95f;
torque *= 0.99f;
angularVelocity *= 0.99f;
}
}

View file

@ -79,7 +79,7 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
if (adjacentMech != null && adjacent != mechanical)
{
//System.out.println("UPDATING: " + mechanical + " with " + adjacentMech);
float ratio = adjacentMech.getRatio(dir.getOpposite(), mechanical) / mechanical.getRatio(dir, adjacentMech);
long torque = mechanical.getTorque();
@ -88,16 +88,12 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
int inversion = inverseRotation ? -1 : 1;
if (Math.abs(torque + inversion * (adjacentMech.getTorque() / ratio * ACCELERATION)) < Math.abs(adjacentMech.getTorque() / ratio))
{
mechanical.setTorque((long) (torque + inversion * ((adjacentMech.getTorque() / ratio * ACCELERATION))));
}
float velocity = mechanical.getAngularVelocity();
if (Math.abs(velocity + inversion * (adjacentMech.getAngularVelocity() * ratio * ACCELERATION)) < Math.abs(adjacentMech.getAngularVelocity() * ratio))
{
mechanical.setAngularVelocity(velocity + (inversion * adjacentMech.getAngularVelocity() * ratio * ACCELERATION));
}
}
}
}

View file

@ -139,7 +139,7 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
@Override
public void preRemove()
{
this.getNetwork().split(this);
getNetwork().split(this);
}
/** Packet Code. */

View file

@ -44,7 +44,7 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical
torque *= getLoad();
angularVelocity *= getLoad();
if (Math.abs(prevAngularVelocity - angularVelocity) > 0.05f)
if (Math.abs(prevAngularVelocity - angularVelocity) > 0.01f)
{
prevAngularVelocity = angularVelocity;
markPacketUpdate = true;

View file

@ -36,7 +36,7 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
*/
if (getDirection().offsetY == 0)
{
maxPower = 100;
maxPower = 500;
getMultiBlock().get().power += getWindPower();
}
else
@ -44,6 +44,7 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
maxPower = 1000;
}
if (!getMultiBlock().isConstructed())
torque = defaultTorque / 6;
else
@ -66,7 +67,7 @@ public class TileWindTurbine extends TileTurbine implements IMechanical
if (!worldObj.canBlockSeeTheSky(xCoord, yCoord + 4, zCoord))
return 0;
return (long) (((((float) yCoord + 4) / 256) * maxPower) + (hasBonus ? 80 : 0)) * (worldObj.isRaining() ? 2 : 1);
return (long) (((((float) yCoord + 4) / 256) * maxPower) + (hasBonus ? 10 : 0)) * (worldObj.isRaining() ? 2 : 1);
}
@Override