diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/PaperweightCore.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/PaperweightCore.kt index 0d22e9c..baf504d 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/PaperweightCore.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/PaperweightCore.kt @@ -33,18 +33,23 @@ import io.papermc.paperweight.tasks.patchremap.RemapPatches import io.papermc.paperweight.util.* import io.papermc.paperweight.util.constants.* import java.io.File +import javax.inject.Inject import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.Delete import org.gradle.api.tasks.TaskProvider import org.gradle.api.tasks.bundling.Jar +import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* -class PaperweightCore : Plugin { +abstract class PaperweightCore : Plugin { + @get:Inject + abstract val javaToolchainService: JavaToolchainService + override fun apply(target: Project) { Git.checkForGit() - val ext = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightCoreExtension::class, target) + val ext = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightCoreExtension::class, target, javaToolchainService) target.gradle.sharedServices.registerIfAbsent("download", DownloadService::class) {} diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/extension/PaperweightCoreExtension.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/extension/PaperweightCoreExtension.kt index 9fafbb8..8bf403c 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/extension/PaperweightCoreExtension.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/extension/PaperweightCoreExtension.kt @@ -22,6 +22,7 @@ package io.papermc.paperweight.core.extension +import io.papermc.paperweight.extension.AbstractJavaLauncherHolder import io.papermc.paperweight.util.* import io.papermc.paperweight.util.constants.* import java.util.Locale @@ -32,9 +33,15 @@ import org.gradle.api.file.ProjectLayout import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property +import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* -open class PaperweightCoreExtension(project: Project, objects: ObjectFactory, layout: ProjectLayout) { +abstract class PaperweightCoreExtension( + project: Project, + objects: ObjectFactory, + layout: ProjectLayout, + javaToolchainService: JavaToolchainService +) : AbstractJavaLauncherHolder(project, javaToolchainService) { @Suppress("MemberVisibilityCanBePrivate") val workDir: DirectoryProperty = objects.dirWithDefault(layout, "work") diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/extension/AbstractJavaLauncherHolder.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/extension/AbstractJavaLauncherHolder.kt new file mode 100644 index 0000000..791f622 --- /dev/null +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/extension/AbstractJavaLauncherHolder.kt @@ -0,0 +1,40 @@ +/* + * paperweight is a Gradle plugin for the PaperMC project. + * + * Copyright (c) 2023 Kyle Wood (DenWav) + * Contributors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 only, no later versions. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +package io.papermc.paperweight.extension + +import io.papermc.paperweight.util.* +import org.gradle.api.Project +import org.gradle.jvm.toolchain.JavaToolchainService + +abstract class AbstractJavaLauncherHolder( + project: Project, + javaToolchainService: JavaToolchainService +) : JavaLauncherHolder { + init { + init(project, javaToolchainService) + } + + private fun init(project: Project, javaToolchainService: JavaToolchainService) { + javaLauncher.convention(javaToolchainService.defaultJavaLauncher(project)) + } +} diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/extension/JavaLauncherHolder.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/extension/JavaLauncherHolder.kt new file mode 100644 index 0000000..d387c5d --- /dev/null +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/extension/JavaLauncherHolder.kt @@ -0,0 +1,30 @@ +/* + * paperweight is a Gradle plugin for the PaperMC project. + * + * Copyright (c) 2023 Kyle Wood (DenWav) + * Contributors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 only, no later versions. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +package io.papermc.paperweight.extension + +import org.gradle.api.provider.Property +import org.gradle.jvm.toolchain.JavaLauncher + +interface JavaLauncherHolder { + val javaLauncher: Property +} diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/java-launcher.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/java-launcher.kt index 0b70460..183f93a 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/java-launcher.kt +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/java-launcher.kt @@ -23,23 +23,13 @@ package io.papermc.paperweight.tasks import io.papermc.paperweight.util.* -import javax.inject.Inject -import org.gradle.api.Project import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider import org.gradle.api.tasks.Nested import org.gradle.jvm.toolchain.JavaLauncher -import org.gradle.jvm.toolchain.JavaToolchainService - -private fun JavaLauncherTaskBase.defaultJavaLauncher(project: Project): Provider = - javaToolchainService.defaultJavaLauncher(project) interface JavaLauncherTaskBase { @get:Nested val launcher: Property - - @get:Inject - val javaToolchainService: JavaToolchainService } abstract class JavaLauncherTask : BaseTask(), JavaLauncherTaskBase { @@ -47,7 +37,7 @@ abstract class JavaLauncherTask : BaseTask(), JavaLauncherTaskBase { override fun init() { super.init() - launcher.convention(defaultJavaLauncher(project)) + launcher.convention(project.defaultJavaLauncher()) } } @@ -56,6 +46,6 @@ abstract class JavaLauncherZippedTask : ZippedTask(), JavaLauncherTaskBase { override fun init() { super.init() - launcher.convention(defaultJavaLauncher(project)) + launcher.convention(project.defaultJavaLauncher()) } } diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/util/utils.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/util/utils.kt index f495a28..c6a45ba 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/util/utils.kt +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/util/utils.kt @@ -27,6 +27,7 @@ import com.google.gson.* import dev.denwav.hypo.model.ClassProviderRoot import io.papermc.paperweight.DownloadService import io.papermc.paperweight.PaperweightException +import io.papermc.paperweight.extension.JavaLauncherHolder import io.papermc.paperweight.tasks.* import io.papermc.paperweight.util.constants.* import java.io.File @@ -268,6 +269,10 @@ fun toHex(hash: ByteArray): String { return sb.toString() } +// This works because we don't expect or support people applying more than one of userdev/core/patcher in a single project +fun Project.defaultJavaLauncher(): Provider = + extensions.getByType(JavaLauncherHolder::class.java).javaLauncher + fun JavaToolchainService.defaultJavaLauncher(project: Project): Provider { return launcherFor(project.extensions.getByType().toolchain).orElse( launcherFor { diff --git a/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcher.kt b/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcher.kt index bba1d86..1b6c247 100644 --- a/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcher.kt +++ b/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcher.kt @@ -35,6 +35,7 @@ import io.papermc.paperweight.util.constants.* import io.papermc.paperweight.util.data.* import java.io.File import java.util.concurrent.atomic.AtomicReference +import javax.inject.Inject import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task @@ -42,15 +43,18 @@ import org.gradle.api.provider.Provider import org.gradle.api.tasks.Delete import org.gradle.api.tasks.TaskProvider import org.gradle.api.tasks.bundling.Jar +import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.registering -class PaperweightPatcher : Plugin { +abstract class PaperweightPatcher : Plugin { + @get:Inject + abstract val javaToolchainService: JavaToolchainService override fun apply(target: Project) { Git.checkForGit() - val patcher = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightPatcherExtension::class, target) + val patcher = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightPatcherExtension::class, target, javaToolchainService) target.gradle.sharedServices.registerIfAbsent("download", DownloadService::class) {} diff --git a/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcherExtension.kt b/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcherExtension.kt index 31db99e..5e47338 100644 --- a/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcherExtension.kt +++ b/paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/PaperweightPatcherExtension.kt @@ -22,6 +22,7 @@ package io.papermc.paperweight.patcher +import io.papermc.paperweight.extension.AbstractJavaLauncherHolder import io.papermc.paperweight.patcher.upstream.DefaultPaperRepoPatcherUpstream import io.papermc.paperweight.patcher.upstream.DefaultPatcherUpstream import io.papermc.paperweight.patcher.upstream.DefaultRepoPatcherUpstream @@ -43,10 +44,17 @@ import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.api.tasks.TaskContainer +import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* @Suppress("unused", "MemberVisibilityCanBePrivate") -open class PaperweightPatcherExtension(project: Project, private val objects: ObjectFactory, layout: ProjectLayout, tasks: TaskContainer) { +abstract class PaperweightPatcherExtension( + project: Project, + private val objects: ObjectFactory, + layout: ProjectLayout, + tasks: TaskContainer, + javaToolchainService: JavaToolchainService +) : AbstractJavaLauncherHolder(project, javaToolchainService) { val serverProject: Property = objects.property() diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUser.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUser.kt index 0c11f0e..33b3f1e 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUser.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUser.kt @@ -82,13 +82,13 @@ abstract class PaperweightUser : Plugin { } val userdev = target.extensions.create( - PAPERWEIGHT_EXTENSION, PaperweightUserExtension::class, + PAPERWEIGHT_EXTENSION, + PaperweightUserExtensionImpl::class, target, workerExecutor, javaToolchainService, - target.provider { userdevSetup }, - target.objects + target.provider { userdevSetup } ) target.dependencies.extensions.create( @@ -253,5 +253,5 @@ abstract class PaperweightUser : Plugin { } private fun createContext(project: Project): SetupHandler.Context = - SetupHandler.Context(project, workerExecutor, javaToolchainService) + SetupHandler.Context(project, workerExecutor) } diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtension.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtension.kt index 9ac3a2c..7666033 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtension.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtension.kt @@ -22,40 +22,28 @@ package io.papermc.paperweight.userdev -import io.papermc.paperweight.userdev.internal.setup.SetupHandler -import io.papermc.paperweight.util.* -import org.gradle.api.Project +import io.papermc.paperweight.extension.JavaLauncherHolder import org.gradle.api.file.RegularFile -import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.Property import org.gradle.api.provider.Provider -import org.gradle.jvm.toolchain.JavaToolchainService -import org.gradle.kotlin.dsl.* -import org.gradle.workers.WorkerExecutor +import org.gradle.jvm.toolchain.JavaLauncher /** * Extension exposing configuration and other APIs for paperweight userdev. */ -abstract class PaperweightUserExtension( - project: Project, - workerExecutor: WorkerExecutor, - javaToolchainService: JavaToolchainService, - setup: Provider, - objects: ObjectFactory -) { +interface PaperweightUserExtension : JavaLauncherHolder { /** * Whether to inject the Paper maven repository for use by the dev bundle configuration. * * True by default to allow easily resolving Paper development bundles. */ - val injectPaperRepository: Property = objects.property().convention(true) + val injectPaperRepository: Property /** * The [ReobfArtifactConfiguration] is responsible for setting the input and output jars for `reobfJar`, * as well as changing the classifiers of other jars (i.e. `jar` or `shadowJar`). */ - val reobfArtifactConfiguration: Property = objects.property() - .convention(ReobfArtifactConfiguration.REOBF_PRODUCTION) + val reobfArtifactConfiguration: Property /** * Provides a runnable Mojang mapped server jar, extracted from the current dev bundle. @@ -65,14 +53,17 @@ abstract class PaperweightUserExtension( replaceWith = ReplaceWith("project.configurations.mojangMappedServerRuntime"), level = DeprecationLevel.WARNING ) - val mojangMappedServerJar: Provider = objects.fileProperty().pathProvider( - setup.map { it.serverJar(SetupHandler.Context(project, workerExecutor, javaToolchainService)) } - ).withDisallowChanges().withDisallowUnsafeRead() + val mojangMappedServerJar: Provider /** * Provides the Minecraft version of the current dev bundle. */ - val minecraftVersion: Provider = objects.property().value( - setup.map { it.minecraftVersion } - ).withDisallowChanges().withDisallowUnsafeRead() + val minecraftVersion: Provider + + /** + * The default [JavaLauncher] for paperweight. + * + * Used for executing setup, and as the default launcher for `reobfJar`. + */ + override val javaLauncher: Property } diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtensionImpl.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtensionImpl.kt new file mode 100644 index 0000000..c6db487 --- /dev/null +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/PaperweightUserExtensionImpl.kt @@ -0,0 +1,58 @@ +/* + * paperweight is a Gradle plugin for the PaperMC project. + * + * Copyright (c) 2023 Kyle Wood (DenWav) + * Contributors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 only, no later versions. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +package io.papermc.paperweight.userdev + +import io.papermc.paperweight.extension.AbstractJavaLauncherHolder +import io.papermc.paperweight.userdev.internal.setup.SetupHandler +import io.papermc.paperweight.util.* +import org.gradle.api.Project +import org.gradle.api.file.ProjectLayout +import org.gradle.api.file.RegularFile +import org.gradle.api.provider.Provider +import org.gradle.jvm.toolchain.JavaToolchainService +import org.gradle.kotlin.dsl.* +import org.gradle.workers.WorkerExecutor + +abstract class PaperweightUserExtensionImpl( + project: Project, + projectLayout: ProjectLayout, + workerExecutor: WorkerExecutor, + javaToolchainService: JavaToolchainService, + setup: Provider +) : PaperweightUserExtension, AbstractJavaLauncherHolder(project, javaToolchainService) { + @Suppress("OVERRIDE_DEPRECATION") + override val mojangMappedServerJar: Provider = projectLayout.file( + setup.map { it.serverJar(SetupHandler.Context(project, workerExecutor)).toFile() } + ) + + override val minecraftVersion: Provider = setup.map { it.minecraftVersion } + + init { + init() + } + + private fun init() { + reobfArtifactConfiguration.convention(ReobfArtifactConfiguration.REOBF_PRODUCTION).finalizeValueOnRead() + injectPaperRepository.convention(true).finalizeValueOnRead() + } +} diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/SetupHandler.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/SetupHandler.kt index 7cd113e..a8876f5 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/SetupHandler.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/SetupHandler.kt @@ -32,7 +32,6 @@ import org.gradle.api.Project import org.gradle.api.artifacts.DependencySet import org.gradle.api.artifacts.repositories.IvyArtifactRepository import org.gradle.jvm.toolchain.JavaLauncher -import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.workers.WorkerExecutor interface SetupHandler { @@ -64,11 +63,10 @@ interface SetupHandler { data class Context( val project: Project, - val workerExecutor: WorkerExecutor, - val javaToolchainService: JavaToolchainService + val workerExecutor: WorkerExecutor ) { - val defaultJavaLauncher: JavaLauncher - get() = javaToolchainService.defaultJavaLauncher(project).get() + val javaLauncher: JavaLauncher + get() = project.defaultJavaLauncher().get() } companion object { diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/AccessTransformMinecraft.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/AccessTransformMinecraft.kt index 5e1ded7..fc8bcb8 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/AccessTransformMinecraft.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/AccessTransformMinecraft.kt @@ -42,7 +42,7 @@ class AccessTransformMinecraft( outputJarPath = outputJar, atFilePath = at, workerExecutor = context.workerExecutor, - launcher = context.defaultJavaLauncher + launcher = context.javaLauncher ).await() } } diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/DecompileMinecraft.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/DecompileMinecraft.kt index 43f7e36..83908e2 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/DecompileMinecraft.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/DecompileMinecraft.kt @@ -52,7 +52,7 @@ class DecompileMinecraft( inputJar = inputJar, libraries = minecraftLibraryJars(), outputJar = outputJar, - javaLauncher = context.defaultJavaLauncher + javaLauncher = context.javaLauncher ) } diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/FixMinecraftJar.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/FixMinecraftJar.kt index 27084e3..3bfd96d 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/FixMinecraftJar.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/FixMinecraftJar.kt @@ -40,7 +40,7 @@ class FixMinecraftJar( override fun run(context: SetupHandler.Context) { fixJar( workerExecutor = context.workerExecutor, - launcher = context.defaultJavaLauncher, + launcher = context.javaLauncher, vanillaJarPath = vanillaServerJar, inputJarPath = inputJar, outputJarPath = outputJar, diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/GenerateMappingsStep.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/GenerateMappingsStep.kt index fd8b318..ea7324e 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/GenerateMappingsStep.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/GenerateMappingsStep.kt @@ -49,7 +49,7 @@ class GenerateMappingsStep( paramMappingsPath = paramMappings, outputMappingsPath = outputMappings, workerExecutor = context.workerExecutor, - launcher = context.defaultJavaLauncher + launcher = context.javaLauncher ).await() } diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RemapMinecraft.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RemapMinecraft.kt index 428777b..310e754 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RemapMinecraft.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RemapMinecraft.kt @@ -55,7 +55,7 @@ class RemapMinecraft( remapClasspath = minecraftLibraryJars(), remapper = remapper, outputJar = outputJar, - launcher = context.defaultJavaLauncher, + launcher = context.javaLauncher, workingDir = cache ) } diff --git a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RunPaperclip.kt b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RunPaperclip.kt index 1edd052..fed04ab 100644 --- a/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RunPaperclip.kt +++ b/paperweight-userdev/src/main/kotlin/io/papermc/paperweight/userdev/internal/setup/step/RunPaperclip.kt @@ -71,7 +71,7 @@ class RunPaperclip( cache.createDirectories() mojangJar.copyTo(cache.resolve("mojang_$minecraftVersion.jar")) - context.defaultJavaLauncher.runJar( + context.javaLauncher.runJar( classpath = context.project.files(paperclip), workingDir = work, logFile = logFile,