From ac899a7c8c96d6bf89a3bde060d0b08d5c47e851 Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Fri, 20 Apr 2018 10:42:23 -0400 Subject: [PATCH] Ignore directories with /quests top, fixes #373 --- src/main/java/me/blackvein/quests/Quests.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index 6ee503b11..315f5b241 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -1401,16 +1401,18 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener Map questPoints = new HashMap(); if (playerFiles != null) { for (File f : playerFiles) { - FileConfiguration data = new YamlConfiguration(); - try { - data.load(f); - } catch (IOException e) { - e.printStackTrace(); - } catch (InvalidConfigurationException e) { - e.printStackTrace(); + if (!f.isDirectory()) { + FileConfiguration data = new YamlConfiguration(); + try { + data.load(f); + } catch (IOException e) { + e.printStackTrace(); + } catch (InvalidConfigurationException e) { + e.printStackTrace(); + } + String name = f.getName().substring(0, (f.getName().indexOf("."))); + questPoints.put(name, data.getInt("quest-points")); } - String name = f.getName().substring(0, (f.getName().indexOf("."))); - questPoints.put(name, data.getInt("quest-points")); } } LinkedHashMap sortedMap = (LinkedHashMap) Quests.sort(questPoints);