From 6a2a5a82261efdf6427f21a2c7b5a443a9be87cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Levilain?= Date: Thu, 2 Jan 2025 11:28:46 +0100 Subject: [PATCH] feat(shulker-server-agent): add setReady method to api --- .../kotlin/io/shulkermc/serveragent/api/ShulkerServerAPIImpl.kt | 2 ++ .../java/io/shulkermc/serveragent/api/ShulkerServerAPI.java | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/shulker-server-agent/src/common/kotlin/io/shulkermc/serveragent/api/ShulkerServerAPIImpl.kt b/packages/shulker-server-agent/src/common/kotlin/io/shulkermc/serveragent/api/ShulkerServerAPIImpl.kt index 5542c11b..ea42d7d1 100644 --- a/packages/shulker-server-agent/src/common/kotlin/io/shulkermc/serveragent/api/ShulkerServerAPIImpl.kt +++ b/packages/shulker-server-agent/src/common/kotlin/io/shulkermc/serveragent/api/ShulkerServerAPIImpl.kt @@ -6,6 +6,8 @@ import java.util.concurrent.CompletableFuture class ShulkerServerAPIImpl(private val agent: ShulkerServerAgentCommon) : ShulkerServerAPI() { override fun askShutdown() = this.agent.shutdown() + override fun setReady(): CompletableFuture = this.agent.agonesGateway.setReady().thenAccept {} + override fun setAllocated(): CompletableFuture = this.agent.agonesGateway.setAllocated().thenAccept {} override fun setReserved(seconds: Long): CompletableFuture = diff --git a/packages/shulker-server-api/src/main/java/io/shulkermc/serveragent/api/ShulkerServerAPI.java b/packages/shulker-server-api/src/main/java/io/shulkermc/serveragent/api/ShulkerServerAPI.java index 818fd8ab..43897909 100644 --- a/packages/shulker-server-api/src/main/java/io/shulkermc/serveragent/api/ShulkerServerAPI.java +++ b/packages/shulker-server-api/src/main/java/io/shulkermc/serveragent/api/ShulkerServerAPI.java @@ -6,6 +6,7 @@ public abstract class ShulkerServerAPI { public static ShulkerServerAPI INSTANCE; abstract public void askShutdown(); + abstract public CompletableFuture setReady(); abstract public CompletableFuture setAllocated(); abstract public CompletableFuture setReserved(long seconds); }