Search in sources :

Example 1 with SudoIconReg

use of com.builtbroken.mc.testing.junit.icons.SudoIconReg in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testGetIcon.

@Test
public void testGetIcon() {
    FakeWorld world = FakeWorld.newWorld("TestGetIcon");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.registerIcons(new SudoIconReg());
    tile.getIcon();
    for (int i = 0; i < 6; i++) {
        tile.getIcon(i);
        tile.getIcon(i, 0);
    }
    tile.getIcon(tile.name);
}
Also used : SudoIconReg(com.builtbroken.mc.testing.junit.icons.SudoIconReg) 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 2 with SudoIconReg

use of com.builtbroken.mc.testing.junit.icons.SudoIconReg in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testGetSideIcon.

@Test
public void testGetSideIcon() {
    FakeWorld world = FakeWorld.newWorld("TestGetSideIcon");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.registerIcons(new SudoIconReg());
    try {
        Method method = Tile.class.getDeclaredMethod("getSideIcon", Integer.TYPE, Integer.TYPE);
        method.setAccessible(true);
        for (int i = 0; i < 6; i++) {
            method.invoke(tile, 0, i);
        }
    } catch (NoSuchMethodException e) {
        fail("Could not find method getTextureName");
    } catch (InvocationTargetException e) {
        e.printStackTrace();
        fail("Failed to invoke method getTextureName");
    } catch (IllegalAccessException e) {
        fail("Couldn't access method getTextureName");
    }
}
Also used : SudoIconReg(com.builtbroken.mc.testing.junit.icons.SudoIconReg) 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 3 with SudoIconReg

use of com.builtbroken.mc.testing.junit.icons.SudoIconReg in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testRegisterIcons.

@Test
public void testRegisterIcons() {
    FakeWorld world = FakeWorld.newWorld("TestRegisterIcons");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.registerIcons(new SudoIconReg());
}
Also used : SudoIconReg(com.builtbroken.mc.testing.junit.icons.SudoIconReg) 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 4 with SudoIconReg

use of com.builtbroken.mc.testing.junit.icons.SudoIconReg in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testRegisterSideTextureSet.

@Test
public void testRegisterSideTextureSet() {
    FakeWorld world = FakeWorld.newWorld("TestRegisterSideTextureSet");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    SudoIconReg reg = new SudoIconReg();
    // TODO check to see if the texture exists
    tile.registerSideTextureSet(reg);
}
Also used : SudoIconReg(com.builtbroken.mc.testing.junit.icons.SudoIconReg) 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

PacketTile (com.builtbroken.mc.core.network.packet.PacketTile)4 BlockTile (com.builtbroken.mc.prefab.tile.BlockTile)4 Tile (com.builtbroken.mc.prefab.tile.Tile)4 SudoIconReg (com.builtbroken.mc.testing.junit.icons.SudoIconReg)4 FakeWorld (com.builtbroken.mc.testing.junit.world.FakeWorld)4 Test (org.junit.Test)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1