Mob NPCs have names

This commit is contained in:
fullwall 2013-03-16 13:10:10 +08:00
parent 1b3e3e995c
commit 8d1162059a
2 changed files with 3 additions and 1 deletions

View File

@ -389,8 +389,9 @@ public class NPCCommands {
throw new CommandException(Messages.INVALID_SPAWN_LOCATION);
}
if (!args.hasFlag('u'))
if (!args.hasFlag('u')) {
npc.spawn(spawnLoc);
}
if (args.hasValueFlag("trait")) {
Iterable<String> parts = Splitter.on(',').trimResults().split(args.getFlag("trait"));

View File

@ -198,6 +198,7 @@ public class CitizensNPC extends AbstractNPC {
for (Trait trait : traits.values())
trait.onSpawn();
getBukkitEntity().setRemoveWhenFarAway(false);
getBukkitEntity().setCustomName(getFullName());
return true;
}