use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testGetCollisionBounds.
@Test
public void testGetCollisionBounds() {
FakeWorld world = FakeWorld.newWorld("TestGetCollisionBounds");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
Cube cube = tile.getCollisionBounds();
if (cube != null) {
//TODO test too see if cube is valid
}
}
use of com.builtbroken.mc.prefab.tile.Tile 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);
}
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testHasSpecialRenderer.
@Test
public void testHasSpecialRenderer() {
FakeWorld world = FakeWorld.newWorld("TestHasSpecialRenderer");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.hasSpecialRenderer();
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class BlockRenderHandler method renderInventoryBlock.
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
if (block instanceof BlockTile) {
Tile tile = ((BlockTile) block).staticTile;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);
GL11.glPushMatrix();
tile.renderInventory(new ItemStack(block, 1, metadata));
GL11.glPopMatrix();
GL11.glPopAttrib();
}
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testOnPlayerRightClickWrench.
@Test
public void testOnPlayerRightClickWrench() {
world.setBlock(0, 0, 0, block);
Tile tile = (Tile) world.getTileEntity(0, 0, 0);
try {
Method method = Tile.class.getDeclaredMethod("onPlayerRightClickWrench", EntityPlayer.class, Integer.TYPE, Pos.class);
method.setAccessible(true);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
//We divide the face of the tile into 256 sub sections
for (int i = 0; i <= 256; i++) {
method.invoke(tile, player, dir.ordinal(), getNextClick(dir, i));
}
}
} catch (NoSuchMethodException e) {
fail("Could not find method onPlayerRightClickWrench");
} catch (InvocationTargetException e) {
fail("Failed to invoke method onPlayerRightClickWrench");
} catch (IllegalAccessException e) {
fail("Couldn't access method onPlayerRightClickWrench");
}
}
Aggregations