Skip to content

Commit

Permalink
Implements Template reading.
Browse files Browse the repository at this point in the history
Add template loading via Admin Panel.
Improve LibraryPanel so it could find json and yml files.
  • Loading branch information
BONNe committed Sep 18, 2021
1 parent 535cde8 commit 2956553
Show file tree
Hide file tree
Showing 12 changed files with 1,515 additions and 669 deletions.
4 changes: 4 additions & 0 deletions src/main/java/world/bentobox/challenges/ChallengesAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ private void loadSettings() {
this.saveResource("panels/main_panel.yml", false);
this.saveResource("panels/multiple_panel.yml",false);
this.saveResource("panels/gamemode_panel.yml",false);

// Save template
this.saveResource("template.yml",false);
this.saveResource("default.json",false);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void setup()
@Override
public boolean execute(User user, String label, List<String> args)
{
return DefaultsCommand.this.addon.getImportManager().loadDefaultChallenges(user, this.getWorld());
DefaultsCommand.this.addon.getImportManager().loadDownloadedChallenges(user, this.getWorld(), "default");
return true;
}
}

Expand Down Expand Up @@ -135,10 +136,12 @@ public void setup()
@Override
public boolean execute(User user, String label, List<String> args)
{
return DefaultsCommand.this.addon.getImportManager().generateDefaultChallengeFile(
DefaultsCommand.this.addon.getImportManager().generateDatabaseFile(
user,
this.getWorld(),
!args.isEmpty() && args.get(0).equalsIgnoreCase("overwrite"));
"defaults");

return true;
}


Expand Down

0 comments on commit 2956553

Please sign in to comment.