@Override public LivingEntity spawnZombieVillager(Location loc, Profession profession) { ZombieVillager entity = (ZombieVillager) loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE_VILLAGER); entity.setVillagerProfession(profession); return entity; }
/** * Assembles an ArrayList of the properties for the specified Entity that * is to be used for a spawn egg. All instanceof checks are done internally * by the LorePackager, so no type checking is required prior to calling * this method. Null Entities will throw an IllegalArgumentException. <b>The * actual ArrayList is returned by {@link #getLore() LorePacker.getLore()}. * </b> * @param livingEntity - The Entity to assemble a lore for. * @return An ArrayList of Strings * @throws IllegalArgumentException If entity parameter is null */ public LorePacker(LivingEntity livingEntity) throws IllegalArgumentException { if (livingEntity == null) { throw new IllegalArgumentException("Can't assemble lore for a null entity!"); } lore = new ArrayList<String>(); // This needs to always be on top of an egg's lore lore.add("Identifier: SimpleEgg." + livingEntity.getType().getEntityClass().getSimpleName() + "." + Main.getSelf().getDescription().getVersion()); lore.addAll(livingEntity(livingEntity)); if (livingEntity instanceof Ageable) { lore.addAll(ageable((Ageable) livingEntity)); if (livingEntity instanceof Sheep) { lore.addAll(sheep((Sheep) livingEntity)); } else if (livingEntity instanceof Pig) { lore.addAll(pig((Pig) livingEntity)); } else if (livingEntity instanceof Rabbit) { lore.addAll(rabbit((Rabbit) livingEntity)); } else if (livingEntity instanceof Villager) { lore.addAll(villager((Villager) livingEntity)); } else if (livingEntity instanceof Tameable) { lore.addAll(tameable((Tameable) livingEntity)); if (livingEntity instanceof AbstractHorse) { lore.addAll(abstractHorse((AbstractHorse) livingEntity)); if (livingEntity instanceof Horse) { lore.addAll(horse((Horse) livingEntity)); } else if (livingEntity instanceof ChestedHorse) { lore.addAll(chestedHorse((ChestedHorse) livingEntity)); if (livingEntity instanceof Llama) { lore.addAll(llama((Llama) livingEntity)); } } } else if (livingEntity instanceof Sittable) { lore.addAll(sittable((Sittable) livingEntity)); if (livingEntity instanceof Wolf) { lore.addAll(wolf((Wolf) livingEntity)); } else if (livingEntity instanceof Ocelot) { lore.addAll(ocelot((Ocelot) livingEntity)); } else if (livingEntity instanceof Parrot) { lore.addAll(parrot((Parrot) livingEntity)); } } } } else if (livingEntity instanceof Slime) { lore.addAll(slime((Slime) livingEntity)); } else if (livingEntity instanceof Creeper) { lore.addAll(creeper((Creeper) livingEntity)); } else if (livingEntity instanceof Zombie) { lore.addAll(zombie((Zombie) livingEntity)); if (livingEntity instanceof PigZombie) { lore.addAll(pigZombie((PigZombie) livingEntity)); } else if (livingEntity instanceof ZombieVillager) { lore.addAll(zombieVillager((ZombieVillager) livingEntity)); } } else if (livingEntity instanceof Spellcaster) { lore.addAll(spellCaster((Spellcaster) livingEntity)); } else if (livingEntity instanceof IronGolem) { lore.addAll(ironGolem((IronGolem) livingEntity)); } else if (livingEntity instanceof Snowman) { lore.addAll(snowman((Snowman) livingEntity)); } }