From af08815fd90b5e4ef16a013153540200c88c75e2 Mon Sep 17 00:00:00 2001 From: Sara Freimer Date: Sat, 27 Jul 2024 12:07:24 -0500 Subject: [PATCH] Fix lighting being off for blocks stored in bins --- .../java/mekanism/client/render/tileentity/RenderBin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/mekanism/client/render/tileentity/RenderBin.java b/src/main/java/mekanism/client/render/tileentity/RenderBin.java index 63ae199fa13..bda1f2084d7 100644 --- a/src/main/java/mekanism/client/render/tileentity/RenderBin.java +++ b/src/main/java/mekanism/client/render/tileentity/RenderBin.java @@ -58,10 +58,6 @@ protected void render(TileEntityBin tile, float partialTick, PoseStack matrix, M Optional blockState = WorldUtils.getBlockState(world, coverPos); if (blockState.isEmpty() || !blockState.get().canOcclude() || !blockState.get().isFaceSturdy(world, coverPos, facing.getOpposite())) { matrix.pushPose(); - //TODO: Come up with a better way to do this hack? Basically we adjust the normals so that the lighting - // isn't screwy when it tries to apply the diffuse lighting as we aren't able to disable diffuse lighting - // ourselves so need to trick it - matrix.last().normal().set(FAKE_NORMALS); switch (facing) { case NORTH -> { matrix.translate(0.71, 0.8, -0.0001); @@ -82,6 +78,10 @@ protected void render(TileEntityBin tile, float partialTick, PoseStack matrix, M matrix.scale(scale, scale, 0.0001F); matrix.translate(8, -8, 8); matrix.scale(16, 16, 16); + //TODO: Come up with a better way to do this hack? Basically we adjust the normals so that the lighting + // isn't screwy when it tries to apply the diffuse lighting as we aren't able to disable diffuse lighting + // ourselves so need to trick it + matrix.last().normal().set(FAKE_NORMALS); //Calculate lighting based on the light at the block the bin is facing light = LevelRenderer.getLightColor(world, tile.getBlockPos().relative(facing)); Minecraft.getInstance().getItemRenderer().renderStatic(binSlot.getRenderStack(), ItemDisplayContext.GUI, light, overlayLight, matrix, renderer, world,