diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index d01dad56b..eb389cba4 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -530,6 +530,21 @@ public class NPCCommands { Messaging.sendTr(sender, Messages.GAMEMODE_SET, mode.name().toLowerCase()); } + @Command( + aliases = { "npc" }, + usage = "glowing", + desc = "Toggles an NPC's glowing status", + modifiers = { "glowing" }, + min = 1, + max = 1, + permission = "citizens.npc.glowing") + @Requirements(selected = true, ownership = true) + public void glowing(CommandContext args, CommandSender sender, NPC npc) throws CommandException { + npc.data().setPersistent(NPC.GLOWING_METADATA, !npc.data().get(NPC.GLOWING_METADATA, false)); + boolean glowing = npc.data().get(NPC.GLOWING_METADATA); + Messaging.sendTr(sender, glowing ? Messages.GLOWING_SET : Messages.GLOWING_UNSET); + } + @Command( aliases = { "npc" }, usage = "gravity", diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index 965f8e737..c77eb0893 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -273,6 +273,7 @@ public class CitizensNPC extends AbstractNPC { } navigator.run(); + getEntity().setGlowing(data().get(NPC.GLOWING_METADATA, false)); if (!getNavigator().isNavigating() && updateCounter++ > Setting.PACKET_UPDATE_DELAY.asInt()) { updateCounter = 0; if (getEntity() instanceof LivingEntity) { diff --git a/src/main/java/net/citizensnpcs/util/Messages.java b/src/main/java/net/citizensnpcs/util/Messages.java index 399e94556..ef19ba36d 100644 --- a/src/main/java/net/citizensnpcs/util/Messages.java +++ b/src/main/java/net/citizensnpcs/util/Messages.java @@ -82,6 +82,8 @@ public class Messages { public static final String GAMEMODE_DESCRIBE = "citizens.commands.npc.gamemode.describe"; public static final String GAMEMODE_INVALID = "citizens.commands.npc.gamemode.invalid"; public static final String GAMEMODE_SET = "citizens.commands.npc.gamemode.set"; + public static final String GLOWING_SET = "citizens.commands.npc.glowing.set"; + public static final String GLOWING_UNSET = "citizens.commands.npc.glowing.unset"; public static final String GRAVITY_DISABLED = "citizens.commands.npc.gravity.disabled"; public static final String GRAVITY_ENABLED = "citizens.commands.npc.gravity.enabled"; public static final String GUIDED_WAYPOINT_EDITOR_ADDED_AVAILABLE = "citizens.editors.waypoints.guided.added-available"; diff --git a/src/main/resources/messages_en.properties b/src/main/resources/messages_en.properties index 83fff7c69..93f63f3c7 100644 --- a/src/main/resources/messages_en.properties +++ b/src/main/resources/messages_en.properties @@ -42,6 +42,8 @@ citizens.commands.npc.gamemode.invalid={0} is not a valid gamemode. citizens.commands.npc.gamemode.set=Gamemode set to [[{0}]]. citizens.commands.npc.gravity.disabled=Gravity [[disabled]]. citizens.commands.npc.gravity.enabled=Gravity [[enabled]]. +citizens.commands.npc.glowing.set=[[{0}]] is now glowing. +citizens.commands.npc.glowing.unset=[[{0}]] is no longer glowing. citizens.commands.npc.guardian.elder-unset=[[{0}]] is no longer an elder guardian. citizens.commands.npc.guardian.elder-set=[[{0}]] is now an elder guardian. citizens.commands.npc.horse.chest-set=The horse is now carrying a chest.