mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Mob NPCs have names
This commit is contained in:
parent
6a7744859b
commit
d8e7c79c89
@ -389,8 +389,9 @@ public class NPCCommands {
|
|||||||
throw new CommandException(Messages.INVALID_SPAWN_LOCATION);
|
throw new CommandException(Messages.INVALID_SPAWN_LOCATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args.hasFlag('u'))
|
if (!args.hasFlag('u')) {
|
||||||
npc.spawn(spawnLoc);
|
npc.spawn(spawnLoc);
|
||||||
|
}
|
||||||
|
|
||||||
if (args.hasValueFlag("trait")) {
|
if (args.hasValueFlag("trait")) {
|
||||||
Iterable<String> parts = Splitter.on(',').trimResults().split(args.getFlag("trait"));
|
Iterable<String> parts = Splitter.on(',').trimResults().split(args.getFlag("trait"));
|
||||||
|
@ -198,6 +198,7 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
for (Trait trait : traits.values())
|
for (Trait trait : traits.values())
|
||||||
trait.onSpawn();
|
trait.onSpawn();
|
||||||
getBukkitEntity().setRemoveWhenFarAway(false);
|
getBukkitEntity().setRemoveWhenFarAway(false);
|
||||||
|
getBukkitEntity().setCustomName(getFullName());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user