Fix /npc scoreboard

This commit is contained in:
fullwall 2014-06-29 19:40:32 -07:00
parent 8366b977ed
commit 683ffc08f7

View File

@ -1043,13 +1043,8 @@ public class NPCCommands {
Messaging.sendTr(sender, Messages.PROFESSION_SET, npc.getName(), profession);
}
@Command(
aliases = { "npc" },
usage = "remove|rem (all|id|name)",
desc = "Remove a NPC",
modifiers = { "remove", "rem" },
min = 1,
max = 2)
@Command(aliases = { "npc" }, usage = "remove|rem (all|id|name)", desc = "Remove a NPC", modifiers = { "remove",
"rem" }, min = 1, max = 2)
@Requirements
public void remove(final CommandContext args, final CommandSender sender, NPC npc) throws CommandException {
if (args.argsLength() == 2) {
@ -1141,11 +1136,11 @@ public class NPCCommands {
@Requirements(selected = true, ownership = true, types = EntityType.PLAYER)
public void scoreboard(CommandContext args, CommandSender sender, NPC npc) {
Scoreboard main = Bukkit.getScoreboardManager().getMainScoreboard();
String objective = args.getString(0);
String criteria = args.getString(1);
String objective = args.getString(1);
String criteria = args.getString(2);
Objective obj = main.getObjective(objective);
if (obj == null) {
Bukkit.getScoreboardManager().getMainScoreboard().registerNewObjective(objective, criteria);
obj = Bukkit.getScoreboardManager().getMainScoreboard().registerNewObjective(objective, criteria);
}
Player entity = (Player) npc.getEntity();
if (args.hasValueFlag("team")) {