Jump to content

[1.14.4] TileEntity Item render is dark


Recommended Posts

I have a TileEntityRenderer set up to render an item above the block and the model and texture works. However, the item has a darkened look which I am not sure how to fix. The missing block texture isn't a problem, just the item.


package com.corruption.client.render;

import com.corruption.tileentity.PedestalTileEntity;
import com.mojang.blaze3d.platform.GlStateManager;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.item.ItemStack;

public class PedestalRender extends TileEntityRenderer<PedestalTileEntity>{
	private  ItemRenderer itemRenderer;
	public void render(PedestalTileEntity tileEntityIn, double x, double y, double z, float partialTicks,
			int destroyStage) {
		if(itemRenderer == null)
			itemRenderer = Minecraft.getInstance().getItemRenderer();
		ItemStack stack = tileEntityIn.GetContainedItem();
		if(!stack.isEmpty()) {
			//GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1f);
			//GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
			GlStateManager.translated(x + 0.5, y + 1.5, z + 0.5);
			GlStateManager.scalef(0.5f, 0.5f, 0.5f);
			GlStateManager.rotatef(0f, 0f, 0f, partialTicks);
			this.itemRenderer.renderItem(stack, ItemCameraTransforms.TransformType.FIXED);
			//ItemEntity entity = new ItemEntity(tileEntityIn.getWorld(), 0,0,0, stack);
			//Minecraft.getInstance().getRenderManager().renderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
		super.render(tileEntityIn, x, y, z, partialTicks, destroyStage);



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.