summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
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) {