示例#1
0
 @Override
 public Set<OfflinePlayer> getOperators() {
   Set<OfflinePlayer> offlinePlayers = new HashSet<>();
   for (UUID uuid : opsList.getUUIDs()) {
     offlinePlayers.add(getOfflinePlayer(uuid));
   }
   return offlinePlayers;
 }
示例#2
0
 @Override
 public Set<String> getIPBans() {
   Set<String> result = new HashSet<>();
   for (BanEntry entry : ipBans.getBanEntries()) {
     result.add(entry.getTarget());
   }
   return result;
 }
示例#3
0
 @Override
 public Set<OfflinePlayer> getBannedPlayers() {
   Set<OfflinePlayer> bannedPlayers = new HashSet<>();
   for (BanEntry entry : nameBans.getBanEntries()) {
     bannedPlayers.add(getOfflinePlayer(entry.getTarget()));
   }
   return bannedPlayers;
 }
示例#4
0
 @Override
 public Set<OfflinePlayer> getWhitelistedPlayers() {
   Set<OfflinePlayer> players = new HashSet<>();
   for (UUID uuid : whitelist.getUUIDs()) {
     players.add(getOfflinePlayer(uuid));
   }
   return players;
 }
示例#5
0
  @Override
  public OfflinePlayer[] getOfflinePlayers() {
    Set<OfflinePlayer> result = new HashSet<>();
    Set<UUID> uuids = new HashSet<>();

    // add the currently online players
    for (World world : getWorlds()) {
      for (Player player : world.getPlayers()) {
        result.add(player);
        uuids.add(player.getUniqueId());
      }
    }

    // add all offline players that aren't already online
    for (OfflinePlayer offline : getPlayerDataService().getOfflinePlayers()) {
      if (!uuids.contains(offline.getUniqueId())) {
        result.add(offline);
        uuids.add(offline.getUniqueId());
      }
    }

    return result.toArray(new OfflinePlayer[result.size()]);
  }
示例#6
0
  /**
   * Gets player within range.
   *
   * @param location the centre of the range
   * @param radius the radius of the range
   * @return a set of Bukkit player objects
   */
  public static Set<Player> getNearbyPlayers(Location location, double radius) {
    Set<Player> playerList = new HashSet<Player>();
    World locWorld = location.getWorld();
    radius *= radius;

    for (Player p : Bukkit.getServer().getOnlinePlayers()) {
      if (p.getWorld().equals(locWorld)) {
        if (p.getLocation().distanceSquared(location) <= radius) {
          playerList.add(p);
        }
      }
    }

    return playerList;
  }
示例#7
0
 @Override
 public void addPermission(Permission prmsn) {
   permissions.add(prmsn);
 }
示例#8
0
 public void logOnce(String error_id, String msg) {
   if (log_once.contains(error_id)) return;
   log_once.add(error_id);
   log.info(ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', px + msg)));
 }
示例#9
0
文件: Conf.java 项目: Tovex/Factions
  static {
    territoryProtectedMaterials.add(Material.WOODEN_DOOR);
    territoryProtectedMaterials.add(Material.TRAP_DOOR);
    territoryProtectedMaterials.add(Material.DISPENSER);
    territoryProtectedMaterials.add(Material.CHEST);
    territoryProtectedMaterials.add(Material.FURNACE);

    territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);
    territoryDenyUseageMaterials.add(Material.BUCKET);
    territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
    territoryDenyUseageMaterials.add(Material.LAVA_BUCKET);

    territoryProtectedMaterialsWhenOffline.add(Material.WOODEN_DOOR);
    territoryProtectedMaterialsWhenOffline.add(Material.TRAP_DOOR);
    territoryProtectedMaterialsWhenOffline.add(Material.DISPENSER);
    territoryProtectedMaterialsWhenOffline.add(Material.CHEST);
    territoryProtectedMaterialsWhenOffline.add(Material.FURNACE);

    territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
    territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
    territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
    territoryDenyUseageMaterialsWhenOffline.add(Material.LAVA_BUCKET);

    safeZoneNerfedCreatureTypes.add(CreatureType.CREEPER);
    safeZoneNerfedCreatureTypes.add(CreatureType.GHAST);
    safeZoneNerfedCreatureTypes.add(CreatureType.PIG_ZOMBIE);
    safeZoneNerfedCreatureTypes.add(CreatureType.SKELETON);
    safeZoneNerfedCreatureTypes.add(CreatureType.SPIDER);
    safeZoneNerfedCreatureTypes.add(CreatureType.SLIME);
    safeZoneNerfedCreatureTypes.add(CreatureType.ZOMBIE);
  }