mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Restrict /npc age dynamically for future
This commit is contained in:
parent
e790a08821
commit
b58f91a7a2
@ -92,10 +92,10 @@ public class NPCCommands {
|
||||
min = 1,
|
||||
max = 2,
|
||||
permission = "citizens.npc.age")
|
||||
@Requirements(selected = true, ownership = true, types = { EntityType.CHICKEN, EntityType.COW,
|
||||
EntityType.MUSHROOM_COW, EntityType.OCELOT, EntityType.PIG, EntityType.SHEEP, EntityType.VILLAGER,
|
||||
EntityType.WOLF })
|
||||
@Requirements(selected = true, ownership = true)
|
||||
public void age(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
if (!npc.isSpawned() || !(npc.getBukkitEntity() instanceof Ageable))
|
||||
throw new CommandException(Messages.MOBTYPE_CANNOT_BE_AGED);
|
||||
Age trait = npc.getTrait(Age.class);
|
||||
|
||||
boolean toggleLock = args.hasFlag('l');
|
||||
|
Loading…
Reference in New Issue
Block a user