summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java11
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) {