mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 11:38:42 +01:00
Check for illegal data when using /quests top, fixes #91
This commit is contained in:
parent
7f9eb50252
commit
b0301fa2ce
@ -1337,8 +1337,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
for (String s : sortedMap.keySet()) {
|
||||
int i = (Integer) sortedMap.get(s);
|
||||
s = s.trim();
|
||||
UUID id = UUID.fromString(s);
|
||||
s = Bukkit.getOfflinePlayer(id).getName();
|
||||
try {
|
||||
UUID id = UUID.fromString(s);
|
||||
s = Bukkit.getOfflinePlayer(id).getName();
|
||||
} catch (IllegalArgumentException e) {
|
||||
getLogger().warning("Invalid file name \"" + s + "\"in /data folder. Replace with player UUID"
|
||||
+ " or start the plugin with the \"convert-data-on-startup\" enabled in config.yml");
|
||||
break;
|
||||
}
|
||||
numPrinted++;
|
||||
cs.sendMessage(ChatColor.YELLOW + String.valueOf(numPrinted) + ". " + s + " - " + ChatColor.DARK_PURPLE + i + ChatColor.YELLOW + " " + Lang.get("questPoints"));
|
||||
if (numPrinted == topNumber) {
|
||||
|
Loading…
Reference in New Issue
Block a user