use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testIsServer.
@Test
public void testIsServer() {
FakeWorld world = FakeWorld.newWorld("TestIsServer");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.isServer();
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testOnPlayerRightClick.
@Test
public void testOnPlayerRightClick() {
world.setBlock(0, 0, 0, block);
Tile tile = (Tile) world.getTileEntity(0, 0, 0);
try {
Method method = Tile.class.getDeclaredMethod("onPlayerRightClick", EntityPlayer.class, Integer.TYPE, Pos.class);
method.setAccessible(true);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
//We divide the face of the tile into 256 sub sections
for (int i = 0; i <= 256; i++) {
method.invoke(tile, player, dir.ordinal(), getNextClick(dir, i));
}
}
} catch (NoSuchMethodException e) {
fail("Could not find method onPlayerRightClick");
} catch (InvocationTargetException e) {
fail("Failed to invoke method onPlayerRightClick");
} catch (IllegalAccessException e) {
fail("Couldn't access method onPlayerRightClick");
}
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testOnDestroyedByExplosion.
@Test
public void testOnDestroyedByExplosion() {
FakeWorld world = FakeWorld.newWorld("TestOnDestroyedByExplosion");
world.setBlock(0, 0, 0, block);
((Tile) world.getTileEntity(0, 0, 0)).onDestroyedByExplosion(new Explosion(world, null, 0, 0, 0, 10));
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testDoUpdateGuiUsers.
@Test
public void testDoUpdateGuiUsers() {
//Testing for no crashes during method call
FakeWorld world = FakeWorld.newWorld("TestDoUpdateGuiUsers");
world.setBlock(0, 0, 0, block);
Tile tile = (Tile) world.getTileEntity(0, 0, 0);
tile.doUpdateGuiUsers();
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testToPos.
@Test
public void testToPos() {
FakeWorld world = FakeWorld.newWorld("TestTopos");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
Pos pos = tile.toPos();
Pos pos2 = new Pos(tile.x(), tile.y(), tile.z());
assertTrue("Pos " + pos + " does not equal " + pos2, pos.equals(pos2));
}
Aggregations