mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-26 11:07:59 +01:00
Add /npc glowing
This commit is contained in:
parent
f9308391ba
commit
2e41832873
@ -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",
|
||||
|
@ -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) {
|
||||
|
@ -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";
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user