diff --git a/lib/PhatLoots.jar b/lib/PhatLoots.jar index 64b16daad..a4cf2b6ca 100644 Binary files a/lib/PhatLoots.jar and b/lib/PhatLoots.jar differ diff --git a/pom.xml b/pom.xml index 122a2b9d0..749c86f4d 100644 --- a/pom.xml +++ b/pom.xml @@ -63,9 +63,9 @@ ${project.basedir}/lib/Heroes.jar - com.codisimus.phatloots + com.codisimus PhatLoots - 3.6.0 + 3.8.1 system ${project.basedir}/lib/PhatLoots.jar diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index a8dd28dce..6accdccf9 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -2935,6 +2935,8 @@ public class Quester { Inventory inv = Bukkit.getServer().createInventory(player, size, "Quests"); + + int inc = 0; for(int i = 0; i < quests.size(); i++) { diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index c47f82a00..a18a10ca3 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -262,14 +262,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, data.options().copyHeader(true); data.options().copyDefaults(true); try { - data.load(this.getResource("data.yml")); data.save(new File(this.getDataFolder(), "data.yml")); } catch (IOException e) { e.printStackTrace(); - } catch (InvalidConfigurationException e) { - e.printStackTrace(); } + } else { + loadData(); } getServer().getPluginManager().registerEvents(pListener, this); @@ -450,6 +449,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if(config.contains("npc-gui")) { List ids = config.getIntegerList("npc-gui"); + questNPCGUIs.clear(); questNPCGUIs.addAll(ids); } @@ -1799,8 +1799,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (citizens.getNPCRegistry().getById(i) == null) { cs.sendMessage(RED + "Error: There is no NPC with ID " + PURPLE + i); }else if (questNPCGUIs.contains(i)) { - questNPCGUIs.remove(i); - a + questNPCGUIs.remove(questNPCGUIs.indexOf(i)); + updateData(); + cs.sendMessage(PURPLE + citizens.getNPCRegistry().getById(i).getName() + YELLOW + " will no longer provide a GUI Quest Display."); + }else { + questNPCGUIs.add(i); + updateData(); + cs.sendMessage(PURPLE + citizens.getNPCRegistry().getById(i).getName() + YELLOW + " will now provide a GUI Quest Display."); } } catch (NumberFormatException nfe) { @@ -2073,6 +2078,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } } + + if (config.contains("quests." + s + ".guiDisplay")) { + + String item = config.getString("quests." + s + ".guiDisplay"); + quest.guiDisplay = ItemUtil.readItemStack(item); + + } if (config.contains("quests." + s + ".redo-delay")) { @@ -5081,22 +5093,24 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, public void updateData() { - aYamlConfiguration config = new YamlConfiguration(); + YamlConfiguration config = new YamlConfiguration(); File dataFile = new File(this.getDataFolder(), "data.yml"); try { config.load(dataFile); + config.set("npc-gui", questNPCGUIs); + config.save(dataFile); } catch (Exception e) { - e.printStackTrace(); + log.severe("[Quests] Unable to update data file."); + if(debug) { + log.severe("[Quests] Error log:"); + e.printStackTrace(); + }else { + log.severe("[Quests] Enable debug to view the error log."); + } + return; } - if(config.contains("npc-gui")) { - - List ids = config.getIntegerList("npc-gui"); - questNPCGUIs.addAll(ids); - - } - } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 555977391..8e444d530 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: Quests main: me.blackvein.quests.Quests -version: 1.8.1 +version: 1.8.2 description: Player questing system website: http://dev.bukkit.org/server-mods/quests/ dev-url: https://github.com/Blackvein/Quests/