summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2011-12-12 16:39:15 +0000
committerElgarL <ElgarL@palmergames.com>2011-12-12 16:39:15 +0000
commit0e0b441168667950d7bc85155ddcf634b2ab5017 (patch)
tree426de32ce6925aa54f81c0e997dd314fdacc4518 /EssentialsGroupManager
parentaaf08150e679976dafe65f9a86835411c1fdbcab (diff)
downloadEssentials-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')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java11
2 files changed, 11 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index a5c455887..00df6628d 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -81,4 +81,5 @@ v 1.6:
- Optimizations include changing the return of comparePermissionString.
- Added file details in error messages for loading groups/users.
v 1.7:
- - GM now supports offline players without having to mantogglevalidate \ No newline at end of file
+ - GM now supports offline players without having to mantogglevalidate
+ - Offline player checks now support partial name matches. \ No newline at end of file
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) {