Skip to content

Commit

Permalink
Fix glowing showing as white when disabled in info command
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Jul 18, 2024
1 parent ece3204 commit 6fb65a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/de/oliver/fancynpcs/commands/npc/InfoCMD.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down

0 comments on commit 6fb65a7

Please sign in to comment.