Allow npcs to be created unspawned with the -u flag

This commit is contained in:
fullwall 2012-09-17 21:49:28 +08:00
parent f2608e3c8d
commit b90a0f6b45

View File

@ -165,9 +165,9 @@ public class NPCCommands {
@Command(
aliases = { "npc" },
usage = "create [name] ((-b) --type (type) --trait ('trait1, trait2...') --b (behaviour))",
usage = "create [name] ((-b -u) --type (type) --trait ('trait1, trait2...') --b (behaviour))",
desc = "Create a new NPC",
flags = "b",
flags = "bu",
modifiers = { "create" },
min = 2,
permission = "npc.create")
@ -220,7 +220,8 @@ public class NPCCommands {
npc.getTrait(Owner.class).setOwner(player.getName());
npc.getTrait(MobType.class).setType(type);
npc.spawn(player.getLocation());
if (!args.hasFlag('u'))
npc.spawn(player.getLocation());
PlayerCreateNPCEvent event = new PlayerCreateNPCEvent(player, npc);
Bukkit.getPluginManager().callEvent(event);