tt36999 Posted February 9, 2022 Share Posted February 9, 2022 (edited) 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, 2022 by tt36999 Quote Link to comment Share on other sites More sharing options...
Will11690 Posted July 3, 2022 Share Posted July 3, 2022 event.enqueueWork(() -> { RenderTypeLookup.setRenderLayer(ModBlocks.YOUR_BLOCK_HERE.get(), RenderType.cutout()); }); You need to add this to the same place you bind your TER. Quote You can find my mod MechaniCraft at this link: http://www.minecraftforge.net/forum/index.php/topic,13923.0.html - Will11690 Link to comment Share on other sites More sharing options...
warjort Posted July 3, 2022 Share Posted July 3, 2022 (edited) 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, 2022 by warjort 1 Quote 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. Link to comment Share on other sites More sharing options...
tt36999 Posted July 4, 2022 Author Share Posted July 4, 2022 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 Quote Link to comment Share on other sites More sharing options...
Will11690 Posted July 4, 2022 Share Posted July 4, 2022 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. Quote You can find my mod MechaniCraft at this link: http://www.minecraftforge.net/forum/index.php/topic,13923.0.html - Will11690 Link to comment Share on other sites More sharing options...
Recommended Posts
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.