diff --git a/TheButtonAutoFlair.jar b/TheButtonAutoFlair.jar index 2a72cd7..349b812 100644 Binary files a/TheButtonAutoFlair.jar and b/TheButtonAutoFlair.jar differ diff --git a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class index a567bfd..3ff99d2 100644 Binary files a/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class and b/TheButtonAutoFlair/bin/tk/sznp/thebuttonautoflair/Commands.class differ diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java index 7cb4e9b..6ef6608 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java @@ -456,6 +456,7 @@ public class Commands implements CommandExecutor { } } + @SuppressWarnings("unused") private static void DoSaveLoadPos(Player player, String[] args) { // 2015.08.09. // args[0] is "admin" - args[1] is "savepos|loadpos" if (args.length == 2) { @@ -463,25 +464,22 @@ public class Commands implements CommandExecutor { SendMessage(player, message); return; } - if (!MaybeOfflinePlayer.AllPlayers.containsKey(args[2])) { + Player p = null; + try { + p = Bukkit.getPlayer(args[2]); + } catch (Exception e) { + } + if (!MaybeOfflinePlayer.AllPlayers.containsKey(p.getUniqueId())) { String message = "§cPlayer not found: " + args[2] + "§r"; SendMessage(player, message); return; } - MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(args[2]); - Player p = null; - for (Player pl : PluginMain.GetPlayers()) { - if (pl.getName().equals(args[2])) { - p = pl; - break; - } - } + MaybeOfflinePlayer mp = MaybeOfflinePlayer.AllPlayers.get(p + .getUniqueId()); if (p == null) { - if (!MaybeOfflinePlayer.AllPlayers.containsKey(args[2])) { - String message = "§cPlayer is not online: " + args[2] + "§r"; - SendMessage(player, message); - return; - } + String message = "§cPlayer is not online: " + args[2] + "§r"; + SendMessage(player, message); + return; } if (args[1].equalsIgnoreCase("savepos")) { mp.SavedLocation = p.getLocation();