Fixed item coloring.

This commit is contained in:
Florian Nücke
2021-12-31 17:51:10 +01:00
parent bb77b3ef95
commit 46543eb817
2 changed files with 4 additions and 3 deletions

View File

@@ -2,9 +2,9 @@ package li.cil.oc2.common.util;
public final class ColorUtils {
public static int textureDiffuseColorsToRGB(final float[] colors) {
final int r = ((int) colors[0] * 255) & 0xFF;
final int g = ((int) colors[1] * 255) & 0xFF;
final int b = ((int) colors[2] * 255) & 0xFF;
final int r = ((int) (colors[0] * 255)) & 0xFF;
final int g = ((int) (colors[1] * 255)) & 0xFF;
final int b = ((int) (colors[2] * 255)) & 0xFF;
return r << 16 | g << 8 | b;
}
}

View File

@@ -464,6 +464,7 @@ public final class Terminal {
@Override
public void render(final PoseStack stack) {
// TODO Right now we'll trigger multiple sounds if screen is open.
if (hasPendingBell) {
hasPendingBell = false;
final Minecraft client = Minecraft.getInstance();