@Override public boolean isAdult() { return a.isAdult(); }
@Override public Age convert(Entity e) { if (e instanceof Ageable) { if (((Ageable) e).isAdult()) { System.out.println("Adult"); return Age.ADULT; } System.out.println("Baby"); return Age.BABY; } System.out.println("Null"); return null; }
public void convertAgable(Ageable ageable, TagCompound properties) { properties.getCompoundData().put("Baby", new TagByte(!ageable.isAdult())); }
baby = ((Zombie) disguisedEntity).isBaby(); } else if (disguisedEntity instanceof Ageable) { baby = !((Ageable) disguisedEntity).isAdult();
protected void tick(Block b) throws Exception { for (Entity n: me.mrCookieSlime.Slimefun.holograms.AnimalGrowthAccelerator.getArmorStand(b).getNearbyEntities(3D, 3D, 3D)) { if (n instanceof Ageable && !((Ageable) n).isAdult()) { for (int slot: getInputSlots()) { if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.ORGANIC_FOOD, false)) { if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return; ChargableBlock.addCharge(b, -getEnergyConsumption()); BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1)); ((Ageable) n).setAge(((Ageable) n).getAge() + 2000); if (((Ageable) n).getAge() > 0) ((Ageable) n).setAge(0); n.getWorld().spawnParticle(Particle.VILLAGER_HAPPY,((LivingEntity) n).getEyeLocation(), 8, 0.2F, 0.2F, 0.2F); return; } } } } }
case WOLF: Ageable a = (Ageable) e; if (!a.isAdult()) { plugin.getServer().dispatchCommand(plugin.getConsole(), "npc age baby");
public static void doBoundingBox(TargetedDisguise disguise) { Entity entity = disguise.getEntity(); if (entity == null) { return; } if (isDisguiseInUse(disguise)) { DisguiseValues disguiseValues = DisguiseValues.getDisguiseValues(disguise.getType()); FakeBoundingBox disguiseBox = disguiseValues.getAdultBox(); if (disguiseValues.getBabyBox() != null) { if ((disguise.getWatcher() instanceof AgeableWatcher && ((AgeableWatcher) disguise.getWatcher()).isBaby()) || (disguise.getWatcher() instanceof ZombieWatcher && ((ZombieWatcher) disguise.getWatcher()).isBaby())) { disguiseBox = disguiseValues.getBabyBox(); } } ReflectionManager.setBoundingBox(entity, disguiseBox); } else { DisguiseValues entityValues = DisguiseValues.getDisguiseValues(DisguiseType.getType(entity.getType())); FakeBoundingBox entityBox = entityValues.getAdultBox(); if (entityValues.getBabyBox() != null) { if ((entity instanceof Ageable && !((Ageable) entity).isAdult()) || (entity instanceof Zombie && ((Zombie) entity).isBaby())) { entityBox = entityValues.getBabyBox(); } } ReflectionManager.setBoundingBox(entity, entityBox); } }
EntityType replaceType = null; if (li instanceof Ageable && !((Ageable)li).isAdult() && !(li instanceof Player)) { context.registerModified(li); ((Ageable)li).setAdult();
if (li instanceof Ageable && !((Ageable)li).isAdult() && !(li instanceof Player)) { registerModified(li); ((Ageable)li).setAdult();
en.set("adult", ((Ageable)e).isAdult());
this.isBaby = !ageable.isAdult();
} else if (li instanceof Ageable && ((Ageable)li).isAdult()) { context.registerModified(li); ((Ageable)li).setBaby();
for (Entity n: AndroidStatusHologram.getNearbyEntities(b, 4D + getTier())) { if (n instanceof Monster) continue; if (n instanceof Ageable && !((Ageable) n).isAdult()) continue; switch (BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) { case NORTH: {
else if (li instanceof Ageable && ((Ageable)li).isAdult() && !(li instanceof Player)) { registerModified(li); ((Ageable)li).setBaby();