From 29113cea71db084cee24e01ea85023691825e020 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sun, 22 Dec 2024 03:33:29 +0000 Subject: [PATCH] Correctly send BGR over the network for map colors --- .../main/java/org/geysermc/geyser/level/MapColor.java | 10 +++++++--- .../protocol/java/level/JavaMapItemDataTranslator.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/level/MapColor.java b/core/src/main/java/org/geysermc/geyser/level/MapColor.java index a599f9146..da0c0a4b2 100644 --- a/core/src/main/java/org/geysermc/geyser/level/MapColor.java +++ b/core/src/main/java/org/geysermc/geyser/level/MapColor.java @@ -285,16 +285,20 @@ public enum MapColor { alpha = 0; // transparent this.value = ((alpha & 0xFF) << 24) | - ((red & 0xFF) << 16) | + ((blue & 0xFF) << 16) | ((green & 0xFF) << 8) | - (blue & 0xFF); + (red & 0xFF); } public static MapColor fromId(int id) { return id >= 0 && id < VALUES.length ? VALUES[id] : COLOR_0; } - public int getARGB() { + /** + * Get the ABGR value of the color, bedrock uses this over the network + * @return the int value of the color + */ + public int getABGR() { return value; } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java index 52a08ab29..94c4736c6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java @@ -65,7 +65,7 @@ public class JavaMapItemDataTranslator extends PacketTranslator