mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-23 01:27:35 +01:00
Finished GUI Display
Updated libraries
This commit is contained in:
parent
cbb9638d64
commit
0fbcc75cbf
Binary file not shown.
4
pom.xml
4
pom.xml
@ -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>
|
||||
|
@ -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++) {
|
||||
|
||||
|
@ -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) {
|
||||
@ -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<Integer> ids = config.getIntegerList("npc-gui");
|
||||
questNPCGUIs.addAll(ids);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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/
|
||||
|
Loading…
Reference in New Issue
Block a user