Merge branch 'main' into 'main'

Fix querying block colors at constant position.

See merge request jeseibel/minecraft-lod-mod!34
This commit is contained in:
James Seibel
2023-08-18 03:05:23 +00:00
2 changed files with 3 additions and 3 deletions
@@ -23,7 +23,7 @@ public class ClientBlockDetailMap
public int getColor(BlockState state, BiomeWrapper biome, DhBlockPos pos)
{
return getBlockStateData(state, pos).getAndResolveFaceColor(biome);
return getBlockStateData(state, pos).getAndResolveFaceColor(biome, pos);
}
}
@@ -211,12 +211,12 @@ public class ClientBlockStateCache
isColorResolved = true;
}
public int getAndResolveFaceColor(BiomeWrapper biome)
public int getAndResolveFaceColor(BiomeWrapper biome, DhBlockPos pos)
{
// FIXME: impl per-face colors
if (!needPostTinting) return baseColor;
int tintColor = Minecraft.getInstance().getBlockColors()
.getColor(state, new TintWithoutLevelOverrider(biome), pos, tintIndex);
.getColor(state, new TintWithoutLevelOverrider(biome), McObjectConverter.Convert(pos), tintIndex);
if (tintColor == -1) return baseColor;
return ColorUtil.multiplyARGBwithRGB(baseColor, tintColor);
}