Skip to content

Commit

Permalink
update how intermediaries are determined for fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Aug 6, 2024
1 parent 7bbb929 commit 381730f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ package xyz.wagyourtail.unimined.api.minecraft.patch.fabric
*/
interface LegacyFabricPatcher : FabricLikePatcher {

var replaceLwjglVersion: String?

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ open class BabricMinecraftTransformer(project: Project, provider: MinecraftProvi

override var canCombine: Boolean by FinalizeOnRead(true)

override var prodNamespace: Namespace by LazyMutable {
provider.mappings.checkedNs("babricIntermediary")
}
override val defaultProdNamespace: String = "babricIntermediary"

override fun addIntermediaryMappings() {
provider.mappings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ abstract class FabricLikeMinecraftTransformer(
}
)

abstract val defaultProdNamespace: String

override var prodNamespace by FinalizeOnRead(LazyMutable {
if (!provider.obfuscated) return@LazyMutable provider.mappings.checkedNs("official")
provider.mappings.checkedNs("intermediary")
if (customIntermediaries) throw IllegalStateException("Custom intermediaries are enabled, but prodNamespace is not overriden")
provider.mappings.checkedNs(defaultProdNamespace)
})

@get:ApiStatus.Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ open class LegacyFabricMinecraftTransformer(

override var replaceLwjglVersion: String? by FinalizeOnRead("2.9.4+legacyfabric.8")

override val defaultProdNamespace: String = "legacyIntermediary"

override fun addIntermediaryMappings() {
provider.mappings {
legacyIntermediary()
}
}

override var prodNamespace: Namespace by FinalizeOnRead(LazyMutable {
provider.mappings.checkedNs("legacyIntermediary")
})

override fun loader(dep: Any, action: Dependency.() -> Unit) {
fabric.dependencies.add(
(if (dep is String && !dep.contains(":")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ open class OrnitheFabricMinecraftTransformer(
provider: MinecraftProvider
): LegacyFabricMinecraftTransformer(project, provider) {

override val defaultProdNamespace: String = "calamus"

override fun addIntermediaryMappings() {
provider.mappings {
calamus()
}
}

override var prodNamespace: Namespace by FinalizeOnRead(LazyMutable {
provider.mappings.checkedNs("calamus")
})

}

0 comments on commit 381730f

Please sign in to comment.