mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-01-30 20:11:33 +01:00
Fix issue when Levels were not loaded with world name in unique ID.
Fix crash that appears after renaming Level to Other challenge type.
This commit is contained in:
parent
bf22a50124
commit
9c4c5b7d86
@ -83,7 +83,7 @@ public class ChallengesImportManager
|
|||||||
for (String level : lvs) {
|
for (String level : lvs) {
|
||||||
ChallengeLevel challengeLevel = new ChallengeLevel();
|
ChallengeLevel challengeLevel = new ChallengeLevel();
|
||||||
challengeLevel.setFriendlyName(level);
|
challengeLevel.setFriendlyName(level);
|
||||||
challengeLevel.setUniqueId(level);
|
challengeLevel.setUniqueId(Util.getWorld(world).getName() + "_" + level);
|
||||||
challengeLevel.setOrder(order++);
|
challengeLevel.setOrder(order++);
|
||||||
challengeLevel.setWorld(Util.getWorld(world).getName());
|
challengeLevel.setWorld(Util.getWorld(world).getName());
|
||||||
challengeLevel.setWaiverAmount(chal.getInt("challenges.waiveramount"));
|
challengeLevel.setWaiverAmount(chal.getInt("challenges.waiveramount"));
|
||||||
@ -120,7 +120,17 @@ public class ChallengesImportManager
|
|||||||
newChallenge.setFriendlyName(details.getString("friendlyname", challenge));
|
newChallenge.setFriendlyName(details.getString("friendlyname", challenge));
|
||||||
newChallenge.setDescription(GuiUtils.stringSplit(details.getString("description", "")));
|
newChallenge.setDescription(GuiUtils.stringSplit(details.getString("description", "")));
|
||||||
newChallenge.setIcon(ItemParser.parse(details.getString("icon") + ":1"));
|
newChallenge.setIcon(ItemParser.parse(details.getString("icon") + ":1"));
|
||||||
|
|
||||||
|
if (details.getString("type").equalsIgnoreCase("level"))
|
||||||
|
{
|
||||||
|
// Fix for older version config
|
||||||
|
newChallenge.setChallengeType(Challenge.ChallengeType.OTHER);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
newChallenge.setChallengeType(Challenge.ChallengeType.valueOf(details.getString("type","INVENTORY").toUpperCase()));
|
newChallenge.setChallengeType(Challenge.ChallengeType.valueOf(details.getString("type","INVENTORY").toUpperCase()));
|
||||||
|
}
|
||||||
|
|
||||||
newChallenge.setTakeItems(details.getBoolean("takeItems",true));
|
newChallenge.setTakeItems(details.getBoolean("takeItems",true));
|
||||||
newChallenge.setRewardText(details.getString("rewardText", ""));
|
newChallenge.setRewardText(details.getString("rewardText", ""));
|
||||||
newChallenge.setRewardCommands(details.getStringList("rewardcommands"));
|
newChallenge.setRewardCommands(details.getStringList("rewardcommands"));
|
||||||
|
Loading…
Reference in New Issue
Block a user