mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-28 05:35:33 +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()) {
|
for (String s : sortedMap.keySet()) {
|
||||||
int i = (Integer) sortedMap.get(s);
|
int i = (Integer) sortedMap.get(s);
|
||||||
s = s.trim();
|
s = s.trim();
|
||||||
UUID id = UUID.fromString(s);
|
try {
|
||||||
s = Bukkit.getOfflinePlayer(id).getName();
|
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++;
|
numPrinted++;
|
||||||
cs.sendMessage(ChatColor.YELLOW + String.valueOf(numPrinted) + ". " + s + " - " + ChatColor.DARK_PURPLE + i + ChatColor.YELLOW + " " + Lang.get("questPoints"));
|
cs.sendMessage(ChatColor.YELLOW + String.valueOf(numPrinted) + ". " + s + " - " + ChatColor.DARK_PURPLE + i + ChatColor.YELLOW + " " + Lang.get("questPoints"));
|
||||||
if (numPrinted == topNumber) {
|
if (numPrinted == topNumber) {
|
||||||
|
Loading…
Reference in New Issue
Block a user