Skip to content
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
57 changes: 40 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ plugins {
id("net.fabricmc.fabric-loom-remap") version "1.14-SNAPSHOT"
id("org.jetbrains.kotlin.jvm") version "2.3.0"
id("dev.deftu.gradle.bloom") version "0.2.0"
id("me.modmuss50.mod-publish-plugin") version "1.1.0"
}

val modid = property("mod.id")
val modname = property("mod.name")
val modversion = property("mod.version")
val mcversion = property("minecraft_version")
val mcversion = stonecutter.current.version
val oneconfigversion = property("oneconfig_version")

base {
archivesName.set(property("mod.id") as String)
}
version = "$modversion+$mcversion"
base.archivesName = modname.toString()

repositories {
maven("https://maven.parchmentmc.org")
Expand All @@ -33,27 +34,22 @@ loom {
}

dependencies {
minecraft("com.mojang:minecraft:${property("minecraft_version")}")
minecraft("com.mojang:minecraft:$mcversion")
@Suppress("UnstableApiUsage")
mappings(loom.layered {
officialMojangMappings()
optionalProp("${property("parchment_version")}") {
parchment("org.parchmentmc.data:parchment-${property("minecraft_version")}:$it@zip")
parchment("org.parchmentmc.data:parchment-$mcversion:$it@zip")
}
optionalProp("${property("yalmm_version")}") {
mappings("dev.lambdaurora:yalmm-mojbackward:${property("minecraft_version")}+build.$it")
mappings("dev.lambdaurora:yalmm-mojbackward:$mcversion+build.$it")
}
})
modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}")
modImplementation("org.polyfrost.oneconfig:${property("minecraft_version")}-fabric:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:commands:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:config:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:config-impl:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:events:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:internal:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:ui:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:utils:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:hud:1.0.0-alpha.181")
modImplementation("org.polyfrost.oneconfig:$mcversion-fabric:$oneconfigversion")
for (module in arrayOf("config", "config-impl", "internal", "ui")) {
implementation("org.polyfrost.oneconfig:$module:$oneconfigversion")
}
}

bloom {
Expand Down Expand Up @@ -101,4 +97,31 @@ tasks.jar {
}

fun <T> optionalProp(property: String, block: (String) -> T?): T? =
findProperty(property)?.toString()?.takeUnless { it.isBlank() }?.let(block)
findProperty(property)?.toString()?.takeUnless { it.isBlank() }?.let(block)

val modrinthId = findProperty("publish.modrinth")?.toString()?.takeIf { it.isNotBlank() }

// make sure modrinth.token is set in your user gradle properties
publishMods {
file = project.tasks.remapJar.get().archiveFile

displayName = modversion.toString()
version = "v$modversion"
changelog = project.rootProject.file("CHANGELOG.md").takeIf { it.exists() }?.readText() ?: "No changelog provided."
type = ALPHA

modLoaders.add("fabric")

dryRun = modrinthId == null

if (modrinthId != null) {
modrinth {
projectId = property("publish.modrinth").toString()
accessToken = findProperty("modrinth.token").toString()

minecraftVersions.add(mcversion)

requires("oneconfig")
}
}
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ mod.group=org.polyfrost

loom_version=1.14-SNAPSHOT
loader_version=0.18.4
minecraft_version=[VERSIONED]
oneconfig_version=1.0.0-alpha.182
parchment_version=[VERSIONED]
yalmm_version=[VERSIONED]

publish.modrinth=Gapz72zt

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureoncommand=true
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ plugins {

stonecutter {
create(rootProject) {
versions("1.21.1", "1.21.4", "1.21.8", "1.21.10")
versions("1.21.1", "1.21.4", "1.21.8", "1.21.10", "1.21.11")

vcsVersion = "1.21.10"
vcsVersion = "1.21.11"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private int modifyMultiplayerWidth(int i, @Local Component multiplayerDisabledRe
return i;
}

@Inject(method = "createNormalMenuOptions", at = @At(value = "RETURN"))
@Inject(method = "createNormalMenuOptions", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/TitleScreen;addRenderableWidget(Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener;", ordinal = 1, shift = At.Shift.AFTER))
private void addLastServerButton(int i, int j, /*? if >=1.21.4 {*/ CallbackInfoReturnable<Integer> cir /*?} else {*/ /*CallbackInfo ci *//*?}*/, @Local Component multiplayerDisabledReason) {
if (multiplayerDisabledReason != null) return;

Expand Down
6 changes: 5 additions & 1 deletion stonecutter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ plugins {
id("dev.kikugie.stonecutter")
}

stonecutter active "1.21.10" /* [SC] DO NOT EDIT */
stonecutter active "1.21.11" /* [SC] DO NOT EDIT */

stonecutter tasks {
order("publishModrinth")
}
3 changes: 1 addition & 2 deletions versions/1.21.1/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
parchment_version=2024.11.17
yalmm_version=3
minecraft_version=1.21.1
yalmm_version=3
3 changes: 1 addition & 2 deletions versions/1.21.10/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
parchment_version=2025.10.12
yalmm_version=3
minecraft_version=1.21.10
yalmm_version=3
2 changes: 2 additions & 0 deletions versions/1.21.11/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parchment_version=2025.12.20
yalmm_version=3
3 changes: 1 addition & 2 deletions versions/1.21.4/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
parchment_version=2025.03.23
yalmm_version=3
minecraft_version=1.21.4
yalmm_version=3
3 changes: 1 addition & 2 deletions versions/1.21.8/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
parchment_version=2025.09.14
yalmm_version=3
minecraft_version=1.21.8
yalmm_version=3