@Override public void getParameterOptions(Spell spell, String parameterKey, Collection<String> examples) { if (parameterKey.equals("type")) { for (EntityType type : EntityType.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("reason")) { for (CreatureSpawnEvent.SpawnReason type : CreatureSpawnEvent.SpawnReason.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("skeleton_type")) { for (Skeleton.SkeletonType type : Skeleton.SkeletonType.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("ocelot_type")) { for (Ocelot.Type type : Ocelot.Type.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("villager_profession")) { for (Villager.Profession profession : Villager.Profession.values()) { examples.add(profession.name().toLowerCase()); } } else if (parameterKey.equals("rabbity_type")) { for (Rabbit.Type type : Rabbit.Type.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("horse_variant")) { for (Horse.Variant type : Horse.Variant.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("horse_style")) { for (Horse.Style type : Horse.Style.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("horse_color")) { for (Horse.Color type : Horse.Color.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("color")) { for (DyeColor type : DyeColor.values()) { examples.add(type.name().toLowerCase()); } } else if (parameterKey.equals("track") || parameterKey.equals("loot") || parameterKey.equals("baby")) { examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_BOOLEANS))); } else if (parameterKey.equals("name")) { examples.add("Philbert"); } else if (parameterKey.equals("speed")) { examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_SIZES))); } else { super.getParameterOptions(spell, parameterKey, examples); } }
protected Entity setEntity(MageController controller, Entity entity) { this.entity = entity; if (noTarget) { entity.setMetadata("notarget", new FixedMetadataValue(controller.getPlugin(), true)); } if (customName != null) { entity.setCustomName(customName); entity.setCustomNameVisible(true); } if (entity instanceof LivingEntity) { ((LivingEntity) entity).setMaxHealth(1000.0); ((LivingEntity) entity).setHealth(1000.0); } if (entity instanceof Slime) { ((Slime) entity).setSize(1); } if (entity instanceof Ageable) { if (isBaby) { ((Ageable) entity).setBaby(); } else { ((Ageable) entity).setAdult(); } } else if (entity instanceof Zombie) { ((Zombie) entity).setBaby(isBaby); } else if (entity instanceof PigZombie) { ((PigZombie) entity).setBaby(isBaby); } else if (entity instanceof Slime && isBaby) { Slime slime = (Slime) entity; slime.setSize(0); } if (entity instanceof Horse) { Horse.Variant variant = Horse.Variant.UNDEAD_HORSE; if (variantName != null) { try { variant = Horse.Variant.valueOf(variantName.toUpperCase()); } catch (Exception ex) { } } else { variant = Horse.Variant.UNDEAD_HORSE; } ((Horse) entity).setVariant(variant); } if (entity instanceof Ocelot) { Ocelot ocelot = (Ocelot) entity; Ocelot.Type variant = Ocelot.Type.WILD_OCELOT; if (variantName != null) { try { variant = Ocelot.Type.valueOf(variantName.toUpperCase()); } catch (Exception ex) { } } else { variant = Ocelot.Type.WILD_OCELOT; } ocelot.setCatType(variant); } if (entity instanceof Sheep) { Sheep sheep = (Sheep) entity; DyeColor color = DyeColor.WHITE; if (variantName != null) { try { color = DyeColor.valueOf(variantName.toUpperCase()); } catch (Exception ex) { } } sheep.setColor(color); } if (entity instanceof Wolf) { Wolf wolf = (Wolf) entity; if (variantName != null) { // Only set collar color if a variant is set.. // this makes it a dog, versus a wolf. Technically. DyeColor color = DyeColor.RED; try { color = DyeColor.valueOf(variantName.toUpperCase()); wolf.setTamed(true); } catch (Exception ex) { } wolf.setCollarColor(color); } } targeting.ignoreEntity(entity); return entity; }
static { horseVariants = new HashMap<>(); for (final Horse.Variant e : Horse.Variant.values()) { horseVariants.put(e.name(), e); } }