From b58f91a7a2fe76aac103e5bab74eaacb57246a34 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 17 Feb 2013 17:35:58 +0800 Subject: [PATCH] Restrict /npc age dynamically for future --- src/main/java/net/citizensnpcs/commands/NPCCommands.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index bdaef4337..600b08362 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -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');