1
0
mirror of https://github.com/GeyserMC/Rainbow.git synced 2025-12-19 14:59:16 +00:00

Create version catalog

This commit is contained in:
Eclipse
2025-10-13 16:10:04 +00:00
parent e57460b76b
commit 954bb9b223
5 changed files with 47 additions and 34 deletions

View File

@@ -1,18 +1,11 @@
plugins { plugins {
id("fabric-loom") version "1.11-SNAPSHOT" alias(libs.plugins.fabric.loom)
} }
val minecraftVersion = properties["minecraft_version"]!! as String version = properties["mod_version"]!! as String
val parchmentVersion = properties["parchment_version"]!! as String group = properties["maven_group"]!! as String
val loaderVersion = properties["loader_version"]!! as String
val modVersion = properties["mod_version"]!! as String
val supportedVersions = properties["supported_versions"]!! as String
val archivesBaseName = properties["archives_base_name"]!! as String val archivesBaseName = properties["archives_base_name"]!! as String
val fabricVersion = properties["fabric_version"]!! as String
val packConverterVersion = properties["pack_converter_version"]!! as String
val targetJavaVersion = 21 val targetJavaVersion = 21
repositories { repositories {
@@ -33,34 +26,36 @@ repositories {
} }
dependencies { dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}") minecraft(libs.minecraft)
mappings(loom.layered { mappings(loom.layered {
officialMojangMappings() officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchmentVersion}@zip") parchment(libs.parchment)
}) })
modImplementation("net.fabricmc:fabric-loader:${loaderVersion}") modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.api)
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabricVersion}") implementation(libs.creative.api)
implementation(libs.creative.serializer.minecraft)
include(implementation("com.github.GeyserMC.unnamed-creative:creative-api:817fa982c4")!!) implementation(libs.packconverter)
include(implementation("com.github.GeyserMC.unnamed-creative:creative-serializer-minecraft:817fa982c4")!!) include(libs.creative.api)
include(implementation("org.geysermc.pack:converter:${packConverterVersion}")!!) include(libs.creative.serializer.minecraft)
include(libs.packconverter)
} }
tasks { tasks {
processResources { processResources {
inputs.property("version", modVersion) inputs.property("version", version)
inputs.property("supported_versions", supportedVersions) inputs.property("supported_versions", libs.versions.minecraft.supported.get())
inputs.property("loader_version", loaderVersion) inputs.property("loader_version", libs.versions.fabric.loader.get())
filteringCharset = "UTF-8" filteringCharset = "UTF-8"
filesMatching("fabric.mod.json") { filesMatching("fabric.mod.json") {
expand( expand(
mapOf( mapOf(
"version" to modVersion, "version" to version,
"supported_versions" to supportedVersions, "supported_versions" to libs.versions.minecraft.supported.get(),
"loader_version" to loaderVersion "loader_version" to libs.versions.fabric.loader.get()
) )
) )
} }

View File

@@ -1,16 +1,6 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.21.10
parchment_version=1.21.10:2025.10.12
loader_version=0.17.3
# Mod Properties # Mod Properties
mod_version=0.1.0-1.21.10 mod_version=0.1.0-1.21.10
supported_versions=>=1.21.9 <=1.21.10
maven_group=org.geysermc maven_group=org.geysermc
archives_base_name=rainbow archives_base_name=rainbow
# Dependencies
fabric_version=0.135.0+1.21.10
pack_converter_version=3.4.1-SNAPSHOT

25
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,25 @@
[versions]
minecraft = "1.21.10"
minecraft-supported = ">=1.21.9 <=1.21.10"
parchment = "2025.10.12"
fabric-loom = "1.11-SNAPSHOT"
fabric-loader = "0.17.3"
fabric-api = "0.135.0+1.21.10"
creative = "817fa982c4"
packconverter = "3.4.1-SNAPSHOT"
[libraries]
minecraft = {group = "com.mojang", name = "minecraft", version.ref = "minecraft"}
parchment = {group = "org.parchmentmc.data", name = "parchment-1.21.10", version.ref = "parchment"}
fabric-loader = {group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader"}
fabric-api = {group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api"}
creative-api = {group = "com.github.GeyserMC.unnamed-creative", name = "creative-api", version.ref = "creative"}
creative-serializer-minecraft = {group = "com.github.GeyserMC.unnamed-creative", name = "creative-serializer-minecraft", version.ref = "creative"}
packconverter = {group = "org.geysermc.pack", name = "converter", version.ref = "packconverter"}
[plugins]
fabric-loom = {id = "fabric-loom", version.ref = "fabric-loom"}

View File

@@ -7,3 +7,5 @@ pluginManagement {
gradlePluginPortal() gradlePluginPortal()
} }
} }
rootProject.name = "Rainbow"

View File

@@ -18,6 +18,7 @@ import java.util.Optional;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class MinecraftCreativeResourcePack extends CachingStreamResourceContainer implements ImmutableResourcePack { public class MinecraftCreativeResourcePack extends CachingStreamResourceContainer implements ImmutableResourcePack {
// Matches a path in 3 groups: the first directory, the rest of the path, and the file extension (e.g. .json)
private static final Pattern PATH_SANITIZE_REGEX = Pattern.compile("(^\\w+/)(.*)(\\.\\w+$)"); private static final Pattern PATH_SANITIZE_REGEX = Pattern.compile("(^\\w+/)(.*)(\\.\\w+$)");
private final ResourceManager resourceManager; private final ResourceManager resourceManager;