mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-04 07:27:59 +01:00
Allow npcs to be created unspawned with the -u flag
This commit is contained in:
parent
f2608e3c8d
commit
b90a0f6b45
@ -165,9 +165,9 @@ public class NPCCommands {
|
|||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
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",
|
desc = "Create a new NPC",
|
||||||
flags = "b",
|
flags = "bu",
|
||||||
modifiers = { "create" },
|
modifiers = { "create" },
|
||||||
min = 2,
|
min = 2,
|
||||||
permission = "npc.create")
|
permission = "npc.create")
|
||||||
@ -220,7 +220,8 @@ public class NPCCommands {
|
|||||||
npc.getTrait(Owner.class).setOwner(player.getName());
|
npc.getTrait(Owner.class).setOwner(player.getName());
|
||||||
npc.getTrait(MobType.class).setType(type);
|
npc.getTrait(MobType.class).setType(type);
|
||||||
|
|
||||||
npc.spawn(player.getLocation());
|
if (!args.hasFlag('u'))
|
||||||
|
npc.spawn(player.getLocation());
|
||||||
|
|
||||||
PlayerCreateNPCEvent event = new PlayerCreateNPCEvent(player, npc);
|
PlayerCreateNPCEvent event = new PlayerCreateNPCEvent(player, npc);
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
Loading…
Reference in New Issue
Block a user