From f359c7a3ec1126d24b8dbbba44286bd3be9d8747 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 12 Jun 2021 19:56:13 +1000 Subject: [PATCH] Fix new map colors rendering as transparent By: DerFrZocker --- .../main/java/org/bukkit/craftbukkit/map/CraftMapView.java | 4 ++-- paper-server/src/test/java/org/bukkit/map/MapTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/paper-server/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java index 0b760dbf97..caf4972a7a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java @@ -164,8 +164,8 @@ public final class CraftMapView implements MapView { byte[] buf = canvas.getBuffer(); for (int i = 0; i < buf.length; ++i) { byte color = buf[i]; - // There are 208 valid color id's, 0 -> 127 and -128 -> -49 - if (color >= 0 || color <= -21) render.buffer[i] = color; + // There are 248 valid color id's, 0 -> 127 and -128 -> -9 + if (color >= 0 || color <= -9) render.buffer[i] = color; } for (int i = 0; i < canvas.getCursors().size(); ++i) { diff --git a/paper-server/src/test/java/org/bukkit/map/MapTest.java b/paper-server/src/test/java/org/bukkit/map/MapTest.java index 5a8e3ebfbe..ef7cc9b2b6 100644 --- a/paper-server/src/test/java/org/bukkit/map/MapTest.java +++ b/paper-server/src/test/java/org/bukkit/map/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { int mr = (r * modi) / 255; int mg = (g * modi) / 255; int mb = (b * modi) / 255; - logger.log(Level.WARNING, "Missing color: c({0}, {1}, {2})", new Object[]{mr, mg, mb}); + logger.log(Level.WARNING, "Missing color (check CraftMapView#render): c({0}, {1}, {2})", new Object[]{mr, mg, mb}); } fail = true; } else {