use of com.builtbroken.mc.lib.transform.vector.Location in project Engine by VoltzEngine-Project.
the class NodeConnectionTest method setUpForTest.
@Override
public void setUpForTest(String name) {
world = new FakeWorld();
center = new Location(world, 8, 8, 8);
}
use of com.builtbroken.mc.lib.transform.vector.Location in project Engine by VoltzEngine-Project.
the class NodeConnectionTest method buildWireInDir.
private void buildWireInDir(ForgeDirection dir) {
Location vec = center.add(dir);
vec.setBlock(WireMap.wire());
assertNotNull("Failed to place wire at " + vec, vec.getBlock());
assertNotNull("Failed to place tile at " + vec, vec.getTileEntity());
}
use of com.builtbroken.mc.lib.transform.vector.Location in project Engine by VoltzEngine-Project.
the class NodeConnectionTest method testForNodes.
public void testForNodes() {
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
//Build
buildWireInDir(ForgeDirection.UNKNOWN);
buildWireInDir(side);
//Test
Location vec = center.add(side);
TileEntity tile = vec.getTileEntity();
if (tile instanceof ITileModuleProvider) {
NodeBranchPart part = ((ITileModuleProvider) tile).getModule(NodeBranchPart.class, side.getOpposite());
if (part == null)
fail("Failed to get NodeBranchPart from tile at " + vec + " from side " + side.getOpposite());
} else {
fail("Something failed good as the wire is not an instance of INodeProvider");
}
//Cleanup
center.setBlockToAir();
center.add(side).setBlockToAir();
}
}
Aggregations