Fixed mechanical grid not adding new nodes

This commit is contained in:
Calclavia 2014-03-05 17:41:08 +08:00
parent 571f571d4d
commit f90c513986
3 changed files with 7 additions and 5 deletions

View file

@ -53,9 +53,8 @@ public class MechanicalNode extends EnergyNode
@Override
public void update(float deltaTime)
{
float acceleration = this.acceleration * deltaTime;
power = getEnergy() / deltaTime;
prevAngularVelocity = angularVelocity;
onUpdate();
@ -71,6 +70,8 @@ public class MechanicalNode extends EnergyNode
// TODO: Remove upon split.
if (world() != null && !world().isRemote)
{
double acceleration = this.acceleration * deltaTime;
System.out.println("UPDATED");
/**
* Loss energy
*/

View file

@ -31,13 +31,13 @@ public abstract class Node<G extends IGrid> implements INode<G>
getGrid().reconstruct();
}
public void recache()
// TODO: Fix this.
public void split()
{
}
// TODO: Fix this.
public void split()
public void recache()
{
}

View file

@ -57,6 +57,7 @@ public class NodeGrid<N extends INode> extends Grid<N> implements IUpdate
{
connectedNode.getGrid().getNodes().clear();
connectedNode.setGrid(this);
add((N) connectedNode);
reconstructNode((N) connectedNode);
}
}