Blood Magic

Blood Magic

90M Downloads

Rendering Items

diba1013 opened this issue ยท 1 comments

commented

You now found a way to be sure that the item in the blood altar is rendered by facing it to the player. But the rendering on the arcane plinth and arcane pedestals is still quite funky.

Use (I'm interested how it will show up) it will render the stack somewhat 3D or with the custom renderers:

TileEntity te = [The TE to render on. Use translations and rotations to change]

ItemStack stack = [stack to render]

Minecraft mc = Minecraft.getMinecraft();
RenderBlocks renderBlocks = new RenderBlocks();

if(!ForgeHooksClient.renderEntityItem(new EntityItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, stack), stack, 0F, 0F, te.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) {
        mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);

        GL11.glScaled(0.5, 0.5, 0.5);

        if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) {

            GL11.glScaled(0.5, 0.5, 0.5);
            renderBlocks.renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F);

        } else {

            int renderPass = 0;

            do {
                IIcon icon = stack.getItem().getIcon(stack, renderPass);
                if(icon != null) {
                    [Set the color of the current Itemstack rendering (stack.getItem().getColorFromItemStack(stack, renderPass)]
                    ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMaxV(), icon.getMinU(), icon.getMinV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
                }
                renderPass++;
            } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
        }
    }
}
commented

This was solved