Search in sources :

Example 11 with FakeWorld

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

the class AbstractTileTest method testZ.

@Test
public void testZ() {
    FakeWorld world = FakeWorld.newWorld("TestZ");
    world.setBlock(0, 0, 0, block);
    TileEntity tile = world.getTileEntity(0, 0, 0);
    assertTrue(tile.getClass() == tileClazz);
    assertTrue(tile.zCoord == (int) ((T) tile).z());
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) Test(org.junit.Test)

Example 12 with FakeWorld

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

the class AbstractTileTest method testOnRegistered.

@Test
public void testOnRegistered() {
    FakeWorld world = FakeWorld.newWorld("TestOnRegistered");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.onRegistered();
}
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 13 with FakeWorld

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

the class AbstractTileTest method testOnPlaced.

@Test
public void testOnPlaced() {
    FakeWorld world = FakeWorld.newWorld("TestOnplaced");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.onPlaced(player, new ItemStack(block));
}
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 14 with FakeWorld

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

the class AbstractTileTest method testSetOwnerID.

@Test
public void testSetOwnerID() {
    FakeWorld world = FakeWorld.newWorld("TestSetOwnerID");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.setOwnerID(player.getGameProfile().getId());
}
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 15 with FakeWorld

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

the class AbstractTileEntityTest method testMarkDirty.

@Test
public void testMarkDirty() {
    FakeWorld world = FakeWorld.newWorld("testMarkDirty");
    world.setBlock(10, 11, 12, block);
    world.getTileEntity(10, 11, 12).markDirty();
}
Also used : FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) AbstractTest(com.builtbroken.mc.testing.junit.AbstractTest) 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