From 679fe488711b2da066fddcd976991fc009206a68 Mon Sep 17 00:00:00 2001 From: BONNe Date: Tue, 26 May 2020 10:19:32 +0300 Subject: [PATCH] Fix issue when challenges are not saved in database after importing from web or default file set. --- .../world/bentobox/challenges/ChallengesImportManager.java | 6 ++++-- .../java/world/bentobox/challenges/ChallengesManager.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/ChallengesImportManager.java b/src/main/java/world/bentobox/challenges/ChallengesImportManager.java index e0feb65..36b5655 100644 --- a/src/main/java/world/bentobox/challenges/ChallengesImportManager.java +++ b/src/main/java/world/bentobox/challenges/ChallengesImportManager.java @@ -126,7 +126,8 @@ public class ChallengesImportManager return false; } - this.addon.getChallengesManager().save(); + this.addon.getChallengesManager().saveChallenges(); + this.addon.getChallengesManager().saveLevels(); if (removeAtEnd) { @@ -203,7 +204,8 @@ public class ChallengesImportManager return false; } - this.addon.getChallengesManager().save(); + this.addon.getChallengesManager().saveChallenges(); + this.addon.getChallengesManager().saveLevels(); return true; } diff --git a/src/main/java/world/bentobox/challenges/ChallengesManager.java b/src/main/java/world/bentobox/challenges/ChallengesManager.java index c2e8af1..e3e72db 100644 --- a/src/main/java/world/bentobox/challenges/ChallengesManager.java +++ b/src/main/java/world/bentobox/challenges/ChallengesManager.java @@ -861,7 +861,7 @@ public class ChallengesManager /** * This method saves all challenges to database. */ - private void saveChallenges() + public void saveChallenges() { this.challengeCacheData.values().forEach(this::saveChallenge); } @@ -880,7 +880,7 @@ public class ChallengesManager /** * This method saves all levels to database. */ - private void saveLevels() + public void saveLevels() { this.levelCacheData.values().forEach(this::saveLevel); }