use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class BranchGridTest method setUpForTest.
@Override
public void setUpForTest(String name) {
// Create fake world to do actions in
world = new FakeWorld();
world.genFlatData();
// Set up wire grid
WireMap.WireTests.JUNCTION_FIVE.build(world, 0, 12, 0);
if (world.tiles.size() == 0) {
world.printLevel(12);
fail("No tiles were placed into the world");
}
world.updateEntities();
TileEntity tile = world.tiles.get(0);
if (tile instanceof TileConductor) {
grid = ((TileConductor) tile).getNode().getGrid();
} else {
System.out.println("Something went wrong building " + name + ".\n No tile was found to get grid from.");
for (TileEntity t : world.tiles) {
System.out.println("Tile: " + t + " Vec: " + new Pos(t));
}
fail();
}
// Trigger grid to update since we do not have a tick handler
grid.update();
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testSetOwner.
@Test
public void testSetOwner() {
FakeWorld world = FakeWorld.newWorld("TestSetOwner");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.setOwner(player);
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testSetAccess.
@Test
public void testSetAccess() {
FakeWorld world = FakeWorld.newWorld("TestSetAccess");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.setAccess(world);
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testFirstTick.
@Test
public void testFirstTick() {
FakeWorld world = FakeWorld.newWorld("TestFirstTick");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.firstTick();
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testGetIcon.
@Test
public void testGetIcon() {
FakeWorld world = FakeWorld.newWorld("TestGetIcon");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.registerIcons(new SudoIconReg());
tile.getIcon();
for (int i = 0; i < 6; i++) {
tile.getIcon(i);
tile.getIcon(i, 0);
}
tile.getIcon(tile.name);
}
Aggregations