From 4bbe7971208512ac1c4805ab8129c8e6f7930867 Mon Sep 17 00:00:00 2001 From: fullwall Date: Wed, 22 Apr 2020 18:00:15 +0800 Subject: [PATCH] QoL change for /npc glowing --color to enable if not previously enabled --- main/src/main/java/net/citizensnpcs/commands/NPCCommands.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java index 06eac7212..8cc0c1554 100644 --- a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -640,6 +640,9 @@ public class NPCCommands { if (!(npc.getEntity() instanceof Player)) throw new CommandException(Messages.GLOWING_COLOR_PLAYER_ONLY); npc.getTrait(ScoreboardTrait.class).setColor(chatColor); + if (!npc.data().has(NPC.GLOWING_METADATA)) { + npc.data().setPersistent(NPC.GLOWING_METADATA, true); + } Messaging.sendTr(sender, Messages.GLOWING_COLOR_SET, npc.getName(), chatColor == null ? ChatColor.WHITE + "white" : chatColor + Util.prettyEnum(chatColor)); return;