Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by tt36999

  • 4 months later...

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

  • 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

  • tt36999 changed the title to [SLOVED][1.16.5]TileEntityRender render a full black block
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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.