From ce95b5d653b7fa497c8dab2a2021f8fac8270854 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:33:47 +0100 Subject: [PATCH] Use proper default for setting null display background color (#12010) --- .../java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java index 9ef939b76..3dd5009a9 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java @@ -58,13 +58,13 @@ public class CraftTextDisplay extends CraftDisplay implements TextDisplay { public Color getBackgroundColor() { int color = this.getHandle().getBackgroundColor(); - return (color == -1) ? null : Color.fromARGB(color); + return color == Display.TextDisplay.INITIAL_BACKGROUND ? null : Color.fromARGB(color); } @Override public void setBackgroundColor(Color color) { if (color == null) { - this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, -1); + this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, Display.TextDisplay.INITIAL_BACKGROUND); } else { this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, color.asARGB()); }