From d0ac70888078e9bab1d9a1d4369cc1b162287c69 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Wed, 5 Mar 2014 22:26:23 +0800 Subject: [PATCH] Fixed grinder packets --- .../mechanical/energy/network/MechanicalNode.java | 8 ++++---- .../mechanical/energy/network/PartMechanical.java | 2 +- .../mechanical/energy/network/TileMechanical.java | 2 +- .../mechanical/process/grinder/TileGrinderWheel.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/MechanicalNode.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/MechanicalNode.java index 5d21b0d7..9e001292 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/MechanicalNode.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/MechanicalNode.java @@ -41,7 +41,7 @@ public class MechanicalNode extends EnergyNode */ public double angle = 0; - protected double load = 5; + protected double load = 2; protected byte connectionMap = Byte.parseByte("111111", 2); private double power = 0; @@ -68,7 +68,7 @@ public class MechanicalNode extends EnergyNode { prevAngularVelocity = angularVelocity; - angle += angularVelocity / 20; + angle += angularVelocity * deltaTime; 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); boolean inverseRotation = inverseRotation(dir, adjacentMech) && adjacentMech.inverseRotation(dir.getOpposite(), this); -System.out.println(ratio); + int inversion = inverseRotation ? -1 : 1; if (Math.abs(torque + inversion * (adjacentMech.getTorque() / ratio * acceleration)) < Math.abs(adjacentMech.getTorque() / ratio)) @@ -131,7 +131,7 @@ System.out.println(ratio); } } } - + onUpdate(); } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/PartMechanical.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/PartMechanical.java index 966fb98a..751e7338 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/PartMechanical.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/PartMechanical.java @@ -104,7 +104,7 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu readDesc(packet); break; case 1: - node.angularVelocity = packet.readFloat(); + node.angularVelocity = packet.readDouble(); break; } } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java index c986ba55..8cfab6e8 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java @@ -79,7 +79,7 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical public void onReceivePacket(int id, ByteArrayDataInput data, EntityPlayer player, Object... extra) { if (id == PACKET_VELOCITY) - mechanicalNode.angularVelocity = data.readFloat(); + mechanicalNode.angularVelocity = data.readDouble(); } @Override diff --git a/mechanical/src/main/java/resonantinduction/mechanical/process/grinder/TileGrinderWheel.java b/mechanical/src/main/java/resonantinduction/mechanical/process/grinder/TileGrinderWheel.java index 8d314928..2878727b 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/process/grinder/TileGrinderWheel.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/process/grinder/TileGrinderWheel.java @@ -53,7 +53,7 @@ public class TileGrinderWheel extends TileMechanical implements IRotatable { return !(dir.offsetX > 0 || dir.offsetZ < 0 || dir.offsetY < 0); } - }.setLoad(3); + }.setLoad(2); } @Override