Search in sources :

Example 1 with BlockBase

use of forestry.core.blocks.BlockBase in project ForestryMC by ForestryMC.

the class RenderEngine method render.

@Override
public void render(TileEngine engine, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    if (engine != null) {
        World worldObj = engine.getWorldObj();
        if (worldObj.isBlockLoaded(engine.getPos())) {
            IBlockState blockState = worldObj.getBlockState(engine.getPos());
            if (blockState.getBlock() instanceof BlockBase) {
                EnumFacing facing = blockState.getValue(BlockBase.FACING);
                render(engine.getTemperatureState(), engine.progress, facing, x, y, z);
                return;
            }
        }
    }
    render(TemperatureState.COOL, 0.25F, EnumFacing.UP, x, y, z);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockBase(forestry.core.blocks.BlockBase) EnumFacing(net.minecraft.util.EnumFacing) World(net.minecraft.world.World)

Example 2 with BlockBase

use of forestry.core.blocks.BlockBase in project ForestryMC by ForestryMC.

the class RenderAnalyzer method render.

/**
 * @param analyzer If it null its render the item else it render the tile entity.
 */
@Override
public void render(TileAnalyzer analyzer, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    if (analyzer != null) {
        World worldObj = analyzer.getWorldObj();
        if (worldObj.isBlockLoaded(analyzer.getPos())) {
            IBlockState blockState = worldObj.getBlockState(analyzer.getPos());
            if (blockState.getBlock() instanceof BlockBase) {
                EnumFacing facing = blockState.getValue(BlockBase.FACING);
                render(analyzer.getIndividualOnDisplay(), analyzer.getWorld(), facing, x, y, z);
                return;
            }
        }
    }
    render(ItemStack.EMPTY, null, EnumFacing.WEST, x, y, z);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockBase(forestry.core.blocks.BlockBase) EnumFacing(net.minecraft.util.EnumFacing) World(net.minecraft.world.World)

Example 3 with BlockBase

use of forestry.core.blocks.BlockBase in project ForestryMC by ForestryMC.

the class RenderMachine method render.

/**
 * @param tile If it null its render the item else it render the tile entity.
 */
@Override
public void render(TileBase tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    if (tile != null) {
        IRenderableTile generator = (IRenderableTile) tile;
        World worldObj = tile.getWorldObj();
        if (worldObj.isBlockLoaded(tile.getPos())) {
            IBlockState blockState = worldObj.getBlockState(tile.getPos());
            if (blockState.getBlock() instanceof BlockBase) {
                EnumFacing facing = blockState.getValue(BlockBase.FACING);
                render(generator.getResourceTankInfo(), generator.getProductTankInfo(), facing, x, y, z, destroyStage);
                return;
            }
        }
    }
    render(TankRenderInfo.EMPTY, TankRenderInfo.EMPTY, EnumFacing.SOUTH, x, y, z, -1);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockBase(forestry.core.blocks.BlockBase) IRenderableTile(forestry.core.tiles.IRenderableTile) EnumFacing(net.minecraft.util.EnumFacing) World(net.minecraft.world.World)

Example 4 with BlockBase

use of forestry.core.blocks.BlockBase in project ForestryMC by ForestryMC.

the class RenderNaturalistChest method render.

/**
 * @param chest If it null its render the item else it render the tile entity.
 */
@Override
public void render(TileNaturalistChest chest, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    if (chest != null) {
        World worldObj = chest.getWorldObj();
        if (worldObj.isBlockLoaded(chest.getPos())) {
            IBlockState blockState = worldObj.getBlockState(chest.getPos());
            if (blockState.getBlock() instanceof BlockBase) {
                EnumFacing facing = blockState.getValue(BlockBase.FACING);
                render(facing, chest.prevLidAngle, chest.lidAngle, x, y, z, partialTicks);
                return;
            }
        }
    }
    render(EnumFacing.SOUTH, 0, 0, x, y, z, 0);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockBase(forestry.core.blocks.BlockBase) EnumFacing(net.minecraft.util.EnumFacing) World(net.minecraft.world.World)

Example 5 with BlockBase

use of forestry.core.blocks.BlockBase in project ForestryMC by ForestryMC.

the class RenderEscritoire method render.

/**
 * @param escritoire If it null its render the item else it render the tile entity.
 */
@Override
public void render(TileEscritoire escritoire, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    if (escritoire != null) {
        World world = escritoire.getWorldObj();
        if (world.isBlockLoaded(escritoire.getPos())) {
            IBlockState blockState = world.getBlockState(escritoire.getPos());
            if (blockState.getBlock() instanceof BlockBase) {
                EnumFacing facing = blockState.getValue(BlockBase.FACING);
                render(escritoire.getIndividualOnDisplay(), world, facing, x, y, z);
                return;
            }
        }
    }
    render(ItemStack.EMPTY, null, EnumFacing.SOUTH, x, y, z);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockBase(forestry.core.blocks.BlockBase) EnumFacing(net.minecraft.util.EnumFacing) World(net.minecraft.world.World)

Aggregations

BlockBase (forestry.core.blocks.BlockBase)6 IBlockState (net.minecraft.block.state.IBlockState)5 EnumFacing (net.minecraft.util.EnumFacing)5 World (net.minecraft.world.World)5 IRenderableTile (forestry.core.tiles.IRenderableTile)1 Block (net.minecraft.block.Block)1