Finished GUI Display

Updated libraries
This commit is contained in:
Blackvein 2014-05-14 18:43:25 -07:00
parent cbb9638d64
commit 0fbcc75cbf
5 changed files with 33 additions and 17 deletions

Binary file not shown.

View File

@ -63,9 +63,9 @@
<systemPath>${project.basedir}/lib/Heroes.jar</systemPath>
</dependency>
<dependency>
<groupId>com.codisimus.phatloots</groupId>
<groupId>com.codisimus</groupId>
<artifactId>PhatLoots</artifactId>
<version>3.6.0</version>
<version>3.8.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PhatLoots.jar</systemPath>
</dependency>

View File

@ -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++) {

View File

@ -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<Integer> 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) {
@ -2074,6 +2079,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")) {
if (config.getInt("quests." + s + ".redo-delay", -999) != -999) {
@ -5081,20 +5093,22 @@ 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();
}
if(config.contains("npc-gui")) {
List<Integer> ids = config.getIntegerList("npc-gui");
questNPCGUIs.addAll(ids);
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;
}
}

View File

@ -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/