Posted February 9, 20223 yr I'm trying to render item top of tileentity, but the ItemStack render a full black block I have tried to find anyting wrong and i found when MC call TER class of my tileentity the param [combinedLightIn] is 0 I try to debugger and Evaluate WorldRenderer.getLightColor(world, tile.getBlockPos()); other block, only position of my tileentity return 0 here are the code, does anyone know what should i do? public class TestTileEntityRender extends TileEntityRenderer<TestTileEntity> { public TestTileEntityRender(TileEntityRendererDispatcher dispatcher) { super(dispatcher); } @Override public void render(TestTileEntity tile, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { // combinedLightIn this one is 0 tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(inv -> { ItemStack stack = inv.getStackInSlot(0); if (!stack.isEmpty()) { matrixStackIn.pushPose(); matrixStackIn.translate(0.5, 1.5, 0.5); matrixStackIn.mulPose(Vector3f.YP.rotation(90)); ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); itemRenderer.renderStatic(stack, ItemCameraTransforms.TransformType.FIXED, combinedLightIn, combinedOverlayIn, matrixStackIn, bufferIn);// This line render a full black block matrixStackIn.popPose(); } }); } } Edited July 4, 20223 yr by tt36999
July 3, 20223 yr event.enqueueWork(() -> { RenderTypeLookup.setRenderLayer(ModBlocks.YOUR_BLOCK_HERE.get(), RenderType.cutout()); }); You need to add this to the same place you bind your TER. You can find my mod MechaniCraft at this link: http://www.minecraftforge.net/forum/index.php/topic,13923.0.html - Will11690
July 3, 20223 yr its to tell minecraft its not a simple full block - RenderType.solid() which is the default. It goes in your FMLClientSetupEvent. You don't need the enqueueWork for this, the setRenderLayer() is threadsafe. Edited July 3, 20223 yr by warjort Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
July 4, 20223 yr Author 13 hours ago, warjort said: its to tell minecraft its not a simple full block - RenderType.solid() which is the default. It goes in your FMLClientSetupEvent. You don't need the enqueueWork for this, the setRenderLayer() is threadsafe. 15 hours ago, Will11690 said: event.enqueueWork(() -> { RenderTypeLookup.setRenderLayer(ModBlocks.YOUR_BLOCK_HERE.get(), RenderType.cutout()); }); You need to add this to the same place you bind your TER. Thanks! Now it works fine
July 4, 20223 yr 20 hours ago, warjort said: its to tell minecraft its not a simple full block - RenderType.solid() which is the default. It goes in your FMLClientSetupEvent. You don't need the enqueueWork for this, the setRenderLayer() is threadsafe. Thanks for the giving the explanation, I was just about to go to bed when I posted that so it was a quick and dirty copy paste just to help them out. Good tip about the setRenderLayer being thread safe. IDK why I've been doing it this way lol. You can find my mod MechaniCraft at this link: http://www.minecraftforge.net/forum/index.php/topic,13923.0.html - Will11690
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.