Update for paper-mojangapi removal

This commit is contained in:
Jason Penilla 2024-05-11 12:30:27 -07:00
parent 007ef94235
commit eb14faff2b
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8
3 changed files with 10 additions and 12 deletions

View file

@ -79,9 +79,6 @@ abstract class GenerateDevBundle : DefaultTask() {
@get:Input
abstract val apiCoordinates: Property<String>
@get:Input
abstract val mojangApiCoordinates: Property<String>
@get:Input
abstract val vanillaJarIncludes: ListProperty<String>
@ -265,7 +262,6 @@ abstract class GenerateDevBundle : DefaultTask() {
minecraftVersion = minecraftVersion.get(),
mappedServerCoordinates = serverCoordinates.get(),
apiCoordinates = "${apiCoordinates.get()}:${serverVersion.get()}",
mojangApiCoordinates = "${mojangApiCoordinates.get()}:${serverVersion.get()}",
buildData = createBuildDataConfig(dataTargetDir),
decompile = createDecompileRunner(),
remapper = createRemapDep(),
@ -341,7 +337,7 @@ abstract class GenerateDevBundle : DefaultTask() {
val minecraftVersion: String,
val mappedServerCoordinates: String,
val apiCoordinates: String,
val mojangApiCoordinates: String,
val mojangApiCoordinates: String? = null,
val buildData: BuildData,
val decompile: Runner,
val remapper: MavenDep,
@ -372,7 +368,7 @@ abstract class GenerateDevBundle : DefaultTask() {
const val mojangMappedPaperclipFileName = "paperclip-$DEOBF_NAMESPACE.jar"
// Should be bumped when the dev bundle config/contents changes in a way which will require users to update paperweight
const val currentDataVersion = 4
const val currentDataVersion = 5
fun createCoordinatesFor(project: Project): String =
sequenceOf(project.group, project.name.lowercase(Locale.ENGLISH), "userdev-" + project.version).joinToString(":")

View file

@ -31,8 +31,9 @@ import kotlin.io.path.*
private val supported = mapOf(
2 to DevBundleV2.Config::class, // 1.17.1
3 to GenerateDevBundle.DevBundleConfig::class,
GenerateDevBundle.currentDataVersion to GenerateDevBundle.DevBundleConfig::class,
3 to GenerateDevBundle.DevBundleConfig::class, // up to 1.20.4
4 to GenerateDevBundle.DevBundleConfig::class, // 1.20.5, early 1.20.6
GenerateDevBundle.currentDataVersion to GenerateDevBundle.DevBundleConfig::class, // 1.20.6+ (nullable mojangApiCoordinates)
)
data class ExtractedBundle<C>(

View file

@ -167,9 +167,10 @@ class SetupHandlerImpl(
applyMojangMappedPaperclipPatch(context)
val deps = bundle.config.buildData.compileDependencies.toList() +
bundle.config.apiCoordinates +
bundle.config.mojangApiCoordinates
val deps = mutableListOf<String>()
deps.addAll(bundle.config.buildData.compileDependencies)
deps.add(bundle.config.apiCoordinates)
bundle.config.mojangApiCoordinates?.let { deps.add(it) }
installPaperServer(
cache,
bundle.config.mappedServerCoordinates,
@ -193,7 +194,7 @@ class SetupHandlerImpl(
}
override fun populateRuntimeConfiguration(context: SetupHandler.Context, dependencySet: DependencySet) {
listOf(
listOfNotNull(
bundle.config.mappedServerCoordinates,
bundle.config.apiCoordinates,
bundle.config.mojangApiCoordinates