From 6fb65a7f491e4235757421d8f4e2bc41fd778e78 Mon Sep 17 00:00:00 2001 From: OliverSchlueter Date: Thu, 18 Jul 2024 23:24:01 +0200 Subject: [PATCH] Fix glowing showing as white when disabled in info command --- src/main/java/de/oliver/fancynpcs/commands/npc/InfoCMD.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/oliver/fancynpcs/commands/npc/InfoCMD.java b/src/main/java/de/oliver/fancynpcs/commands/npc/InfoCMD.java index 9da02970..9784419b 100644 --- a/src/main/java/de/oliver/fancynpcs/commands/npc/InfoCMD.java +++ b/src/main/java/de/oliver/fancynpcs/commands/npc/InfoCMD.java @@ -13,11 +13,10 @@ import org.bukkit.command.CommandSender; import org.incendo.cloud.annotations.Command; import org.incendo.cloud.annotations.Permission; +import org.jetbrains.annotations.NotNull; import java.text.DecimalFormat; -import org.jetbrains.annotations.NotNull; - public enum InfoCMD { INSTANCE; // SINGLETON @@ -33,7 +32,7 @@ public void onInfo( final Location loc = npc.getData().getLocation(); final Interval interactionCooldown = Interval.of(npc.getData().getInteractionCooldown(), Unit.SECONDS); // Getting the translated glowing state. This should never throw because all supported NamedTextColor objects has their mapping in GlowingColor enum. - final String glowingStateTranslated = (!npc.getData().isGlowing() || npc.getData().getGlowingColor() != null) + final String glowingStateTranslated = (npc.getData().isGlowing() && npc.getData().getGlowingColor() != null) ? ((SimpleMessage) translator.translate(GlowingColor.fromAdventure(npc.getData().getGlowingColor()).getTranslationKey())).getMessage() : ((SimpleMessage) translator.translate("disabled")).getMessage(); // Getting the creator player profile, this will be completed from cache in order to get name of the player.