From 45dfc13ebdb89f6c761b144d355a1766b78a18e7 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Tue, 24 Sep 2013 11:40:53 +0200 Subject: [PATCH] Match playernames using OfflinePlayers instead Fixes #1482 --- src/main/java/com/gmail/nossr50/util/Misc.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index 27b570b60..26de7991b 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -8,6 +8,7 @@ import java.util.Random; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.Furnace; @@ -260,7 +261,9 @@ public final class Misc { public static List matchPlayer(String partialName) { List matchedPlayers = new ArrayList(); - for (String playerName : mcMMO.getDatabaseManager().getStoredUsers()) { + for (OfflinePlayer offlinePlayer : mcMMO.p.getServer().getOfflinePlayers()) { + String playerName = offlinePlayer.getName(); + if (partialName.equalsIgnoreCase(playerName)) { // Exact match matchedPlayers.clear();