From f90c513986d9746f6360de75a43fabafa21d8955 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Wed, 5 Mar 2014 17:41:08 +0800 Subject: [PATCH] Fixed mechanical grid not adding new nodes --- .../mechanical/energy/network/MechanicalNode.java | 5 +++-- src/main/java/resonantinduction/core/grid/Node.java | 6 +++--- src/main/java/resonantinduction/core/grid/NodeGrid.java | 1 + 3 files changed, 7 insertions(+), 5 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 a1cbce59d..c4b03f7ec 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/MechanicalNode.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/MechanicalNode.java @@ -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 */ diff --git a/src/main/java/resonantinduction/core/grid/Node.java b/src/main/java/resonantinduction/core/grid/Node.java index 7d83ef613..d021568a8 100644 --- a/src/main/java/resonantinduction/core/grid/Node.java +++ b/src/main/java/resonantinduction/core/grid/Node.java @@ -31,13 +31,13 @@ public abstract class Node implements INode getGrid().reconstruct(); } - public void recache() + // TODO: Fix this. + public void split() { } - // TODO: Fix this. - public void split() + public void recache() { } diff --git a/src/main/java/resonantinduction/core/grid/NodeGrid.java b/src/main/java/resonantinduction/core/grid/NodeGrid.java index f4b113705..1ed28fe68 100644 --- a/src/main/java/resonantinduction/core/grid/NodeGrid.java +++ b/src/main/java/resonantinduction/core/grid/NodeGrid.java @@ -57,6 +57,7 @@ public class NodeGrid extends Grid implements IUpdate { connectedNode.getGrid().getNodes().clear(); connectedNode.setGrid(this); + add((N) connectedNode); reconstructNode((N) connectedNode); } }