Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Changes -> Added setup finished message if no bedrock backend exist
Browse files Browse the repository at this point in the history
  • Loading branch information
EinfacheSache committed Sep 19, 2023
1 parent b4a5345 commit d235b03
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,17 @@ private void setJavaBackend(String[] args) {
private void bedrockBackendSelector() {
List<Backend> backendList = instance.getCore().getRestAPI().getBackends();

if(backendList.stream().noneMatch(Backend::isGeyser))return;

instance.sendMessage(sender, localization.get(locale, "select.backend", "geyser"));

for (Backend backend : backendList) {
if(!backend.isGeyser())continue;
instance.sendMessage(sender, "§5" + backend.getIp() + ":" + backend.getPort() + localization.get(locale, "utils.click"),
"RUN_COMMAND", "/np setgeyserbackend " + backend.getId(),
"SHOW_TEXT", localization.get(locale, "hover.backend", backend.getIp(), backend.getPort(), backend.getId()));
if(backendList.stream().anyMatch(Backend::isGeyser)) {
instance.sendMessage(sender, localization.get(locale, "select.backend", "geyser"));

for (Backend backend : backendList) {
if (!backend.isGeyser()) continue;
instance.sendMessage(sender, "§5" + backend.getIp() + ":" + backend.getPort() + localization.get(locale, "utils.click"),
"RUN_COMMAND", "/np setgeyserbackend " + backend.getId(),
"SHOW_TEXT", localization.get(locale, "hover.backend", backend.getIp(), backend.getPort(), backend.getId()));
}
}else if (instance.getCore().getPlayerInSetup().remove(sender)) {
instance.sendMessage(sender, localization.get(locale, "setup.finished"));
}
}

Expand All @@ -515,7 +517,6 @@ private void setBedrockBackend(String[] args) {
if (instance.getCore().getPlayerInSetup().remove(sender)) {
instance.sendMessage(sender, localization.get(locale, "setup.finished"));
}

}

private void showHelp() {
Expand Down

0 comments on commit d235b03

Please sign in to comment.