use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileEntityTest method testReadFromNBT.
/** Tests {@link TileEntity#readFromNBT(NBTTagCompound)} */
@Test
public void testReadFromNBT() {
T tile = newTile();
tile.xCoord = 10;
tile.yCoord = 11;
tile.zCoord = 3;
FakeWorld world = FakeWorld.newWorld("testReadFromNBT");
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());
tile = newTile();
world = FakeWorld.newWorld("testReadFromNBT2");
tile.setWorldObj(world);
tile.readFromNBT(nbt);
assertTrue(tile.xCoord == 10);
assertTrue(tile.yCoord == 11);
assertTrue(tile.zCoord == 3);
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileEntityTest method testOnChunkUnload.
@Test
public void testOnChunkUnload() {
//Test for no errors/crash
FakeWorld world = FakeWorld.newWorld("testOnChunkUnload");
world.setBlock(10, 11, 12, block);
world.getTileEntity(10, 11, 12).onChunkUnload();
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testMetadataDropped.
@Test
public void testMetadataDropped() {
FakeWorld world = FakeWorld.newWorld("TestMetadataDropped");
world.setBlock(0, 0, 0, block);
((Tile) world.getTileEntity(0, 0, 0)).metadataDropped(0, 0);
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testToLocation.
@Test
public void testToLocation() {
FakeWorld world = FakeWorld.newWorld("TestToLocation");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
Location loc = tile.toLocation();
assertTrue(loc.world == world);
assertTrue(loc.xi() == tile.xCoord);
assertTrue(loc.yi() == tile.yCoord);
assertTrue(loc.zi() == tile.zCoord);
}
use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testQuantityDropped.
@Test
public void testQuantityDropped() {
FakeWorld world = FakeWorld.newWorld("TestQuantityDropped");
world.setBlock(0, 0, 0, block);
((Tile) world.getTileEntity(0, 0, 0)).quantityDropped(0, 0);
}
Aggregations