use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testCanPlaceBlockOnSide.
@Test
public void testCanPlaceBlockOnSide() {
FakeWorld world = FakeWorld.newWorld("TestCanplaceBlockOnSide");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
tile.canPlaceBlockOnSide(dir);
}
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testHasSpecialRenderer.
@Test
public void testHasSpecialRenderer() {
FakeWorld world = FakeWorld.newWorld("TestHasSpecialRenderer");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.hasSpecialRenderer();
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileEntityTest method testCanUpdate.
@Test
public void testCanUpdate() {
//Test for no errors/crash
FakeWorld world = FakeWorld.newWorld("testCanUpdate");
world.setBlock(10, 11, 12, block);
world.getTileEntity(10, 11, 12).canUpdate();
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileEntityTest method testGetMaxRenderDistanceSquared.
@Test
public void testGetMaxRenderDistanceSquared() {
FakeWorld world = FakeWorld.newWorld("testGetMaxRenderDistanceSquared");
world.setBlock(10, 11, 12, block);
double d = world.getTileEntity(10, 11, 12).getMaxRenderDistanceSquared();
assertTrue(d >= 0);
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileEntityTest method testWriteToNBT.
/** Tests {@link TileEntity#writeToNBT(NBTTagCompound)} */
@Test
public void testWriteToNBT() {
T tile = newTile();
tile.xCoord = 10;
tile.yCoord = 11;
tile.zCoord = 3;
FakeWorld world = FakeWorld.newWorld("testWriteToNBT");
tile.setWorldObj(world);
NBTTagCompound nbt = new NBTTagCompound();
assertTrue("NBT should have not tags on init", nbt.hasNoTags());
tile.writeToNBT(nbt);
assertTrue("NBT should have saved something", !nbt.hasNoTags());
assertTrue("X coord should have saved", nbt.hasKey("x"));
assertTrue("X should equal tile xCoord", nbt.getInteger("x") == tile.xCoord);
assertTrue("Y coord should have saved", nbt.hasKey("y"));
assertTrue("Y should equal tile yCoord", nbt.getInteger("y") == tile.yCoord);
assertTrue("Z coord should have saved", nbt.hasKey("z"));
assertTrue("Z should equal tile zCoord", nbt.getInteger("z") == tile.zCoord);
assertTrue("ID tag should have saved", nbt.hasKey("id"));
}
Aggregations