Skip to content

Commit

Permalink
Rework ChallengesManager.
Browse files Browse the repository at this point in the history
Implement all methods that were only placeholders.
Remove all unnecessary old methods.
Implement new methods in all classes.

User and Admin command now opens new GUI.
  • Loading branch information
BONNe committed Jan 23, 2019
1 parent 1bc6bb2 commit 590b3f1
Show file tree
Hide file tree
Showing 21 changed files with 974 additions and 673 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void makeLevels(User user, World world, boolean overwrite) {
challengeLevel.setRewardExperience(unlock.getInt("expReward"));
challengeLevel.setRewardCommands(unlock.getStringList("commands"));
}
addon.getChallengesManager().storeLevel(challengeLevel);
addon.getChallengesManager().loadLevel(challengeLevel, overwrite, user, false);
}
} else {
user.sendMessage("challenges.admin.import.no-levels");
Expand All @@ -118,7 +118,7 @@ private void makeChallenges(User user, World world, boolean overwrite) {
newChallenge.setDeployed(true);
ConfigurationSection details = chals.getConfigurationSection(challenge);
newChallenge.setFriendlyName(details.getString("friendlyname", challenge));
newChallenge.setDescription(addon.getChallengesManager().stringSplit(details.getString("description", "")));
newChallenge.setDescription(GuiUtils.stringSplit(details.getString("description", "")));
newChallenge.setIcon(ItemParser.parse(details.getString("icon") + ":1"));
newChallenge.setChallengeType(Challenge.ChallengeType.valueOf(details.getString("type","INVENTORY").toUpperCase()));
newChallenge.setTakeItems(details.getBoolean("takeItems",true));
Expand Down Expand Up @@ -149,7 +149,7 @@ private void makeChallenges(User user, World world, boolean overwrite) {
this.addon.getChallengesManager().addChallengeToLevel(newChallenge,
addon.getChallengesManager().getLevel(Util.getWorld(world).getName() + "_" + details.getString("level")));

if (addon.getChallengesManager().storeChallenge(newChallenge, overwrite, user, false)) {
if (addon.getChallengesManager().loadChallenge(newChallenge, overwrite, user, false)) {
size++;
}
}
Expand Down

0 comments on commit 590b3f1

Please sign in to comment.