Fixed grinder packets

This commit is contained in:
Calclavia 2014-03-05 22:26:23 +08:00
parent a15631c4fb
commit d0ac708880
4 changed files with 7 additions and 7 deletions

View file

@ -41,7 +41,7 @@ public class MechanicalNode extends EnergyNode
*/ */
public double angle = 0; public double angle = 0;
protected double load = 5; protected double load = 2;
protected byte connectionMap = Byte.parseByte("111111", 2); protected byte connectionMap = Byte.parseByte("111111", 2);
private double power = 0; private double power = 0;
@ -68,7 +68,7 @@ public class MechanicalNode extends EnergyNode
{ {
prevAngularVelocity = angularVelocity; prevAngularVelocity = angularVelocity;
angle += angularVelocity / 20; angle += angularVelocity * deltaTime;
if (angle % (Math.PI * 2) != angle) if (angle % (Math.PI * 2) != angle)
{ {
@ -115,7 +115,7 @@ public class MechanicalNode extends EnergyNode
*/ */
float ratio = adjacentMech.getRatio(dir.getOpposite(), this) / getRatio(dir, adjacentMech); float ratio = adjacentMech.getRatio(dir.getOpposite(), this) / getRatio(dir, adjacentMech);
boolean inverseRotation = inverseRotation(dir, adjacentMech) && adjacentMech.inverseRotation(dir.getOpposite(), this); boolean inverseRotation = inverseRotation(dir, adjacentMech) && adjacentMech.inverseRotation(dir.getOpposite(), this);
System.out.println(ratio);
int inversion = inverseRotation ? -1 : 1; int inversion = inverseRotation ? -1 : 1;
if (Math.abs(torque + inversion * (adjacentMech.getTorque() / ratio * acceleration)) < Math.abs(adjacentMech.getTorque() / ratio)) if (Math.abs(torque + inversion * (adjacentMech.getTorque() / ratio * acceleration)) < Math.abs(adjacentMech.getTorque() / ratio))

View file

@ -104,7 +104,7 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
readDesc(packet); readDesc(packet);
break; break;
case 1: case 1:
node.angularVelocity = packet.readFloat(); node.angularVelocity = packet.readDouble();
break; break;
} }
} }

View file

@ -79,7 +79,7 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical
public void onReceivePacket(int id, ByteArrayDataInput data, EntityPlayer player, Object... extra) public void onReceivePacket(int id, ByteArrayDataInput data, EntityPlayer player, Object... extra)
{ {
if (id == PACKET_VELOCITY) if (id == PACKET_VELOCITY)
mechanicalNode.angularVelocity = data.readFloat(); mechanicalNode.angularVelocity = data.readDouble();
} }
@Override @Override

View file

@ -53,7 +53,7 @@ public class TileGrinderWheel extends TileMechanical implements IRotatable
{ {
return !(dir.offsetX > 0 || dir.offsetZ < 0 || dir.offsetY < 0); return !(dir.offsetX > 0 || dir.offsetZ < 0 || dir.offsetY < 0);
} }
}.setLoad(3); }.setLoad(2);
} }
@Override @Override