Fix the Emissive Rendering for Experimental Light Pipeline (#9651)

This commit is contained in:
Kovak authored and GitHub committed 2023-07-15 08:07:37 -07:00
1 parent 5c40bef28e
commit 4385eb2155
3 files changed
+3 -2

No files matched your search

@@ -38,7 +38,7 @@ public class FlatQuadLighter extends QuadLighter
isFullCube = Block.isShapeFullBlock(state.getCollisionShape(level, pos));
for (Direction side : SIDES)
{
packedLight[side.ordinal()] = getLightColor(level, pos.relative(side), state);
packedLight[side.ordinal()] = LevelRenderer.getLightColor(level, state, pos.relative(side));
}
//Note: We can just use the LevelRenderer method as we know the state is the state at the given position
packedLight[6] = LevelRenderer.getLightColor(level, state, pos);
@@ -158,6 +158,7 @@ public abstract class QuadLighter
* as it only uses the state for querying if the state has emissive rendering but instead looks up the state at the given position for checking the
* light emission.
*/
@Deprecated(since = "1.20.1")
protected static int getLightColor(BlockAndTintGetter level, BlockPos pos, BlockState state)
{
if (state.emissiveRendering(level, pos))
@@ -50,7 +50,7 @@ public class SmoothQuadLighter extends QuadLighter
pos.setWithOffset(origin, x - 1, y - 1, z - 1);
BlockState neighborState = level.getBlockState(pos);
t[x][y][z] = neighborState.getLightBlock(level, pos) < 15;
int brightness = getLightColor(level, pos, state);
int brightness = LevelRenderer.getLightColor(level, neighborState, pos);
s[x][y][z] = LightTexture.sky(brightness);
b[x][y][z] = LightTexture.block(brightness);
ao[x][y][z] = neighborState.getShadeBrightness(level, pos);