Fixed debug GUI not working for subclasses of TileMechanical

This commit is contained in:
Robert S 2014-06-10 13:31:18 -04:00
parent b515691a20
commit 07e7170e82
4 changed files with 35 additions and 13 deletions

View file

@ -48,6 +48,7 @@ public abstract class TileMechanical extends TileBase implements INodeProvider,
public TileMechanical(Material material) public TileMechanical(Material material)
{ {
super(material); super(material);
this.mechanicalNode = new MechanicalNode(this);
} }
@Override @Override
@ -69,6 +70,15 @@ public abstract class TileMechanical extends TileBase implements INodeProvider,
{ {
super.updateEntity(); super.updateEntity();
mechanicalNode.update(); mechanicalNode.update();
if(frame != null)
{
frame.update();
if(!frame.isVisible())
{
frame.dispose();
frame = null;
}
}
if (!this.getWorldObj().isRemote) if (!this.getWorldObj().isRemote)
{ {
if (ticks % 3 == 0 && (mechanicalNode.markTorqueUpdate || mechanicalNode.markRotationUpdate)) if (ticks % 3 == 0 && (mechanicalNode.markTorqueUpdate || mechanicalNode.markRotationUpdate))

View file

@ -29,8 +29,8 @@ public class MechanicalNodeFrame extends Frame implements ActionListener
Label[] connections = new Label[10]; Label[] connections = new Label[10];
long tick = 0; long tick = 0;
PartMechanical partMechanical = null; private PartMechanical partMechanical = null;
TileMechanical tileMechanical = null; private TileMechanical tileMechanical = null;
public MechanicalNodeFrame(TileMechanical tile) public MechanicalNodeFrame(TileMechanical tile)
{ {

View file

@ -0,0 +1,22 @@
package resonantinduction.mechanical.process.purifier;
import net.minecraftforge.common.ForgeDirection;
import resonant.api.grid.INodeProvider;
import resonantinduction.core.interfaces.IMechanicalNode;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
public class MixerNode extends MechanicalNode
{
public MixerNode(INodeProvider parent)
{
super(parent);
}
@Override
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return dir == ForgeDirection.DOWN;
}
}

View file

@ -41,17 +41,7 @@ public class TileMixer extends TileMechanical implements IInventory
public TileMixer() public TileMixer()
{ {
super(Material.iron); super(Material.iron);
mechanicalNode = new MixerNode(this).setConnection(Byte.parseByte("000011", 2));
mechanicalNode = new MechanicalNode(this)
{
@Override
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return dir == ForgeDirection.DOWN;
}
}.setConnection(Byte.parseByte("000011", 2));
isOpaqueCube = false; isOpaqueCube = false;
normalRender = false; normalRender = false;
customItemRender = true; customItemRender = true;