Search in sources :

Example 41 with FakeWorld

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

the class AbstractTileTest method testUpdate.

@Test
public void testUpdate() {
    FakeWorld world = FakeWorld.newWorld("TestUpdate");
    world.setBlock(0, 0, 0, block);
    Tile tile = (Tile) world.getTileEntity(0, 0, 0);
    // 5 Seconds of run time
    for (int i = 0; i < 100; i++) {
        tile.ticks = i;
        tile.update();
    }
}
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 42 with FakeWorld

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

the class AbstractTileTest method testGetpickBlock.

@Test
public void testGetpickBlock() {
    FakeWorld world = FakeWorld.newWorld("TestGetpickBlock");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        for (int i = 0; i < 256; i++) {
            tile.getPickBlock(new MovingObjectPosition(0, 0, 0, dir.ordinal(), getNextClick(dir, i).toVec3(), true));
        }
    }
}
Also used : MovingObjectPosition(net.minecraft.util.MovingObjectPosition) FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) 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 43 with FakeWorld

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

the class AbstractTileTest method testOpenGui.

@Test
public void testOpenGui() {
    FakeWorld world = FakeWorld.newWorld("TestOpenGui");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.openGui(player, 0, Engine.instance);
}
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 44 with FakeWorld

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);
    }
}
Also used : FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) 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 45 with FakeWorld

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

the class AbstractTileEntityTest method testShouldRenderInPass.

@Test
public void testShouldRenderInPass() {
    FakeWorld world = FakeWorld.newWorld("testShouldRenderInPass");
    world.setBlock(10, 11, 12, block);
    world.getTileEntity(10, 11, 12).shouldRenderInPass(0);
}
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