From d3041700624d9ba09a621da11d61ff9e3ed08d67 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Fri, 27 Jan 2023 22:31:07 -0800 Subject: [PATCH] Allocate PaperVersionClient closer to time of use. --- .../kotlin/gay/pizza/foundation/concrete/SetupPaperServer.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/gay/pizza/foundation/concrete/SetupPaperServer.kt b/src/main/kotlin/gay/pizza/foundation/concrete/SetupPaperServer.kt index 85a3522..2d4f006 100644 --- a/src/main/kotlin/gay/pizza/foundation/concrete/SetupPaperServer.kt +++ b/src/main/kotlin/gay/pizza/foundation/concrete/SetupPaperServer.kt @@ -18,8 +18,6 @@ open class SetupPaperServer : SetupMinecraftServer() { @set:Option(option = "update", description = "Update Paper Server") var shouldUpdatePaperServer = true - private val paperVersionClient = PaperVersionClient() - @TaskAction fun setupPaperServer() { val concrete = project.extensions.getByType() @@ -31,6 +29,7 @@ open class SetupPaperServer : SetupMinecraftServer() { } private fun downloadLatestBuild(paperVersionGroup: String, paperJarFile: File) { + val paperVersionClient = PaperVersionClient() if (project.gradle.startParameter.isOffline) { if (!paperJarFile.exists()) { throw RuntimeException("Offline mode is enabled and Paper has not been downloaded.")