From 501f1dc8dcd33179cc87abb379056f49da9b94ca Mon Sep 17 00:00:00 2001 From: Ben Staddon Date: Fri, 4 Jan 2019 02:11:34 +0000 Subject: [PATCH] Fix small logic error in emissive item rendering code (#5320) --- .../java/net/minecraftforge/client/ForgeHooksClient.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 0622268fa2..1586cc3fba 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -629,6 +629,9 @@ public class ForgeHooksClient int segmentSkyLight = -1; // Coloring of the current segment int segmentColorMultiplier = color; + // State changed by the current segment + boolean segmentLightingDirty = false; + boolean segmentColorDirty = false; // If the current segment contains lighting data boolean hasLighting = false; @@ -681,18 +684,20 @@ public class ForgeHooksClient { if (i > 0) // Make sure this isn't the first quad being processed { - drawSegment(ri, color, stack, segment, segmentBlockLight, segmentSkyLight, segmentColorMultiplier, lightingDirty && (hasLighting || segment.size() < i), colorDirty); + drawSegment(ri, color, stack, segment, segmentBlockLight, segmentSkyLight, segmentColorMultiplier, segmentLightingDirty && (hasLighting || segment.size() < i), segmentColorDirty); } segmentBlockLight = bl; segmentSkyLight = sl; segmentColorMultiplier = colorMultiplier; + segmentLightingDirty = lightingDirty; + segmentColorDirty = colorDirty; hasLighting = segmentBlockLight > 0 || segmentSkyLight > 0; } segment.add(q); } - drawSegment(ri, color, stack, segment, segmentBlockLight, segmentSkyLight, segmentColorMultiplier, hasLighting || segment.size() < allquads.size(), false); + drawSegment(ri, color, stack, segment, segmentBlockLight, segmentSkyLight, segmentColorMultiplier, segmentLightingDirty && (hasLighting || segment.size() < allquads.size()), segmentColorDirty); // Clean up render state if necessary if (hasLighting)