diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index 4b677a225..a4f6bd63d 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -80,6 +80,7 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.Villager.Profession; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.Objective; @@ -272,7 +273,7 @@ public class NPCCommands { } CommandSenderCreateNPCEvent event = sender instanceof Player ? new PlayerCreateNPCEvent((Player) sender, copy) - : new CommandSenderCreateNPCEvent(sender, copy); + : new CommandSenderCreateNPCEvent(sender, copy); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { event.getNPC().destroy(); @@ -348,7 +349,7 @@ public class NPCCommands { spawnLoc = args.getSenderLocation(); } CommandSenderCreateNPCEvent event = sender instanceof Player ? new PlayerCreateNPCEvent((Player) sender, npc) - : new CommandSenderCreateNPCEvent(sender, npc); + : new CommandSenderCreateNPCEvent(sender, npc); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { npc.destroy(); @@ -1023,7 +1024,7 @@ public class NPCCommands { @Requirements(selected = true, ownership = true, types = { EntityType.CREEPER }) public void power(CommandContext args, CommandSender sender, NPC npc) { Messaging - .sendTr(sender, npc.getTrait(Powered.class).toggle() ? Messages.POWERED_SET : Messages.POWERED_STOPPED); + .sendTr(sender, npc.getTrait(Powered.class).toggle() ? Messages.POWERED_SET : Messages.POWERED_STOPPED); } @Command( @@ -1046,7 +1047,7 @@ public class NPCCommands { } @Command(aliases = { "npc" }, usage = "remove|rem (all|id|name)", desc = "Remove a NPC", modifiers = { "remove", - "rem" }, min = 1, max = 2) + "rem" }, min = 1, max = 2) @Requirements public void remove(final CommandContext args, final CommandSender sender, NPC npc) throws CommandException { if (args.argsLength() == 2) { @@ -1141,6 +1142,7 @@ public class NPCCommands { Scoreboard main; if (!itr.iterator().hasNext()) { main = Bukkit.getScoreboardManager().getNewScoreboard(); + npc.getEntity().setMetadata("citizens.scoreboard", new FixedMetadataValue(CitizensAPI.getPlugin(), main)); } else { main = (Scoreboard) itr.iterator().next().value(); }