Exemplo n.º 1
0
 @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;
 }
Exemplo n.º 2
0
 @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;
 }
Exemplo n.º 3
0
 @Override
 public Player[] getOnlinePlayers() {
   return players.toArray(new Player[0]);
 }
Exemplo n.º 4
0
 public void addPlayer(Player base1) {
   players.add(base1);
 }
Exemplo n.º 5
0
 public World createWorld(String string, Environment e, long l) {
   World w = new FakeWorld(string, e);
   worlds.add(w);
   return w;
 }