Fix /npc villager --type

This commit is contained in:
fullwall 2019-07-13 21:42:57 +08:00
parent c7b59c84a7
commit 7a52682b87

View File

@ -398,8 +398,8 @@ public class Commands {
throw new CommandException(Messages.INVALID_VILLAGER_TYPE, throw new CommandException(Messages.INVALID_VILLAGER_TYPE,
Util.listValuesPretty(Villager.Type.values())); Util.listValuesPretty(Villager.Type.values()));
} }
trait.setLevel(args.getFlagInteger("type")); trait.setType(type);
output += Messaging.tr(Messages.VILLAGER_TYPE_SET, args.getFlagInteger("type")); output += Messaging.tr(Messages.VILLAGER_TYPE_SET, args.getFlag("type"));
} }
if (args.hasValueFlag("profession")) { if (args.hasValueFlag("profession")) {
Profession parsed = Util.matchEnum(Profession.values(), args.getFlag("profession")); Profession parsed = Util.matchEnum(Profession.values(), args.getFlag("profession"));