-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or requestreworkImprovements and changes of an already existing featureImprovements and changes of an already existing feature
Description
like the todo from cinna said.
Plot-System/src/main/java/com/alpsbte/plotsystem/core/menus/companion/CompanionMenu.java
Lines 48 to 72 in 57b021e
| public static boolean hasContinentView() { | |
| // TODO: make this run async | |
| return Arrays.stream(Continent.values()).map(continent -> DataProvider.COUNTRY.getCountriesByContinent(continent).size()).filter(count -> count > 0).count() > 1; | |
| } | |
| /** | |
| * Determine what menu to open for the player | |
| * | |
| * @param player player to open the menu for | |
| */ | |
| public static void open(Player player) { | |
| if (hasContinentView()) { | |
| new ContinentMenu(player); | |
| } else { | |
| // TODO: make this run async | |
| Optional<Continent> continent = Arrays.stream(Continent.values()).filter(c -> !DataProvider.COUNTRY.getCountriesByContinent(c).isEmpty()).findFirst(); | |
| if (continent.isEmpty()) { | |
| player.sendMessage(Utils.ChatUtils.getAlertFormat(LangUtil.getInstance().get(player, LangPaths.Message.Error.ERROR_OCCURRED))); | |
| return; | |
| } | |
| new CountryMenu(player, continent.get()); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestreworkImprovements and changes of an already existing featureImprovements and changes of an already existing feature