Separated GrinderNode from grinder to make debug faster

This commit is contained in:
Robert S 2014-06-10 08:21:24 -04:00
parent b06a5ea283
commit 777bf75b89
2 changed files with 34 additions and 21 deletions

View file

@ -0,0 +1,33 @@
package resonantinduction.mechanical.process.grinder;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.interfaces.IMechanicalNode;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
/** Node just for the grinder
*
* @author Darkguardsman */
public class GrinderNode extends MechanicalNode
{
public GrinderNode(TileGrindingWheel parent)
{
super(parent);
}
public TileGrindingWheel grider()
{
return (TileGrindingWheel) getParent();
}
@Override
public boolean canConnect(ForgeDirection from, Object source)
{
return grider().getDirection() == from || grider().getDirection().getOpposite() == from;
}
@Override
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return !(dir.offsetX > 0 || dir.offsetZ < 0 || dir.offsetY < 0);
}
}

View file

@ -38,27 +38,7 @@ public class TileGrindingWheel extends TileMechanical implements IRotatable
public TileGrindingWheel()
{
super(Material.rock);
mechanicalNode = new MechanicalNode(this)
{
@Override
public boolean canConnect(ForgeDirection from, Object source)
{
if (getDirection().ordinal() < 2)
{
return from.offsetY != 0;
}
return getDirection().getRotation(ForgeDirection.UP) == from || getDirection().getRotation(ForgeDirection.DOWN) == from;
}
@Override
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return !(dir.offsetX > 0 || dir.offsetZ < 0 || dir.offsetY < 0);
}
}.setLoad(2);
mechanicalNode = new GrinderNode(this).setLoad(2);
bounds = new Cuboid(0.05f, 0.05f, 0.05f, 0.95f, 0.95f, 0.95f);
isOpaqueCube = false;
normalRender = false;