Skip to content

Commit 43df3d6

Browse files
committed
It's stonecutting time
1 parent ef126e4 commit 43df3d6

File tree

9 files changed

+170
-109
lines changed

9 files changed

+170
-109
lines changed

build.gradle

Lines changed: 0 additions & 86 deletions
This file was deleted.

build.gradle.kts

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
plugins {
2+
id("fabric-loom") version "1.13-SNAPSHOT"
3+
id("maven-publish")
4+
id("com.modrinth.minotaur") version "2.+"
5+
kotlin("jvm") version "2.2.10"
6+
id("com.google.devtools.ksp") version "2.2.10-2.0.2"
7+
id("dev.kikugie.fletching-table.fabric") version "0.1.0-alpha.22"
8+
}
9+
10+
version = "${project.property("mod_version")}+${stonecutter.current.project}"
11+
group = project.property("maven_group") as String
12+
13+
base.archivesName = project.property("archives_base_name") as String
14+
15+
repositories {
16+
maven("https://maven.ladysnake.org/releases") { name = "cardinal components" }
17+
maven("https://maven.terraformersmc.com") { name = "mod menu" }
18+
maven("https://api.modrinth.com/maven") { name = "modrinth" }
19+
maven("https://jitpack.io") { name = "jitpack" }
20+
maven("https://maven.isxander.dev/releases") { name = "Xander Maven" }
21+
}
22+
23+
fabricApi {
24+
configureDataGeneration {
25+
client = true
26+
}
27+
}
28+
29+
dependencies {
30+
// minecraft and fabric
31+
fun bundleAPI(dependencyNotation : Any) {
32+
modApi(dependencyNotation)
33+
include(dependencyNotation)
34+
}
35+
36+
fun compat(dependencyNotation : String) {
37+
modCompileOnly(dependencyNotation) {
38+
exclude("net.fabricmc.fabric-api")
39+
}
40+
modRuntimeOnly(dependencyNotation) {
41+
exclude("net.fabricmc.fabric-api")
42+
}
43+
}
44+
45+
minecraft("com.mojang:minecraft:${stonecutter.current.project}")
46+
mappings("net.fabricmc:yarn:${property("deps.yarn_mappings")}:v2")
47+
modImplementation("net.fabricmc:fabric-loader:${project.property("loader_version")}")
48+
49+
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("deps.fabric_api")}")
50+
51+
bundleAPI("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.property("deps.cca")}")
52+
bundleAPI("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.property("deps.cca")}")
53+
54+
modApi("dev.isxander:yet-another-config-lib:${project.property("deps.yacl")}")
55+
modApi("com.terraformersmc:modmenu:${project.property("deps.modmenu")}")
56+
57+
modRuntimeOnly("maven.modrinth:sodium:${project.property("deps.sodium")}")
58+
59+
compat("com.github.CrimsonDawn45:Fabric-Shield-Lib:v${project.property("deps.fabric_shield_lib")}")
60+
compat("com.github.Chocohead:Fabric-ASM:v2.3")
61+
compat("maven.modrinth:midnightlib:${project.property("deps.midnightlib")}")
62+
}
63+
64+
fletchingTable {
65+
mixins.create("main") {
66+
// Default matches the default value in the annotation
67+
mixin("default", "${project.property("archives_base_name")}.mixins.json")
68+
}
69+
mixins.all {
70+
automatic = true
71+
}
72+
}
73+
74+
tasks.processResources {
75+
val modVersion = project.version
76+
val minecraftVersion = stonecutter.current.version
77+
inputs.property("version", modVersion)
78+
inputs.property("minecraft", minecraftVersion)
79+
80+
filesMatching("fabric.mod.json") {
81+
expand(
82+
mapOf(
83+
"version" to modVersion,
84+
"minecraft" to minecraftVersion
85+
)
86+
)
87+
}
88+
}
89+
90+
loom {
91+
runConfigs.all {
92+
ideConfigGenerated(true)
93+
runDir = "../../run"
94+
}
95+
96+
runConfigs["client"].apply {
97+
programArgs("--username=Survivalblock", "--uuid=c45e97e6-94ef-42da-8b5e-0c3209551c3f")
98+
}
99+
100+
fabricModJsonPath = rootProject.file("src/main/resources/fabric.mod.json")
101+
}
102+
103+
tasks.withType<JavaCompile>().configureEach {
104+
options.release.set(21)
105+
}
106+
107+
java {
108+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
109+
// if it is present.
110+
// If you remove this line, sources will not be generated.
111+
withSourcesJar()
112+
113+
val java = if (stonecutter.eval(stonecutter.current.version, ">=1.20.5"))
114+
JavaVersion.VERSION_21 else JavaVersion.VERSION_17
115+
116+
targetCompatibility = java
117+
sourceCompatibility = java
118+
}
119+
120+
tasks.jar {
121+
inputs.property("archivesName", project.base.archivesName)
122+
123+
from("LICENSE") {
124+
rename { "${it}_${base.archivesName}"}
125+
}
126+
}

gradle.properties

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,8 @@
22
org.gradle.jvmargs=-Xmx1G
33
org.gradle.parallel=true
44
# Fabric Properties
5-
minecraft_version=1.20.1
6-
yarn_mappings=1.20.1+build.10
75
loader_version=0.16.9
86
# Mod Properties
97
mod_version=1.0.1+1.20.1
108
maven_group=survivalblock.shield_surf
11-
archives_base_name=shield_surf
12-
# Dependencies
13-
cardinal_components_version=5.2.2
14-
midnightlib_version=1.4.1-fabric
15-
fabric_version=0.91.0+1.20.1
16-
sodium_version=mc1.20.1-0.5.3
17-
mod_menu_version=7.2.2
18-
fabric_shield_lib_version=1.7.2-1.20.1
19-
yet_another_config_lib_version=3.6.1+1.20.1-fabric
9+
archives_base_name=shield_surf

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

settings.gradle

Lines changed: 0 additions & 10 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pluginManagement {
2+
repositories {
3+
maven("https://maven.fabricmc.net/") { name = "Fabric" }
4+
mavenCentral()
5+
gradlePluginPortal()
6+
maven("https://maven.kikugie.dev/releases") { name = "KikuGie Releases" }
7+
maven("https://maven.kikugie.dev/snapshots") { name = "KikuGie Snapshots" }
8+
}
9+
}
10+
11+
plugins {
12+
id("dev.kikugie.stonecutter") version "0.7.10"
13+
}
14+
15+
stonecutter {
16+
kotlinController = true
17+
centralScript = "build.gradle.kts"
18+
19+
// Subproject configuration
20+
create(rootProject) {
21+
versions("1.20.1")
22+
vcsVersion = "1.20.1"
23+
}
24+
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
"depends": {
3939
"fabricloader": "*",
40-
"minecraft": "~1.20.1",
40+
"minecraft": ">=1.20.1",
4141
"java": ">=17",
4242
"fabric-api": ">=0.84.0"
4343
},

stonecutter.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
plugins {
2+
id("dev.kikugie.stonecutter")
3+
}
4+
stonecutter active "1.20.1"

versions/1.20.1/gradle.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
deps.yarn_mappings=1.20.1+build.10
2+
deps.fabric_api=0.91.0+1.20.1
3+
4+
deps.cca=5.2.2
5+
deps.midnightlib=1.4.1-fabric
6+
deps.sodium=mc1.20.1-0.5.3
7+
deps.modmenu=7.2.2
8+
deps.fabric_shield_lib=1.7.2-1.20.1
9+
deps.yacl=3.6.1+1.20.1-fabric
10+
11+
# Modrinth
12+
deps.compatibleVersions=1.21.8
13+
deps.compatibleLoaders=fabric

0 commit comments

Comments
 (0)