Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.14.4] TileEntity Item render is dark


EnderUnknown
 Share

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;
	
	
	@Override
	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.enableRescaleNormal();
			//GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1f);
			//GlStateManager.enableBlend();
			RenderHelper.enableStandardItemLighting();
			//GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
			GlStateManager.pushMatrix();
			
			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);
			
			GlStateManager.enableLighting();
			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);
			
			GlStateManager.popMatrix();
			//GlStateManager.disableRescaleNormal();
			//GlStateManager.disableBlend();
		}
		super.render(tileEntityIn, x, y, z, partialTicks, destroyStage);
	}
}

 

Screenshot.png

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.

Guest
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.