Skip to content

Commit

Permalink
Fix issue when challenges are not saved in database after importing f…
Browse files Browse the repository at this point in the history
…rom web or default file set.
  • Loading branch information
BONNe committed May 26, 2020
1 parent 6203b92 commit 679fe48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public boolean loadDefaultChallenges(User user, World world)
return false;
}

this.addon.getChallengesManager().save();
this.addon.getChallengesManager().saveChallenges();
this.addon.getChallengesManager().saveLevels();

if (removeAtEnd)
{
Expand Down Expand Up @@ -203,7 +204,8 @@ public boolean loadDownloadedChallenges(User user, World world, String downloadS
return false;
}

this.addon.getChallengesManager().save();
this.addon.getChallengesManager().saveChallenges();
this.addon.getChallengesManager().saveLevels();

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public void save()
/**
* This method saves all challenges to database.
*/
private void saveChallenges()
public void saveChallenges()
{
this.challengeCacheData.values().forEach(this::saveChallenge);
}
Expand All @@ -880,7 +880,7 @@ public void saveChallenge(Challenge challenge)
/**
* This method saves all levels to database.
*/
private void saveLevels()
public void saveLevels()
{
this.levelCacheData.values().forEach(this::saveLevel);
}
Expand Down

0 comments on commit 679fe48

Please sign in to comment.