Skip to content

Commit af08815

Browse files
committed
Fix lighting being off for blocks stored in bins
1 parent e9964dc commit af08815

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/mekanism/client/render/tileentity/RenderBin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ protected void render(TileEntityBin tile, float partialTick, PoseStack matrix, M
5858
Optional<BlockState> blockState = WorldUtils.getBlockState(world, coverPos);
5959
if (blockState.isEmpty() || !blockState.get().canOcclude() || !blockState.get().isFaceSturdy(world, coverPos, facing.getOpposite())) {
6060
matrix.pushPose();
61-
//TODO: Come up with a better way to do this hack? Basically we adjust the normals so that the lighting
62-
// isn't screwy when it tries to apply the diffuse lighting as we aren't able to disable diffuse lighting
63-
// ourselves so need to trick it
64-
matrix.last().normal().set(FAKE_NORMALS);
6561
switch (facing) {
6662
case NORTH -> {
6763
matrix.translate(0.71, 0.8, -0.0001);
@@ -82,6 +78,10 @@ protected void render(TileEntityBin tile, float partialTick, PoseStack matrix, M
8278
matrix.scale(scale, scale, 0.0001F);
8379
matrix.translate(8, -8, 8);
8480
matrix.scale(16, 16, 16);
81+
//TODO: Come up with a better way to do this hack? Basically we adjust the normals so that the lighting
82+
// isn't screwy when it tries to apply the diffuse lighting as we aren't able to disable diffuse lighting
83+
// ourselves so need to trick it
84+
matrix.last().normal().set(FAKE_NORMALS);
8585
//Calculate lighting based on the light at the block the bin is facing
8686
light = LevelRenderer.getLightColor(world, tile.getBlockPos().relative(facing));
8787
Minecraft.getInstance().getItemRenderer().renderStatic(binSlot.getRenderStack(), ItemDisplayContext.GUI, light, overlayLight, matrix, renderer, world,

0 commit comments

Comments
 (0)