@Override public boolean isSitting() { return w.isSitting(); }
private static boolean isFollowing(Entity entity) { switch (entity.getType()) { case WOLF: return !((Wolf) entity).isSitting(); case OCELOT: return !((Ocelot) entity).isSitting(); } return false; }
public void convertWolf(Wolf wolf, TagCompound properties) { properties.getCompoundData().put("Sitting", new TagByte(wolf.isSitting())); properties.getCompoundData().put("Tamed", new TagByte(wolf.isTamed())); properties.getCompoundData().put("CollarColor", new TagByte(wolf.getCollarColor().getWoolData())); } }
public void attackTarget(LivingEntity target) { double range = 5; Player player = getPlayer(); for (Entity entity : player.getNearbyEntities(range, range, range)) { if (entity.getType() != EntityType.WOLF) { continue; } Wolf wolf = (Wolf) entity; if (!wolf.isTamed() || (wolf.getOwner() != player) || wolf.isSitting()) { continue; } wolf.setTarget(target); } }
/** * @param event */ @EventHandler(priority = EventPriority.LOW) public void onPlayerInteract(PlayerInteractEntityEvent event) { if (event.isCancelled()) { return; } if (plugin.getSettingsManager().isTamableMobsSharing() && event.getRightClicked() instanceof Tameable) { Entity entity = event.getRightClicked(); Player player = event.getPlayer(); ClanPlayer cp = plugin.getClanManager().getClanPlayer(player); Tameable tamed = (Tameable) entity; if (tamed.isTamed()) { if(entity instanceof Wolf && !((Wolf) entity).isSitting()) { return; } if (cp.getClan().isMember((Player) tamed.getOwner())) { tamed.setOwner(player); } } } }
case WOLF: pet.setAge(((Wolf) e).getAge()); pet.setSitting(((Wolf) e).isSitting()); pet.setColour(((Wolf) e).getCollarColor()); health = (((Wolf) e).getHealth() > 8D) ? 8D : ((Wolf) e).getHealth();
wolf.setCustomName(wolfname); wolf.setSitting(w.isSitting()); wolf.setCollarColor(w.getCollarColor()); double health = (w.getHealth() > 8D) ? 8D : w.getHealth();