Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wisp Forest Maven & Nostalgia Mappings #90

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ abstract class UniminedExtension(val project: Project) {
@Deprecated("Use glassLauncherMaven(\"babric\") instead", ReplaceWith("glassLauncherMaven(\"babric\")"))
abstract fun babricMaven()
abstract fun glassLauncherMaven(name: String)
abstract fun wispForestMaven(name: String = "releases")
abstract fun parchmentMaven()

abstract fun neoForgedMaven()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,38 @@ abstract class MappingsConfig<T: MappingResolver<T>>(val project: Project, val m
}
}

@JvmOverloads
fun nostalgia(
build: String,
key: String = "nostalgia",
@DelegatesTo(value = MappingEntry::class, strategy = Closure.DELEGATE_FIRST)
action: Closure<*>
) {
nostalgia(build.toInt(), key, action)
}

@JvmOverloads
abstract fun nostalgia(build: Int, key: String = "nostalgia", action: MappingEntry.() -> Unit = {})

@JvmOverloads
fun nostalgia(build: String, key: String = "nostalgia", action: MappingEntry.() -> Unit = {}) {
nostalgia(build.toInt(), key, action)
}

@JvmOverloads
fun nostalgia(
build: Int,
key: String = "nostalgia",
@DelegatesTo(value = MappingEntry::class, strategy = Closure.DELEGATE_FIRST)
action: Closure<*>
) {
nostalgia(build, key) {
action.delegate = this
action.resolveStrategy = Closure.DELEGATE_FIRST
action.call()
}
}


@JvmOverloads
abstract fun quilt(build: Int, key: String = "quilt", action: MappingEntry.() -> Unit = {})
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/xyz/wagyourtail/unimined/UniminedExtensionImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ open class UniminedExtensionImpl(project: Project) : UniminedExtension(project)
project.logger.info("[Unimined] adding Glass Launcher maven: ${glassLauncherMaven[name]}")
}

val wispForestMaven = defaultedMapOf<String, MavenArtifactRepository> { name ->
project.repositories.maven {
it.name = "Wisp Forest"
it.url = URI.create("https://maven.wispforest.io/$name")
}
}

override fun wispForestMaven(name: String) {
project.logger.info("[Unimined] adding Wisp Forest maven: ${wispForestMaven[name]}")
}

val wagYourMaven = defaultedMapOf<String, MavenArtifactRepository> { name ->
project.repositories.maven {
it.name = "WagYourTail (${name.capitalized()})"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,25 @@ class MappingsProvider(project: Project, minecraft: MinecraftConfig, subKey: Str
}
}


override fun nostalgia(build: Int, key: String, action: MappingEntry.() -> Unit) {
unimined.wispForestMaven()
val entry = MappingEntry(contentOf(
MavenCoords(
"me.alphamode",
"nostalgia",
"${minecraft.version}+build.$build",
)), "$key-$build"
).apply {
requires("babricIntermediary")
provides("nostalgia" to true)
action()
}
addDependency(key, entry)
afterLoad.add {
renest(entry.requires.name, *entry.provides.map { it.first.name }.toTypedArray())
}
}

override fun quilt(build: Int, key: String, action: MappingEntry.() -> Unit) {
unimined.quiltMaven()
val entry = MappingEntry(contentOf(
Expand Down
Loading