diff --git a/controller-api/src/main/kotlin/app/simplecloud/controller/api/ServerApi.kt b/controller-api/src/main/kotlin/app/simplecloud/controller/api/ServerApi.kt index 383ccbf..0b31653 100644 --- a/controller-api/src/main/kotlin/app/simplecloud/controller/api/ServerApi.kt +++ b/controller-api/src/main/kotlin/app/simplecloud/controller/api/ServerApi.kt @@ -17,6 +17,13 @@ interface ServerApi { */ fun getAllServers(): CompletableFuture> + /** + * @return a [CompletableFuture] with the [Server] from the SIMPLECLOUD_UNIQUE_ID environment + */ + fun getCurrentServer(): CompletableFuture { + return getServerById(System.getenv("SIMPLECLOUD_UNIQUE_ID")) + } + /** * @param id the id of the server. * @return a [CompletableFuture] with the [Server]. @@ -124,6 +131,13 @@ interface ServerApi { */ suspend fun getAllServers(): List + /** + * @return the [Server] from the SIMPLECLOUD_UNIQUE_ID environment + */ + suspend fun getCurrentServer(): Server { + return getServerById(System.getenv("SIMPLECLOUD_UNIQUE_ID")) + } + /** * @param id the id of the server. * @return the [Server].