Package net.citizensnpcs.guards.flags

Examples of net.citizensnpcs.guards.flags.FlagList


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();
  }
View Full Code Here


  private void loadFlags(Guard guard, int UID) {
    String root = UID + flag, path = root;
    if (!profiles.keyExists(root)) {
      return;
    }
    FlagList flags = guard.getFlags();
    for (String key : profiles.getKeys(root)) {
      path = root + "." + key;
      boolean isSafe = profiles.getBoolean(path + ".safe");
      int priority = profiles.getInt(path + ".priority");
      flags.addFlag(FlagType.parse(profiles.getString(path + ".type")),
          FlagInfo.newInstance(key, priority, isSafe));
    }
  }
View Full Code Here

        if (args.getFlags().isEmpty()) {
            Messaging.sendError(player, "No flag specified.");
            return;
        }
        Guard guard = npc.getType("guard");
        FlagList flagList = guard.getFlags();
        Map<String, FlagInfo> flags;
        String header = npc.getName() + "'s ";
        if (args.hasFlag('g')) {
            flags = flagList.getFlags(FlagType.GROUP);
            header += "Group Flags";
        } else if (args.hasFlag('m')) {
            flags = flagList.getFlags(FlagType.MOB);
            header += "Mob Flags";
        } else if (args.hasFlag('p')) {
            flags = flagList.getFlags(FlagType.PLAYER);
            header += "Player Flags";
        } else {
            Messaging.sendError(player, "Specified flag not found.");
            return;
        }
View Full Code Here

TOP

Related Classes of net.citizensnpcs.guards.flags.FlagList

Copyright © 2018 www.massapicom. 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.