Jump to content

[SOLVED]1.12 Item drawn darker with TileEntitySpecialRenderer


Recommended Posts

So I have 2 Render classes. But with one of the classes the model that I draw is drawn way too dark. Its using the same code for drawing the model.

Its looking like this https://gyazo.com/9f216b1b4ea4e1ecfde4eb41b7e3fb2e


It might be the blocks that are doing something to the render? I dont know...


Here is the code I am using:


public class RenderUtil{

    public static void renderItemFloatingOnTileEntity(ItemStack renderItem, TileEntity tileEntity){
        RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
        if (!renderItem.isEmpty()) {
            GlStateManager.translate(0.5, 2, 0.5);
            EntityItem entityitem = new EntityItem(tileEntity.getWorld(), 0.0D, 0.0D, 0.0D, renderItem);
            entityitem.hoverStart = 0.0F;

            float rotation = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);

            GlStateManager.rotate(rotation, 0.0F, 1.0F, 0);
            GlStateManager.scale(0.5F, 0.5F, 0.5F);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            itemRenderer.renderItem(entityitem.getItem(), ItemCameraTransforms.TransformType.FIXED);




And this is the render class:

public class RenderAltar extends TileEntitySpecialRenderer<TileAltar> {

    public void render(TileAltar tileEntity, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {

        ItemStack renderItem = tileEntity.getHeldItem();

        GlStateManager.translate(x, y, z);

        RenderUtil.renderItemFloatingOnTileEntity(renderItem, tileEntity);




If you are interested in the tile class:



And this is how I bind the models and register the renderers:

public class ClientProxy extends CommonProxy {

    public void registerItemRenderer(Item item, int meta) {
        ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory"));

    public void preInit() {
        ClientRegistry.bindTileEntitySpecialRenderer(TileRuneInfuser.class, new RenderInfuser());
        ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderAltar());



Edited by MinecraftMart
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.