Package net.citizensnpcs.guards

Source Code of net.citizensnpcs.guards.Targeter

package net.citizensnpcs.guards;

import java.util.List;

import net.citizensnpcs.guards.flags.FlagList;
import net.citizensnpcs.resources.npclib.HumanNPC;

import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;

public class Targeter {
  public static LivingEntity findTarget(List<Entity> possible, HumanNPC npc) {
    FlagList flags = ((Guard) npc.getType("guard")).getFlags();
    flags.processEntities(npc.getLocation(), possible);
    return flags.getResult();
  }

  public static List<Entity> getNearby(Entity entity, double range) {
    return entity.getNearbyEntities(range / 2, range, range / 2);
  }
}
TOP

Related Classes of net.citizensnpcs.guards.Targeter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.