@Override public void setBaby() { a.setBaby(); }
public void change(Age[] age, Object[] delta, Changer.ChangeMode mode) { for (Age a : age) { for (Object o : delta) { if (o instanceof Entity) { if (o instanceof Ageable) { if (a == Age.BABY) { ((Ageable) o).setBaby(); } if (a == Age.ADULT) { ((Ageable) o).setAdult(); } } } } } } };
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onInteract(CreatureSpawnEvent event) { Entity ent = event.getEntity(); if (!(ent instanceof Ageable)) { return; } if (!event.getSpawnReason().equals(SpawnReason.BREEDING)) { return; } Location l = ent.getLocation(); String w = l.getWorld().getName(); if (!plugin.getTrackerKeeper().getSiegeBreedingAreas().containsKey(w)) { return; } plugin.getTrackerKeeper().getSiegeBreedingAreas().get(w).forEach((area) -> { if (area.isInSiegeArea(l) && random.nextInt(100) < chance) { // make them twins plugin.setTardisSpawn(true); Ageable twin = (Ageable) l.getWorld().spawnEntity(l, ent.getType()); twin.setBaby(); } }); } }
((Ageable) bukkitEntity).setBaby();
ageable.setBaby(); showEntityInfo(sender, testEntity, label, formatter);
((Ageable)entity).setBaby(); } else switch (entity.getType()) { case PHANTOM:
((Ageable) creature).setBaby(); } else if (creature instanceof Zombie) { ((Zombie) creature).setBaby(true);
Ageable ageable = (Ageable)entity; if (isBaby) { ageable.setBaby(); } else { ageable.setAdult();
((Ageable)e).setAdult(); } else { ((Ageable)e).setBaby();
ageable.setBaby();
} else if (li instanceof Ageable && ((Ageable)li).isAdult()) { context.registerModified(li); ((Ageable)li).setBaby(); } else if (li instanceof Zombie && !((Zombie)li).isBaby()) { context.registerModified(li);
((Ageable) normalEntity).setBaby(); } else { ((Ageable) normalEntity).setAdult();
((Ageable)li).setBaby(); } else if (li instanceof Zombie && !((Zombie)li).isBaby()) { registerModified(li);