mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-02-26 17:21:47 +01:00
Fix LevelListRequestHandler.
This handler did not return list of strings but list of challenge levels, that is incorrect. Not it should work correctly.
This commit is contained in:
parent
e75d13666e
commit
4cae1ed267
@ -1725,6 +1725,23 @@ public class ChallengesManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method returns list of challenge levels in given gameMode.
|
||||||
|
* @param world for which levels must be searched.
|
||||||
|
* @return List with challengeLevel uniqueIds in given world.
|
||||||
|
*/
|
||||||
|
public List<String> getLevelNames(@NonNull World world)
|
||||||
|
{
|
||||||
|
return this.islandWorldManager.getAddon(world).map(gameMode ->
|
||||||
|
this.levelCacheData.values().stream().
|
||||||
|
sorted(ChallengeLevel::compareTo).
|
||||||
|
filter(level -> level.matchGameMode(gameMode.getDescription().getName())).
|
||||||
|
map(ChallengeLevel::getUniqueId).
|
||||||
|
collect(Collectors.toList())).
|
||||||
|
orElse(Collections.emptyList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get challenge level by its challenge.
|
* Get challenge level by its challenge.
|
||||||
*
|
*
|
||||||
|
@ -52,7 +52,8 @@ public class LevelListRequestHandler extends AddonRequestHandler
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.addon.getChallengesManager().getLevels(Bukkit.getWorld((String) metaData.get("world-name")));
|
return this.addon.getChallengesManager().getLevelNames(
|
||||||
|
Bukkit.getWorld((String) metaData.get("world-name")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user