From 3db61577b09bebc31d9656a4a661b3ef15851bc2 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 19 Aug 2023 13:28:26 +0200 Subject: [PATCH] Async builder deploy Signed-off-by: Lixfel --- .../steamwar/bungeecore/commands/BuilderCloudCommand.java | 8 ++++++-- src/de/steamwar/messages/BungeeCore.properties | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/BuilderCloudCommand.java b/src/de/steamwar/bungeecore/commands/BuilderCloudCommand.java index f0c00d2a..2c3c9a06 100644 --- a/src/de/steamwar/bungeecore/commands/BuilderCloudCommand.java +++ b/src/de/steamwar/bungeecore/commands/BuilderCloudCommand.java @@ -7,6 +7,7 @@ import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; import de.steamwar.messages.ChatSender; import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; import java.io.File; @@ -79,8 +80,11 @@ public class BuilderCloudCommand extends SWCommand { return; } - BungeeCore.local.execute("/binarys/deployarena.py", arenaMode.getConfig(), Integer.toString(version.getVersionSuffix()), map); - ArenaMode.init(); + ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { + BungeeCore.local.execute("/binarys/deployarena.py", arenaMode.getConfig(), Integer.toString(version.getVersionSuffix()), map); + ArenaMode.init(); + ChatSender.of(player).system("BUILDERCLOUD_DEPLOY_FINISHED"); + }); } @ClassMapper(value = ServerStarter.Version.class, local = true) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 30ce2090..b4e339fc 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -663,6 +663,7 @@ BUILDERCLOUD_USAGE=§8/§7buildercloud §8[§eversion§8] §8[§emap§8] BUILDERCLOUD_CREATE_USAGE=§8/§7buildercloud create §8[§eversion§8] §8[§emap§8] §8<§7generator§8> BUILDERCLOUD_RENAME_USAGE=§8/§7buildercloud rename §8[§eversion§8] §8[§emap§8] §8[§enew name§8] BUILDERCLOUD_DEPLOY_USAGE=§8/§7deployarena §8[§egamemode§8] §8[§eversion§8] §8[§emap§8] +BUILDERCLOUD_DEPLOY_FINISHED=§7Map deployment finished. BUILDERCLOUD_VERSION=§cUnknown version. BUILDERCLOUD_EXISTING_MAP=§cMap already exists. BUILDERCLOUD_UNKNOWN_MAP=§cUnknown map.