summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorfatpigsarefat <fatpigsarefat@outlook.com>2018-06-24 21:31:31 +0100
committerfatpigsarefat <fatpigsarefat@outlook.com>2018-06-24 21:31:31 +0100
commit97c8bfe67b2ad814c655ba7bca3927b98f39c187 (patch)
tree962b2e16f8a5fdf34ddb9e6af6c85e092e31bbc1 /src
parente51ae277e7b07418b6ad44aaf257b61c72d3dc4a (diff)
Might have fixed a bug. Not sure (could never recreate it). Closes #18
Diffstat (limited to 'src')
-rw-r--r--src/me/fatpigsarefat/quests/player/QPlayerManager.java42
-rw-r--r--src/plugin.yml2
2 files changed, 24 insertions, 20 deletions
diff --git a/src/me/fatpigsarefat/quests/player/QPlayerManager.java b/src/me/fatpigsarefat/quests/player/QPlayerManager.java
index e463d338..29c6f01a 100644
--- a/src/me/fatpigsarefat/quests/player/QPlayerManager.java
+++ b/src/me/fatpigsarefat/quests/player/QPlayerManager.java
@@ -37,32 +37,36 @@ public class QPlayerManager {
if (getPlayer(uuid) == null || getPlayer(uuid).isOnlyDataLoaded()) {
QuestProgressFile questProgressFile = new QuestProgressFile(uuid);
- File directory = new File(Quests.getInstance().getDataFolder() + File.separator + "playerdata");
- if (directory.exists() && directory.isDirectory()) {
- File file = new File(Quests.getInstance().getDataFolder() + File.separator + "playerdata" + File.separator + uuid.toString() + ".yml");
- if (file.exists()) {
- YamlConfiguration data = YamlConfiguration.loadConfiguration(file);
- if (data.contains("quest-progress")) {
- for (String id : data.getConfigurationSection("quest-progress").getKeys(false)) {
- boolean started = data.getBoolean("quest-progress." + id + ".started");
- boolean completed = data.getBoolean("quest-progress." + id + ".completed");
- boolean completedBefore = data.getBoolean("quest-progress." + id + ".completed-before");
- long completionDate = data.getLong("quest-progress." + id + ".completion-date");
+ try {
+ File directory = new File(Quests.getInstance().getDataFolder() + File.separator + "playerdata");
+ if (directory.exists() && directory.isDirectory()) {
+ File file = new File(Quests.getInstance().getDataFolder() + File.separator + "playerdata" + File.separator + uuid.toString() + ".yml");
+ if (file.exists()) {
+ YamlConfiguration data = YamlConfiguration.loadConfiguration(file);
+ if (data.contains("quest-progress")) {
+ for (String id : data.getConfigurationSection("quest-progress").getKeys(false)) {
+ boolean started = data.getBoolean("quest-progress." + id + ".started");
+ boolean completed = data.getBoolean("quest-progress." + id + ".completed");
+ boolean completedBefore = data.getBoolean("quest-progress." + id + ".completed-before");
+ long completionDate = data.getLong("quest-progress." + id + ".completion-date");
- QuestProgress questProgress = new QuestProgress(id, completed, completedBefore, completionDate, uuid, started, true);
+ QuestProgress questProgress = new QuestProgress(id, completed, completedBefore, completionDate, uuid, started, true);
- for (String taskid : data.getConfigurationSection("quest-progress." + id + ".task-progress").getKeys(false)) {
- boolean taskCompleted = data.getBoolean("quest-progress." + id + ".task-progress." + taskid + ".completed");
- Object taskProgression = data.get("quest-progress." + id + ".task-progress." + taskid + ".progress");
+ for (String taskid : data.getConfigurationSection("quest-progress." + id + ".task-progress").getKeys(false)) {
+ boolean taskCompleted = data.getBoolean("quest-progress." + id + ".task-progress." + taskid + ".completed");
+ Object taskProgression = data.get("quest-progress." + id + ".task-progress." + taskid + ".progress");
- TaskProgress taskProgress = new TaskProgress(taskid, taskProgression, uuid, taskCompleted);
- questProgress.addTaskProgress(taskProgress);
- }
+ TaskProgress taskProgress = new TaskProgress(taskid, taskProgression, uuid, taskCompleted);
+ questProgress.addTaskProgress(taskProgress);
+ }
- questProgressFile.addQuestProgress(questProgress);
+ questProgressFile.addQuestProgress(questProgress);
+ }
}
}
}
+ } catch (Exception ignored) {
+ // fuck
}
QPlayer qPlayer = new QPlayer(uuid, questProgressFile, onlyData);
diff --git a/src/plugin.yml b/src/plugin.yml
index fc55db22..83d7c268 100644
--- a/src/plugin.yml
+++ b/src/plugin.yml
@@ -1,5 +1,5 @@
name: Quests
-version: 2.0.9-beta
+version: 2.0.10-beta
main: me.fatpigsarefat.quests.Quests
author: fatpigsarefat
softdepend: [ASkyBlock, uSkyBlock]