@Override public List<Player> matchPlayer(String string) { List<Player> matches = new ArrayList<Player>(); for (Player player : players) { if (player .getName() .substring(0, Math.min(player.getName().length(), string.length())) .equalsIgnoreCase(string)) { matches.add(player); } } return matches; }
@Override public Map<String, String[]> getCommandAliases() { Map<String, String[]> aliases = new HashMap<>(); ConfigurationSection section = config.getConfigFile(ServerConfig.Key.COMMANDS_FILE).getConfigurationSection("aliases"); if (section == null) { return aliases; } for (String key : section.getKeys(false)) { List<String> list = section.getStringList(key); aliases.put(key, list.toArray(new String[list.size()])); } return aliases; }
@Override public Player[] getOnlinePlayers() { return players.toArray(new Player[0]); }
public void addPlayer(Player base1) { players.add(base1); }
public World createWorld(String string, Environment e, long l) { World w = new FakeWorld(string, e); worlds.add(w); return w; }