public class ConfigManager
{
    public final Material controlItem;
    public final long updatePeriod;

    public final int maxTravelDistance;
    public final double maxSearchRange;
    public final double attackRange;
    public final double mountRange;
    public final double goalRange;

    public final String attackConfirmedMessage;
    public final String attackConfusedMessage;
    public final String followConfirmedMessage;
    public final String followConfusedMessage;
    public final String goConfirmedMessage;
    public final String goConfusedMessage;
    public final String stopConfirmedMessage;
    public final String fedConfirmedMessage;
    public final String fedConfusedMessage;

    private static final String CONFIG_FILE = "config.yml";
    private static final int BUFFER_SIZE = 8192;

    private FileConfiguration config;
    private File configFile;
    private MobRider plugin;
    private Set<Material> food;

    public ConfigManager(MobRider plugin)
    {
        this.plugin = plugin;

        configFile = new File(plugin.getDataFolder(), CONFIG_FILE);
        config = getConfig(configFile);

        ConfigurationSection general = config.getConfigurationSection("general");
        LoggerUtil.getInstance().setDebug(general.getBoolean("debug", false));
        controlItem = Material.matchMaterial(general.getString("control_item"));
        updatePeriod = general.getLong("update_period");

        ConfigurationSection range = config.getConfigurationSection("range");
        maxTravelDistance = Double.valueOf(range.getDouble("max_travel_distance")).intValue();
        maxSearchRange = range.getDouble("max_search_distance");
        attackRange = range.getDouble("attack_range");
        mountRange = range.getDouble("mount_range");
        goalRange = range.getDouble("goal_range");

        ConfigurationSection messageSuffix = config.getConfigurationSection("noise_suffix");
        attackConfirmedMessage = messageSuffix.getString("attack_confirmed");
        attackConfusedMessage = messageSuffix.getString("attack_confused");
        followConfirmedMessage = messageSuffix.getString("follow_confirmed");
        followConfusedMessage = messageSuffix.getString("follow_confused");
        goConfirmedMessage = messageSuffix.getString("go_confirmed");
        goConfusedMessage = messageSuffix.getString("go_confused");
        stopConfirmedMessage = messageSuffix.getString("stop_confirmed");
        fedConfirmedMessage = messageSuffix.getString("fed_confirmed");
        fedConfusedMessage = messageSuffix.getString("fed_confused");

        food = new HashSet<Material>();
        List<String> materials = config.getStringList("food");
        for (String material : materials) {
            food.add(Material.matchMaterial(material));
        }

        ConfigurationSection mobs = config.getConfigurationSection("mobs");
        for (String name : mobs.getKeys(false)) {
            ConfigurationSection mob = mobs.getConfigurationSection(name);
            EntityType type = EntityType.fromName(name);
            if (type != null) {
                new RideType(type, Double.valueOf(mob.getDouble("speed")).floatValue(), mob.getString("noise"), mob.getDouble("chance"),
                        mob.getDouble("cost"));
            }
        }
    }

    public void save()
    {
        try {
            config.save(configFile);
        }
        catch (IOException e) {
            LoggerUtil.getInstance().severe(e.getMessage());
        }
    }

    public boolean isFood(Material material)
    {
        return food.contains(material);
    }

    private FileConfiguration getConfig(File file)
    {
        FileConfiguration newConfig = null;

        try {
            if (!file.exists()) {
                file.getParentFile().mkdir();
                file.createNewFile();
                InputStream inputStream = plugin.getResource(file.getName());
                FileOutputStream outputStream = new FileOutputStream(file);

                try {
                    byte[] buffer = new byte[BUFFER_SIZE];
                    int length = 0;
                    while ((length = inputStream.read(buffer)) > 0) {
                        outputStream.write(buffer, 0, length);
                    }
                }
                catch (IOException e) {
                    LoggerUtil.getInstance().warning("Default config could not be read");
                }
                finally {
                    inputStream.close();
                    outputStream.close();
                }

                LoggerUtil.getInstance().info("Default config created successfully!");
            }

            newConfig = plugin.getConfig();
            newConfig.setDefaults(YamlConfiguration.loadConfiguration(plugin.getResource(file.getName())));
            newConfig.options().copyDefaults(true);
        }
        catch (IOException e) {
            LoggerUtil.getInstance().warning("Default config could not be created!");
        }

        return newConfig;
    }
}
 public class MobRider extends JavaPlugin
{
    private CommandHandler commandHandler;
    private RiderManager riderManager;
    private GoalManager goalManager;
    private ConfigManager config;
    private RideMetrics metrics;

    @Override
    public void onEnable()
    {
        DependencyUtils.init();

        metrics = new RideMetrics(this);
        config = new ConfigManager(this);
        goalManager = new GoalManager(this);
        riderManager = new RiderManager(this);

        addCommands();
        registerEvents();

        new UpdateTask(this);

        LoggerUtil.getInstance().info(getDescription().getVersion() + " enabled.");
    }

    @Override
    public void onDisable()
    {
        getServer().getScheduler().cancelTasks(this);
        config.save();
        LoggerUtil.getInstance().info(getDescription().getVersion() + " disabled.");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
    {
        return commandHandler.dispatch(sender, cmd, commandLabel, args);
    }

    @Override
    public void reloadConfig()
    {
        super.reloadConfig();
        config = new ConfigManager(this);
    }

    public RiderManager getRiderManager()
    {
        return riderManager;
    }

    public GoalManager getGoalManager()
    {
        return goalManager;
    }

    public ConfigManager getConfigManager()
    {
        return config;
    }

    public RideMetrics getMetricsManager()
    {
        return metrics;
    }

    public CommandHandler getCommandHandler()
    {
        return commandHandler;
    }

    private void addCommands()
    {
        commandHandler = new CommandHandler();

        commandHandler.addCommand(new AttackCommand(this));
        commandHandler.addCommand(new FollowCommand(this));
        commandHandler.addCommand(new GoCommand(this));
        commandHandler.addCommand(new GotoCommand(this));
        commandHandler.addCommand(new StopCommand(this));
        commandHandler.addCommand(new HelpCommand(this));
        commandHandler.addCommand(new MountCommand(this));
        commandHandler.addCommand(new BuckCommand());
        commandHandler.addCommand(new ReloadCommand(this));
    }

    private void registerEvents()
    {
        Bukkit.getPluginManager().registerEvents(new RiderPlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new RiderTargetListener(), this);
        Bukkit.getPluginManager().registerEvents(new RiderDamageListener(this), this);
    }
}
 public final class EntityUtils
{
    private static final EnumSet<Material> TRANSPARENT_BLOCKS = EnumSet.of(Material.AIR, Material.WATER);

    private static final EnumSet<EntityType> NEW_AI_MOBS = EnumSet.of(EntityType.CHICKEN, EntityType.COW, EntityType.CREEPER, EntityType.ENDER_DRAGON,
            EntityType.ENDERMAN, EntityType.HORSE, EntityType.IRON_GOLEM, EntityType.MUSHROOM_COW, EntityType.OCELOT, EntityType.PIG, EntityType.PIG_ZOMBIE,
            EntityType.SHEEP, EntityType.SKELETON, EntityType.SNOWMAN, EntityType.VILLAGER, EntityType.WITCH, EntityType.WITHER, EntityType.WITHER_SKULL,
            EntityType.WOLF, EntityType.ZOMBIE);

    private static final EnumSet<EntityType> AGGRESSIVE_MOBS = EnumSet.of(EntityType.BLAZE, EntityType.CAVE_SPIDER, EntityType.ENDER_DRAGON,
            EntityType.ENDERMAN, EntityType.GHAST, EntityType.GIANT, EntityType.IRON_GOLEM, EntityType.MAGMA_CUBE, EntityType.OCELOT, EntityType.PIG_ZOMBIE,
            EntityType.SILVERFISH, EntityType.SKELETON, EntityType.SLIME, EntityType.SNOWMAN, EntityType.SPIDER, EntityType.WITCH, EntityType.WITHER,
            EntityType.WITCH, EntityType.WOLF, EntityType.ZOMBIE);

    private EntityUtils()
    {
    }

    public static boolean isInteger(final String s)
    {
        try {
            Integer.parseInt(s);
        }
        catch (NumberFormatException e) {
            return false;
        }

        return true;
    }

    public static String getCreatureName(Entity entity)
    {
        return entity == null || entity.getType().name() == null ? "" : entity.getType().name();
    }

    public static LivingEntity getNearByTarget(Player player, double range)
    {
        LivingEntity livingEntity = null;

        if (player != null) {
            for (Entity entity : player.getNearbyEntities(range, range, range)) {
                if (entity instanceof LivingEntity && isEntityWithinView(entity, player)) {
                    livingEntity = (LivingEntity) entity;
                    break;
                }
            }
        }

        return livingEntity;
    }

    private static boolean isEntityWithinView(Entity entity, Player player)
    {
        boolean withinView = true;

        double distance = player.getLocation().distance(entity.getLocation());
        BlockIterator blocks = new BlockIterator(player, (int) distance);

        while (blocks.hasNext()) {
            if (!TRANSPARENT_BLOCKS.contains(blocks.next().getType())) {
                withinView = false;
                break;
            }
        }

        return withinView;
    }

    public static void removeItemInHand(Player player)
    {
        if (player != null) {
            PlayerInventory inv = player.getInventory();
            ItemStack stack = player.getItemInHand();

            if (stack.getAmount() > 1) {
                stack.setAmount(stack.getAmount() - 1);
                inv.setItem(inv.getHeldItemSlot(), stack);
            }
            else {
                inv.setItem(inv.getHeldItemSlot(), null);
            }
        }
    }

    public static boolean hasNewAI(LivingEntity livingEntity)
    {
        return livingEntity != null && NEW_AI_MOBS.contains(livingEntity.getType());
    }

    public static boolean isAggressive(LivingEntity livingEntity)
    {
        return livingEntity != null && AGGRESSIVE_MOBS.contains(livingEntity.getType());
    }
}
 public final class MessageUtils
{
    private static final int HEALTH_BARS = 6;
    private static final int GOOD_HEALTH_THRESHOLD = 66;
    private static final int BAD_HEALTH_THRESHOLD = 33;

    private MessageUtils()
    {
    }

    public static void sendMessage(Rider rider, String suffix)
    {
        Player player = rider.getPlayer();
        LivingEntity ride = rider.getRide();

        if (player != null && ride != null && rider.getRideType() != null && !(ride instanceof HumanEntity)) {
            player.sendMessage("<" + getHealthString(rider) + "§e" + ride.getType().getName() + "§f> " + rider.getRideType().getNoise() + suffix);
        }
    }

    private static String getHealthString(Rider rider)
    {
        double percentHealth = (rider.getHealth() * 100) / rider.getMaxHealth();

        ChatColor barColor;

        if (percentHealth > GOOD_HEALTH_THRESHOLD) {
            barColor = ChatColor.GREEN;
        }
        else if (percentHealth > BAD_HEALTH_THRESHOLD) {
            barColor = ChatColor.GOLD;
        }
        else {
            barColor = ChatColor.RED;
        }

        StringBuilder healthString = new StringBuilder();
        double colorSwitch = Math.ceil((percentHealth / 100D) * HEALTH_BARS);

        for (int i = 0; i < HEALTH_BARS; i++) {
            ChatColor color = i < colorSwitch ? barColor : ChatColor.GRAY;
            healthString.append(color).append("|");
        }

        return healthString.toString();
    }
} public interface LivingEntitySearch
{
    LivingEntity find(Rider rider, String searchTerm, double searchRange);
} public interface LocationSearch
{
    boolean find(Rider rider, String locationName);
} public class Citizens2SearchStrategy extends AbstractLivingEntitySearchStrategy
{
    @Override
    public LivingEntity find(Rider rider, String searchTerm, double searchRange)
    {
        Player player = rider.getPlayer();
        LivingEntity foundEntity = null;

        if (DependencyUtils.hasCitizens2()) {
            Iterator<NPC> npcIterator = CitizensAPI.getNPCRegistry().iterator();
            while (npcIterator.hasNext()) {
                NPC npc = npcIterator.next();
                if (npc.getName().equalsIgnoreCase(searchTerm) && isEntityWithinRange(player, npc.getBukkitEntity(), searchRange)) {
                    foundEntity = npc.getBukkitEntity();
                }
            }
        }

        return foundEntity;
    }
} public class CitizensSearchStrategy extends AbstractLivingEntitySearchStrategy
{
    @Override
    public LivingEntity find(Rider rider, String searchTerm, double searchRange)
    {
        Player player = rider.getPlayer();
        LivingEntity foundEntity = null;

        if (DependencyUtils.hasCitizens()) {
            NPCList npcList = CitizensManager.getList();
            for (HumanNPC npc : npcList.values()) {
                if (npc.getName().equalsIgnoreCase(searchTerm) && isEntityWithinRange(player, npc.getPlayer(), searchRange)) {
                    foundEntity = npc.getPlayer();
                    break;
                }
            }
        }

        return foundEntity;
    }
} public class EntityIdSearchStrategy extends AbstractLivingEntitySearchStrategy
{
    @Override
    public LivingEntity find(Rider rider, String searchTerm, double searchRange)
    {
        Player player = rider.getPlayer();
        LivingEntity foundEntity = null;

        if (EntityUtils.isInteger(searchTerm)) {
            Entity entity = ((CraftWorld) player.getWorld()).getHandle().getEntity(Integer.valueOf(searchTerm));
            if (entity instanceof LivingEntity && isEntityWithinRange((LivingEntity) entity, player, searchRange)) {
                foundEntity = (LivingEntity) entity;
            }
        }

        return foundEntity;
    }
} public class FactionSearchStrategy extends AbstractLocationSearchStrategy
{
    @Override
    public boolean find(Rider rider, String factionTag)
    {
        boolean foundFaction = false;

        if (DependencyUtils.hasFactions()) {
            Faction faction = FactionColl.get().getByName(factionTag);
            if (faction != null) {
                rider.setGoal(new FactionGoal(faction));
                foundFaction = true;
            }
        }

        return foundFaction;
    }
} public class MobSearchStrategy extends AbstractLivingEntitySearchStrategy
{
    @Override
    public LivingEntity find(Rider rider, String searchTerm, double searchRange)
    {
        Player player = rider.getPlayer();
        LivingEntity foundEntity = null;

        LivingEntity ride = rider.getRide();
        if (ride != null) {
            double lastDistance = Double.MAX_VALUE;

            for (Entity entity : player.getNearbyEntities(2 * searchRange, 2 * searchRange, 2 * searchRange)) {

                if (entity instanceof LivingEntity) {
                    EntityType creatureType = entity.getType();

                    if (creatureType != null && creatureType.name().equalsIgnoreCase(searchTerm)) {
                        double entityDistance = player.getLocation().distanceSquared(entity.getLocation());

                        if (lastDistance > entityDistance && entity.getEntityId() != player.getEntityId() && entity.getEntityId() != ride.getEntityId()) {
                            lastDistance = entityDistance;
                            foundEntity = (LivingEntity) entity;
                        }
                    }
                }
            }
        }

        return foundEntity;
    }
} public class PlayerSearchStrategy extends AbstractLivingEntitySearchStrategy
{
    @Override
    public LivingEntity find(Rider rider, String searchTerm, double searchRange)
    {
        Player player = rider.getPlayer();
        LivingEntity foundEntity = null;

        Player foundPlayer = Bukkit.getPlayer(searchTerm);
        if (isEntityWithinRange(foundPlayer, player, searchRange)) {
            foundEntity = foundPlayer;
        }

        return foundEntity;
    }
} public class PortalSearchStrategy extends AbstractLocationSearchStrategy
{
    @Override
    public boolean find(Rider rider, String portalName)
    {
        boolean foundPortal = false;

        if (DependencyUtils.hasMultiverse()) {
            MVDestination portalTest = DependencyUtils.getMVDestinationFactory().getDestination("p:" + portalName);

            if (portalTest.getType().equals("Portal")) {
                Location portalLocation = portalTest.getLocation(null);
                if (portalLocation.getWorld().equals(rider.getWorld())) {
                    rider.setGoal(new LocationGoal(portalLocation));
                    foundPortal = true;
                }
            }
        }

        return foundPortal;
    }
} public class RegionSearchStrategy extends AbstractLocationSearchStrategy
{
    @Override
    public boolean find(Rider rider, String regionName)
    {
        boolean foundRegion = false;

        if (DependencyUtils.hasWorldGuard()) {
            ProtectedRegion region = DependencyUtils.getRegionManager(rider.getWorld()).getRegion(regionName);
            if (region != null) {
                rider.setGoal(new RegionGoal(region, rider.getWorld()));
                foundRegion = true;
            }
        }

        return foundRegion;
    }
} public class RegiosSearchStrategy extends AbstractLocationSearchStrategy
{
    @Override
    public boolean find(Rider rider, String regionName)
    {
        boolean foundRegion = false;

        if (DependencyUtils.hasRegios()) {
            Region region = DependencyUtils.getRegiosAPI().getRegion(regionName);
            if (region != null && region.getWorld().equals(rider.getWorld())) {
                rider.setGoal(new RegiosGoal(region, rider.getWorld()));
                foundRegion = true;
            }
        }

        return foundRegion;
    }
} public class ResidenceSearchStrategy extends AbstractLocationSearchStrategy
{
    @Override
    public boolean find(Rider rider, String residenceName)
    {
        boolean foundResidence = false;

        if (DependencyUtils.hasResidence()) {
            ClaimedResidence residence = Residence.getResidenceManager().getByName(residenceName);
            if (residence != null && residence.getWorld().equals(rider.getWorld().getName())) {
                rider.setGoal(new ResidenceGoal(residence));
                foundResidence = true;
            }
        }

        return foundResidence;
    }
} public class TownSearchStrategy extends AbstractLocationSearchStrategy
{
    @Override
    public boolean find(Rider rider, String townName)
    {
        boolean foundTown = false;

        if (DependencyUtils.hasTowny()) {
            for (Town town : TownyUniverse.getDataSource().getTowns()) {
                if (town.getName().equals(townName)) {
                    rider.setGoal(new TownyGoal(town));
                    foundTown = true;
                }
            }
        }

        return foundTown;
    }
} public class Rider
{
    private static final float MIN_SPEED = 0.05F;

    private String playerName;
    private Goal goal;
    private final float maxSpeed;
    private double speed;

    public Rider(String playerName)
    {
        this.playerName = playerName;
        LivingEntity ride = getRide();
        maxSpeed = ride != null && getRideType() != null ? RideType.fromType(ride.getType()).getMaxSpeed() : MIN_SPEED;
        speed = maxSpeed;
    }

    public Goal getGoal()
    {
        return goal;
    }

    public void setGoal(Goal goal)
    {
        this.goal = goal;
    }

    public double getSpeed()
    {
        return Math.min(maxSpeed, speed * getMaxHealth() / getHealth());
    }

    public void setSpeed(double speed)
    {
        this.speed = Math.max(Math.min(speed, maxSpeed), MIN_SPEED);
    }

    public LivingEntity getTarget()
    {
        LivingEntity target = null;
        LivingEntity ride = getRide();

        if (ride instanceof Creature) {
            target = ((Creature) ride).getTarget();
        }

        return target;
    }

    public void setTarget(LivingEntity target)
    {
        LivingEntity ride = getRide();

        if (ride != null) {
            if (ride instanceof CraftCreature) {
                if (EntityUtils.hasNewAI(ride)) {
                    ((CraftCreature) ride).getHandle().setGoalTarget(target instanceof CraftLivingEntity ? ((CraftLivingEntity) target).getHandle() : null);
                }
                else {
                    ((CraftCreature) ride).setTarget(target);
                }
            }
            else if (ride instanceof CraftSlime) {
                // TODO: implement setTarget for slime
                LoggerUtil.getInstance().debug("setTarget not implemented for Slime");
            }
            else if (ride instanceof CraftGhast) {
                // TODO: implement setTarget for ghast
                LoggerUtil.getInstance().debug("setTarget not implemented for Ghast");
            }
            else if (ride instanceof CraftEnderDragon) {
                // TODO: implement setTarget for enderdragon
                LoggerUtil.getInstance().debug("setTarget not implemented for EnderDragon");
            }
        }
    }

    public double getHealth()
    {
        double health = 0;
        LivingEntity ride = getRide();
        if (ride != null) {
            health = ride.getHealth();
        }
        return health;
    }

    public void setHealth(double health)
    {
        LivingEntity ride = getRide();

        if (ride != null) {
            ride.setHealth(health);
        }
    }

    public double getMaxHealth()
    {
        double maxHealth = 0;
        LivingEntity ride = getRide();

        if (ride != null) {
            maxHealth = ride.getMaxHealth();
        }
        return maxHealth;
    }

    public boolean isFullHealth()
    {
        LivingEntity ride = getRide();

        return ride == null || (ride.getHealth() >= ride.getMaxHealth());
    }

    public boolean isValid()
    {
        Player player = getPlayer();
        return hasRide(player) && !player.isDead();
    }

    public Player getPlayer()
    {
        Player player = null;
        try {
            player = Bukkit.getPlayer(playerName);
        }
        catch (Exception e) {
            // do nothing, really
        }
        return player;
    }

    public LivingEntity getRide()
    {
        Player player = getPlayer();
        LivingEntity ride = null;

        if (hasRide(player)) {
            ride = (LivingEntity) player.getVehicle();
        }

        return ride;
    }

    public RideType getRideType()
    {
        RideType rideType = null;
        LivingEntity ride = getRide();

        if (ride != null) {
            rideType = RideType.fromType(ride.getType());
        }

        return rideType;
    }

    public World getWorld()
    {
        World world = null;
        Player player = getPlayer();

        if (player != null) {
            world = player.getWorld();
        }

        return world;
    }

    public boolean hasWaterCreature()
    {
        return getRide() instanceof Squid;
    }

    public boolean hasGoal()
    {
        return goal != null;
    }

    private static boolean hasRide(Player player)
    {
        return player != null && player.getVehicle() instanceof LivingEntity;
    }
}

import java.util.ArrayList;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.util.Vector;
import com.edwardhand.mobrider.ConfigManager;
import com.edwardhand.mobrider.MobRider;
import com.edwardhand.mobrider.commons.EntityUtils;
import com.edwardhand.mobrider.commons.MessageUtils;
import com.edwardhand.mobrider.goals.search.LivingEntitySearch;
import com.edwardhand.mobrider.goals.search.LocationSearch;
import com.edwardhand.mobrider.goals.search.strategies.Citizens2SearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.CitizensSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.EntityIdSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.FactionSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.MobSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.PlayerSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.PortalSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.RegionSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.RegiosSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.ResidenceSearchStrategy;
import com.edwardhand.mobrider.goals.search.strategies.TownSearchStrategy;
import com.edwardhand.mobrider.rider.Rider;
/*
 * This file is part of MobRider.
 *
 * Copyright (c) 2011-2015, R. Ramos <http://github.com/mung3r/>
 * MobRider is licensed under the GNU Lesser General Public License.
 *
 * MobRider is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * MobRider is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.edwardhand.mobrider.goals;




public class GoalManager
{
    private ConfigManager configManager;
    private static final List<LivingEntitySearch> findEntityStrategies = new ArrayList<LivingEntitySearch>();
    private static final List<LocationSearch> findLocationStrategies = new ArrayList<LocationSearch>();

    static {
        findEntityStrategies.add(new EntityIdSearchStrategy());
        findEntityStrategies.add(new PlayerSearchStrategy());
        findEntityStrategies.add(new CitizensSearchStrategy());
        findEntityStrategies.add(new Citizens2SearchStrategy());
        findEntityStrategies.add(new MobSearchStrategy());

        findLocationStrategies.add(new PortalSearchStrategy());
        findLocationStrategies.add(new ResidenceSearchStrategy());
        findLocationStrategies.add(new RegionSearchStrategy());