From d8e7c79c89706f20072c1eb4d85812520482cb12 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sat, 16 Mar 2013 13:10:10 +0800 Subject: [PATCH] Mob NPCs have names --- src/main/java/net/citizensnpcs/commands/NPCCommands.java | 3 ++- src/main/java/net/citizensnpcs/npc/CitizensNPC.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index fbe8d8407..aecfbeac9 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -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 parts = Splitter.on(',').trimResults().split(args.getFlag("trait")); diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index e40125f31..296232ade 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -198,6 +198,7 @@ public class CitizensNPC extends AbstractNPC { for (Trait trait : traits.values()) trait.onSpawn(); getBukkitEntity().setRemoveWhenFarAway(false); + getBukkitEntity().setCustomName(getFullName()); return true; }