diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-12-12 16:39:15 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-12-12 16:39:15 +0000 |
commit | 0e0b441168667950d7bc85155ddcf634b2ab5017 (patch) | |
tree | 426de32ce6925aa54f81c0e997dd314fdacc4518 /EssentialsGroupManager/src/org/anjocaido/groupmanager | |
parent | aaf08150e679976dafe65f9a86835411c1fdbcab (diff) | |
download | Essentials-0e0b441168667950d7bc85155ddcf634b2ab5017.tar Essentials-0e0b441168667950d7bc85155ddcf634b2ab5017.tar.gz Essentials-0e0b441168667950d7bc85155ddcf634b2ab5017.tar.lz Essentials-0e0b441168667950d7bc85155ddcf634b2ab5017.tar.xz Essentials-0e0b441168667950d7bc85155ddcf634b2ab5017.zip |
Offline player checks now support partial name matches.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index e13426716..37131f888 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1800,9 +1800,16 @@ public class GroupManager extends JavaPlugin { players = this.getServer().matchPlayer(playerName); if (players.isEmpty()) { - // Check for an offline player. - if (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) + // Check for an offline player (exact match). + if (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) { match.add(playerName); + } else { + //look for partial matches + for (OfflinePlayer offline : this.getServer().getOfflinePlayers()) { + if (offline.getName().toLowerCase().startsWith(playerName.toLowerCase())) + match.add(offline.getName()); + } + } } else { for (Player player : players) { |