@@ -25,6 +25,7 @@ package io.papermc.paperweight.core
2525import io.papermc.paperweight.DownloadService
2626import io.papermc.paperweight.core.extension.PaperweightCoreExtension
2727import io.papermc.paperweight.core.taskcontainers.AllTasks
28+ import io.papermc.paperweight.core.taskcontainers.SoftSpoonTasks
2829import io.papermc.paperweight.core.tasks.PaperweightCorePrepareForDownstream
2930import io.papermc.paperweight.taskcontainers.BundlerJarTasks
3031import io.papermc.paperweight.taskcontainers.DevBundleTasks
@@ -53,7 +54,9 @@ class PaperweightCore : Plugin<Project> {
5354
5455 val ext = target.extensions.create(PAPERWEIGHT_EXTENSION , PaperweightCoreExtension ::class , target)
5556
56- target.gradle.sharedServices.registerIfAbsent(DOWNLOAD_SERVICE_NAME , DownloadService ::class ) {}
57+ target.gradle.sharedServices.registerIfAbsent(DOWNLOAD_SERVICE_NAME , DownloadService ::class ) {
58+ parameters.projectPath.set(target.projectDir)
59+ }
5760
5861 target.tasks.register<Delete >(" cleanCache" ) {
5962 group = " paper"
@@ -69,6 +72,7 @@ class PaperweightCore : Plugin<Project> {
6972 target.configurations.create(REMAPPER_CONFIG )
7073 target.configurations.create(DECOMPILER_CONFIG )
7174 target.configurations.create(PAPERCLIP_CONFIG )
75+ target.configurations.create(MACHE_CONFIG )
7276
7377 if (target.providers.gradleProperty(" paperweight.dev" ).orNull == " true" ) {
7478 target.tasks.register<CreateDiffOutput >(" diff" ) {
@@ -90,10 +94,12 @@ class PaperweightCore : Plugin<Project> {
9094 ext.mainClass
9195 )
9296
97+ val softSpoonTasks = SoftSpoonTasks (target, tasks)
98+
9399 target.createPatchRemapTask(tasks)
94100
95101 target.tasks.register<PaperweightCorePrepareForDownstream >(PAPERWEIGHT_PREPARE_DOWNSTREAM ) {
96- dependsOn(tasks.applyPatches )
102+ dependsOn(tasks.applyPatchesLegacy )
97103 vanillaJar.set(tasks.downloadServerJar.flatMap { it.outputJar })
98104 remappedJar.set(tasks.lineMapJar.flatMap { it.outputJar })
99105 decompiledJar.set(tasks.decompileJar.flatMap { it.outputJar })
@@ -124,21 +130,35 @@ class PaperweightCore : Plugin<Project> {
124130 }
125131
126132 target.afterEvaluate {
133+ println (" SoftSpoon: ${ext.softSpoon.get()} " )
134+
127135 target.repositories {
128- maven(ext.paramMappingsRepo) {
129- name = PARAM_MAPPINGS_REPO_NAME
130- content { onlyForConfigurations(PARAM_MAPPINGS_CONFIG ) }
131- }
132- maven(ext.remapRepo) {
133- name = REMAPPER_REPO_NAME
134- content { onlyForConfigurations(REMAPPER_CONFIG ) }
135- }
136- maven(ext.decompileRepo) {
137- name = DECOMPILER_REPO_NAME
138- content { onlyForConfigurations(DECOMPILER_CONFIG ) }
136+ if (! ext.softSpoon.get()) {
137+ maven(ext.paramMappingsRepo) {
138+ name = PARAM_MAPPINGS_REPO_NAME
139+ content { onlyForConfigurations(PARAM_MAPPINGS_CONFIG ) }
140+ }
141+ maven(ext.remapRepo) {
142+ name = REMAPPER_REPO_NAME
143+ content { onlyForConfigurations(REMAPPER_CONFIG ) }
144+ }
145+ maven(ext.decompileRepo) {
146+ name = DECOMPILER_REPO_NAME
147+ content { onlyForConfigurations(DECOMPILER_CONFIG ) }
148+ }
149+ } else {
150+ maven(ext.macheRepo) {
151+ name = MACHE_REPO_NAME
152+ content { onlyForConfigurations(MACHE_CONFIG ) }
153+ }
139154 }
140155 }
141156
157+ if (ext.softSpoon.get()) {
158+ softSpoonTasks.afterEvaluate()
159+ return @afterEvaluate
160+ }
161+
142162 // Setup the server jar
143163 val cache = target.layout.cache
144164
0 commit comments