Search in sources :

Example 71 with Tile

use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testGetStrongRedstonePower.

@Test
public void testGetStrongRedstonePower() {
    FakeWorld world = FakeWorld.newWorld("TestGetStrongRedstonepower");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    for (int i = 0; i < 6; i++) {
        tile.getStrongRedstonePower(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)

Example 72 with Tile

use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testCanSilkHarvest.

@Test
public void testCanSilkHarvest() {
    FakeWorld world = FakeWorld.newWorld("TestCanSilkHarvest");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.canSilkHarvest(player, 0);
}
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 73 with Tile

use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testMarkUpdate.

@Test
public void testMarkUpdate() {
    FakeWorld world = FakeWorld.newWorld("TestMarkUpdate");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    try {
        Method method = Tile.class.getDeclaredMethod("markUpdate");
        method.setAccessible(true);
        method.invoke(tile);
    } catch (NoSuchMethodException e) {
        fail("Could not find method markUpdate");
    } catch (InvocationTargetException e) {
        e.printStackTrace();
        fail("Failed to invoke method markUpdate");
    } catch (IllegalAccessException e) {
        fail("Couldn't access method markUpdate");
    }
}
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) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException) Test(org.junit.Test)

Example 74 with Tile

use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testGetRenderBlockpass.

@Test
public void testGetRenderBlockpass() {
    FakeWorld world = FakeWorld.newWorld("TestGetRenderBlockpass");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.getRenderBlockPass();
}
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 75 with Tile

use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testScheduleTick.

@Test
public void testScheduleTick() {
    FakeWorld world = FakeWorld.newWorld("TestScheduleTick");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    try {
        Method method = Tile.class.getDeclaredMethod("scheduleTick", Integer.TYPE);
        method.setAccessible(true);
        method.invoke(tile, 0);
    } catch (NoSuchMethodException e) {
        fail("Could not find method scheduleTick");
    } catch (InvocationTargetException e) {
        e.printStackTrace();
        fail("Failed to invoke method scheduleTick");
    } catch (IllegalAccessException e) {
        fail("Couldn't access method scheduleTick");
    }
}
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) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException) Test(org.junit.Test)

Aggregations

BlockTile (com.builtbroken.mc.prefab.tile.BlockTile)93 Tile (com.builtbroken.mc.prefab.tile.Tile)93 PacketTile (com.builtbroken.mc.core.network.packet.PacketTile)88 Test (org.junit.Test)88 FakeWorld (com.builtbroken.mc.testing.junit.world.FakeWorld)85 InvocationTargetException (java.lang.reflect.InvocationTargetException)9 Method (java.lang.reflect.Method)8 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)6 ItemStack (net.minecraft.item.ItemStack)5 Pos (com.builtbroken.mc.imp.transform.vector.Pos)4 SudoIconReg (com.builtbroken.mc.testing.junit.icons.SudoIconReg)4 Cube (com.builtbroken.mc.imp.transform.region.Cube)3 ArrayList (java.util.ArrayList)2 TileEntity (net.minecraft.tileentity.TileEntity)2 Location (com.builtbroken.mc.imp.transform.vector.Location)1 Block (net.minecraft.block.Block)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 MovingObjectPosition (net.minecraft.util.MovingObjectPosition)1 Explosion (net.minecraft.world.Explosion)1