Search in sources :

Example 16 with FakeWorld

use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.

the class AbstractTileEntityTest method testGetBlockType.

@Test
public void testGetBlockType() {
    FakeWorld world = FakeWorld.newWorld("testGetBlockType");
    world.setBlock(10, 11, 12, block);
    assertTrue(world.getTileEntity(10, 11, 12).getBlockType() == block);
}
Also used : FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) AbstractTest(com.builtbroken.mc.testing.junit.AbstractTest) Test(org.junit.Test)

Example 17 with FakeWorld

use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testGetDrops.

@Test
public void testGetDrops() {
    FakeWorld world = FakeWorld.newWorld("TestGetDrops");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    List<ItemStack> items = tile.getDrops(0, 0);
    for (ItemStack stack : items) {
        assertTrue(stack != null);
        assertTrue(stack.getItem() != null);
    // TODO check for creative mod only items
    }
}
Also used : FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) BlockTile(com.builtbroken.mc.prefab.tile.BlockTile) Tile(com.builtbroken.mc.prefab.tile.Tile) ItemStack(net.minecraft.item.ItemStack) Test(org.junit.Test)

Example 18 with FakeWorld

use of com.builtbroken.mc.testing.junit.world.FakeWorld 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();
}
Also used : FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) BlockTile(com.builtbroken.mc.prefab.tile.BlockTile) Tile(com.builtbroken.mc.prefab.tile.Tile) Test(org.junit.Test)

Example 19 with FakeWorld

use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testSendpacketToServer.

@Test
public void testSendpacketToServer() {
    FakeWorld world = FakeWorld.newWorld("TestSendpacketToServer");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.sendPacketToServer(new PacketTile(tile));
}
Also used : PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) BlockTile(com.builtbroken.mc.prefab.tile.BlockTile) Tile(com.builtbroken.mc.prefab.tile.Tile) Test(org.junit.Test)

Example 20 with FakeWorld

use of com.builtbroken.mc.testing.junit.world.FakeWorld in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testIsSolid.

@Test
public void testIsSolid() {
    FakeWorld world = FakeWorld.newWorld("TestIsSolid");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    for (int i = 0; i < 6; i++) {
        tile.isSolid(i);
    }
}
Also used : FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) BlockTile(com.builtbroken.mc.prefab.tile.BlockTile) Tile(com.builtbroken.mc.prefab.tile.Tile) Test(org.junit.Test)

Aggregations

FakeWorld (com.builtbroken.mc.testing.junit.world.FakeWorld)114 Test (org.junit.Test)111 BlockTile (com.builtbroken.mc.prefab.tile.BlockTile)85 Tile (com.builtbroken.mc.prefab.tile.Tile)85 PacketTile (com.builtbroken.mc.core.network.packet.PacketTile)84 AbstractTest (com.builtbroken.mc.testing.junit.AbstractTest)21 TileEntity (net.minecraft.tileentity.TileEntity)11 InvocationTargetException (java.lang.reflect.InvocationTargetException)6 Method (java.lang.reflect.Method)6 Pos (com.builtbroken.mc.lib.transform.vector.Pos)5 SudoIconReg (com.builtbroken.mc.testing.junit.icons.SudoIconReg)4 ItemStack (net.minecraft.item.ItemStack)4 Cube (com.builtbroken.mc.lib.transform.region.Cube)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)3 Location (com.builtbroken.mc.lib.transform.vector.Location)2 TileConductor (com.builtbroken.mc.prefab.tile.TileConductor)1 ArrayList (java.util.ArrayList)1 Block (net.minecraft.block.Block)1 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)1