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