Search in sources :

Example 1 with BlockPane

use of net.minecraft.block.BlockPane in project LogisticsPipes by RS485.

the class ItemStackRenderer method renderInWorld.

public void renderInWorld() {
    assert renderManager != null;
    assert renderItem != null;
    assert scaleX != 0.0F;
    assert scaleY != 0.0F;
    assert scaleZ != 0.0F;
    if (entityitem == null || !ItemStack.areItemStacksEqual(entityitem.getEntityItem(), itemstack)) {
        if (itemstack == null) {
            throw new RuntimeException("No EntityItem and no ItemStack, I do not know what to render!");
        } else {
            if (worldObj == null) {
                throw new NullPointerException("World object is null");
            }
            entityitem = new EntityItem(worldObj, 0.0D, 0.0D, 0.0D, itemstack);
            entityitem.getEntityItem().stackSize = 1;
            entityitem.hoverStart = 0.0F;
        }
    }
    boolean changeColor = renderItem.renderWithColor != renderInColor;
    if (changeColor) {
        renderItem.renderWithColor = renderInColor;
    }
    Item item = itemstack.getItem();
    if (item instanceof ItemBlock) {
        Block block = ((ItemBlock) item).field_150939_a;
        if (block instanceof BlockPane) {
            GL11.glScalef(0.5F, 0.5F, 0.5F);
        }
    } else if (item == LogisticsPipes.logisticsRequestTable) {
        GL11.glScalef(0.5F, 0.5F, 0.5F);
    }
    renderManager.renderEntityWithPosYaw(entityitem, posX, posY, zLevel, 0.0F, partialTickTime);
    if (changeColor) {
        renderItem.renderWithColor = !renderInColor;
    }
}
Also used : Item(net.minecraft.item.Item) RenderItem(net.minecraft.client.renderer.entity.RenderItem) EntityItem(net.minecraft.entity.item.EntityItem) BlockPane(net.minecraft.block.BlockPane) Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) ItemBlock(net.minecraft.item.ItemBlock) EntityItem(net.minecraft.entity.item.EntityItem)

Example 2 with BlockPane

use of net.minecraft.block.BlockPane in project BetterWithAddons by DaedalusGame.

the class BlockModPane method canConnectTo.

public boolean canConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing) {
    IBlockState state = world.getBlockState(pos);
    Block block = state.getBlock();
    return !(block instanceof BlockPane) && block == this || state.isOpaqueCube() || block.isSideSolid(state, world, pos, facing.getOpposite()) || compatiblePanes.contains(block);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockPane(net.minecraft.block.BlockPane) Block(net.minecraft.block.Block)

Aggregations

Block (net.minecraft.block.Block)2 BlockPane (net.minecraft.block.BlockPane)2 IBlockState (net.minecraft.block.state.IBlockState)1 RenderItem (net.minecraft.client.renderer.entity.RenderItem)1 EntityItem (net.minecraft.entity.item.EntityItem)1 Item (net.minecraft.item.Item)1 ItemBlock (net.minecraft.item.ItemBlock)1