Skip to content

Commit 954bb9b

Browse files
Create version catalog
1 parent e57460b commit 954bb9b

File tree

5 files changed

+47
-34
lines changed

5 files changed

+47
-34
lines changed

build.gradle.kts

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
plugins {
2-
id("fabric-loom") version "1.11-SNAPSHOT"
2+
alias(libs.plugins.fabric.loom)
33
}
44

5-
val minecraftVersion = properties["minecraft_version"]!! as String
6-
val parchmentVersion = properties["parchment_version"]!! as String
7-
val loaderVersion = properties["loader_version"]!! as String
5+
version = properties["mod_version"]!! as String
6+
group = properties["maven_group"]!! as String
87

9-
val modVersion = properties["mod_version"]!! as String
10-
val supportedVersions = properties["supported_versions"]!! as String
118
val archivesBaseName = properties["archives_base_name"]!! as String
12-
13-
val fabricVersion = properties["fabric_version"]!! as String
14-
val packConverterVersion = properties["pack_converter_version"]!! as String
15-
169
val targetJavaVersion = 21
1710

1811
repositories {
@@ -33,34 +26,36 @@ repositories {
3326
}
3427

3528
dependencies {
36-
minecraft("com.mojang:minecraft:${minecraftVersion}")
29+
minecraft(libs.minecraft)
3730
mappings(loom.layered {
3831
officialMojangMappings()
39-
parchment("org.parchmentmc.data:parchment-${parchmentVersion}@zip")
32+
parchment(libs.parchment)
4033
})
4134

42-
modImplementation("net.fabricmc:fabric-loader:${loaderVersion}")
43-
44-
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabricVersion}")
35+
modImplementation(libs.fabric.loader)
36+
modImplementation(libs.fabric.api)
4537

46-
include(implementation("com.github.GeyserMC.unnamed-creative:creative-api:817fa982c4")!!)
47-
include(implementation("com.github.GeyserMC.unnamed-creative:creative-serializer-minecraft:817fa982c4")!!)
48-
include(implementation("org.geysermc.pack:converter:${packConverterVersion}")!!)
38+
implementation(libs.creative.api)
39+
implementation(libs.creative.serializer.minecraft)
40+
implementation(libs.packconverter)
41+
include(libs.creative.api)
42+
include(libs.creative.serializer.minecraft)
43+
include(libs.packconverter)
4944
}
5045

5146
tasks {
5247
processResources {
53-
inputs.property("version", modVersion)
54-
inputs.property("supported_versions", supportedVersions)
55-
inputs.property("loader_version", loaderVersion)
48+
inputs.property("version", version)
49+
inputs.property("supported_versions", libs.versions.minecraft.supported.get())
50+
inputs.property("loader_version", libs.versions.fabric.loader.get())
5651
filteringCharset = "UTF-8"
5752

5853
filesMatching("fabric.mod.json") {
5954
expand(
6055
mapOf(
61-
"version" to modVersion,
62-
"supported_versions" to supportedVersions,
63-
"loader_version" to loaderVersion
56+
"version" to version,
57+
"supported_versions" to libs.versions.minecraft.supported.get(),
58+
"loader_version" to libs.versions.fabric.loader.get()
6459
)
6560
)
6661
}

gradle.properties

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
org.gradle.jvmargs=-Xmx1G
22

3-
# Fabric Properties
4-
minecraft_version=1.21.10
5-
parchment_version=1.21.10:2025.10.12
6-
loader_version=0.17.3
7-
83
# Mod Properties
94
mod_version=0.1.0-1.21.10
10-
supported_versions=>=1.21.9 <=1.21.10
115
maven_group=org.geysermc
126
archives_base_name=rainbow
13-
14-
# Dependencies
15-
fabric_version=0.135.0+1.21.10
16-
pack_converter_version=3.4.1-SNAPSHOT

gradle/libs.versions.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[versions]
2+
minecraft = "1.21.10"
3+
minecraft-supported = ">=1.21.9 <=1.21.10"
4+
parchment = "2025.10.12"
5+
6+
fabric-loom = "1.11-SNAPSHOT"
7+
fabric-loader = "0.17.3"
8+
fabric-api = "0.135.0+1.21.10"
9+
10+
creative = "817fa982c4"
11+
packconverter = "3.4.1-SNAPSHOT"
12+
13+
[libraries]
14+
minecraft = {group = "com.mojang", name = "minecraft", version.ref = "minecraft"}
15+
parchment = {group = "org.parchmentmc.data", name = "parchment-1.21.10", version.ref = "parchment"}
16+
17+
fabric-loader = {group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader"}
18+
fabric-api = {group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api"}
19+
20+
creative-api = {group = "com.github.GeyserMC.unnamed-creative", name = "creative-api", version.ref = "creative"}
21+
creative-serializer-minecraft = {group = "com.github.GeyserMC.unnamed-creative", name = "creative-serializer-minecraft", version.ref = "creative"}
22+
packconverter = {group = "org.geysermc.pack", name = "converter", version.ref = "packconverter"}
23+
24+
[plugins]
25+
fabric-loom = {id = "fabric-loom", version.ref = "fabric-loom"}

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ pluginManagement {
77
gradlePluginPortal()
88
}
99
}
10+
11+
rootProject.name = "Rainbow"

src/main/java/org/geysermc/rainbow/creative/MinecraftCreativeResourcePack.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.regex.Pattern;
1919

2020
public class MinecraftCreativeResourcePack extends CachingStreamResourceContainer implements ImmutableResourcePack {
21+
// Matches a path in 3 groups: the first directory, the rest of the path, and the file extension (e.g. .json)
2122
private static final Pattern PATH_SANITIZE_REGEX = Pattern.compile("(^\\w+/)(.*)(\\.\\w+$)");
2223

2324
private final ResourceManager resourceManager;

0 commit comments

Comments
 (0)