Skip to content

Commit

Permalink
update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Mar 31, 2024
1 parent 727c8a3 commit 5ea6f5d
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 154 deletions.
134 changes: 87 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
plugins {
id "maven-publish"
alias libs.plugins.quilt.loom
alias libs.plugins.chenille
}

def ENV = System.getenv()
def buildTime = ENV.BUILD_TIME ?: new Date().format("yyyyMMddHHmmss")
// messy workaround for bug in quilt loom 1.3.3+
project.configurations.configureEach {
exclude(group: "net.fabricmc", module: "fabric-loader")
exclude(group: "net.fabricmc.fabric-api")
}

// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
project.ext.javaVersion = 17
def javaVersion = 17

archivesBaseName = "Soulbound"
group = "dev.upcraft"
group = project.maven_group_id

def ENV = System.getenv()
def NOW = new Date();
def buildTime = ENV.BUILD_TIME ?: NOW.format('yyyyMMddHHmmss')

boolean isPreviewBuild = !ENV.TAG || ENV.TAG.matches(".+-.+")
def buildNumber = !ENV.TAG ? ("${ENV.BUILD_NUMBER ? "build.${ENV.BUILD_NUMBER}" : buildTime}-${libs.versions.minecraft.get()}") : ""
version = (ENV.TAG ?: "development") + ((isPreviewBuild && !ENV.TAG) ? "+${buildNumber}" : "")
def buildNumber = !ENV.TAG ? ("${ENV.BUILD_NUMBER ? "build.${ENV.BUILD_NUMBER}" : buildTime}") : ""
version = (ENV.TAG ?: "${libs.versions.minecraft.get()}-development") + ((isPreviewBuild && !ENV.TAG) ? "+${buildNumber}" : "")

println("Building ${project.name} ${version}")

//FIXME workaround for quilt-loom bug
project.configurations.configureEach {
exclude(group: "net.fabricmc", module: "fabric-loader")
exclude(group: "net.fabricmc.fabric-api")
}

chenille {
javaVersion = project.ext.javaVersion
repositories {
ladysnake()
modrinth()
terraformers()
}
base {
archivesName = "${rootProject.name}-Quilt"
}

repositories {
Expand All @@ -43,64 +37,99 @@ repositories {
name = "Up-Mods"
url = "https://maven.uuid.gg/releases"
}
maven {
name = "Ladysnake"
url = "https://maven.ladysnake.org/releases"
}
maven {
// needed for polymer
name = "NucleoidMC"
url = "https://maven.nucleoid.xyz"
}
maven {
name = "TeamResourceful"
url = "https://maven.teamresourceful.com/repository/maven-releases"
}
maven {
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/releases"
}
maven {
// needed for fabric permissions api
name = "Sonatype Snapshots"
url = "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
name "Modrinth"
url "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}

// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
dependencies {
minecraft libs.minecraft
mappings(loom.layered {
it.mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
it.parchment("${libs.parchment.mappings.get()}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
mappings(loom.layered {
it.parchment("${libs.parchment.mappings.get()}@zip")
it.officialMojangMappings()
})
modImplementation libs.quilt.loader

// QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps.
// Quilted Fabric API will automatically pull in the correct QSL version.
modImplementation libs.quilted.fabric.api
modLocalRuntime libs.quilted.fabric.api.deprecated
modLocalRuntime (libs.quilted.fabric.api.deprecated) {
transitive = false
}

modImplementation libs.sparkweave

modImplementation libs.midnightlib
modImplementation libs.resourcefulconfig.fabric

annotationProcessor libs.mixinextras
modIncludeApi libs.mixinextras

modLocalImplementation libs.emi
modCompileOnly libs.emi
modLocalRuntime libs.emi

modLocalRuntime libs.modmenu

modLocalImplementation libs.universal.graves
modLocalRuntime libs.bundles.universal.graves.dependencies
modCompileOnly libs.universalgraves
modLocalRuntime libs.bundles.universalgraves.runtime

modLocalImplementation libs.trinkets
modCompileOnly libs.trinkets
modLocalRuntime libs.trinkets

modLocalRuntime libs.lazydfu
}

loom {
mods {
"${project.mod_id}" {
sourceSet("main")
}
}
mixin {
defaultRefmapName.set("${project.mod_id}.refmap.json")
}
}

processResources {
inputs.property "version", version
filteringCharset = "UTF-8"

filesMatching("quilt.mod.json") {
expand "version": version
}
}
def expandProps = [
"version" : version,
"maven_group_id" : maven_group_id,
"mod_id" : mod_id,
"minecraft_version" : libs.versions.minecraft.get(),

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release.set(project.ext.javaVersion)
"quilt_loader_version": libs.versions.quilt.loader.get(),
]

filesMatching(['*.mod.json', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}

java {
Expand All @@ -116,10 +145,9 @@ java {

// If you plan to use a different file for the license, don't forget to change the file name here!
jar {
from(layout.projectDirectory) {
include "LICENSE.md"
rename { "LICENSE_${archivesBaseName}.md" }
}
from('LICENSE.md') {
rename { "LICENSE_${base.archivesName.get()}.md" }
}

manifest.mainAttributes(
"Implementation-Title": project.archivesBaseName,
Expand All @@ -130,10 +158,22 @@ jar {
)
}

sourcesJar {
from('LICENSE.md') {
rename { "LICENSE_${base.archivesName.get()}.md" }
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release.set(javaVersion)
}

// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// artifactId "${rootProject.name}-Quilt"
from components.java
}
}
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Gradle Properties
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# Dependencies are managed at gradle/libs.versions.toml
# Metadata
mod_id=soulbound

# Publishing
maven_group_id=dev.upcraft
68 changes: 31 additions & 37 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,67 +1,61 @@
[versions]
# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html
chenille = "0.11.+"
quilt_loom = "1.3.+"
quilt_loom = "1.5.+"

minecraft = "1.20.1"
quilt_mappings = "1.20.1+build.23"
quilt_loader = "0.20.2"
minecraft = "1.20.4"
quilt_loader = "0.24.0"

parchment = "2023.09.03"
emi = "1.0.19+1.20.1"
modmenu = "7.2.2"
midnightlib = "1.4.1-quilt"
parchment = "2024.02.25"
emi = "1.1.4+1.20.4"
modmenu = "9.0.0"
resourcefulconfig = "2.4.5"
lazydfu = "0.1.3"
mixinextras = "0.2.0-rc.4"
sparkweave = "0.3.0"
sparkweave = "0.200.0"

universal_graves = "3.0.0+1.20.1"
sgui = "1.2.2+1.20"
palceholder_api = "2.1.3+1.20.1"
server_translations_api = "2.0.0+1.20"
polymer = "0.5.15+1.20.1"
predicate_api = "0.2.1+1.20.1"
common_protection_api = "1.0.0"
fabric_permissions_api = "0.2-SNAPSHOT"
universalgraves = "3.2.1+1.20.3"
sgui = "1.4.1+1.20.4"
placeholder-api = "2.3.0+1.20.3"
polymer = "0.7.7+1.20.4"
predicate-api = "0.3.0+1.20.2"
common-protection-api = "1.0.0"
server-translations-api = "2.2.0+1.20.3-rc1"
fabric-permissions-api = "0.2-SNAPSHOT"

trinkets = "3.7.1"
trinkets = "3.8.1"

quilted_fabric_api = "7.1.2+0.87.0-1.20.1"
quilted_fabric_api = "9.0.0-alpha.5+0.96.11-1.20.4"

[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
parchment_mappings = { module = "org.parchmentmc.data:parchment-1.20.1", version.ref = "parchment" }
parchment_mappings = { module = "org.parchmentmc.data:parchment-1.20.4", version.ref = "parchment" }
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }
mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" }
sparkweave = { module = "dev.upcraft:Sparkweave", version.ref = "sparkweave" }
sparkweave = { module = "dev.upcraft.sparkweave:Sparkweave-Quilt", version.ref = "sparkweave" }

quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
quilted_fabric_api_deprecated = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated", version.ref = "quilted_fabric_api" }

emi = { module = "dev.emi:emi-fabric", version.ref = "emi" }
modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }
midnightlib = { module = "maven.modrinth:midnightlib", version.ref = "midnightlib" }
resourcefulconfig_fabric = { module = "com.teamresourceful.resourcefulconfig:resourcefulconfig-fabric-1.20.4", version.ref = "resourcefulconfig" }
lazydfu = { module = "maven.modrinth:lazydfu", version.ref = "lazydfu" }

universal_graves = { module = "maven.modrinth:universal-graves", version.ref = "universal_graves" }
universalgraves = { module = "maven.modrinth:universal-graves", version.ref = "universalgraves" }
sgui = { module = "eu.pb4:sgui", version.ref = "sgui" }
palceholder_api = { module = "eu.pb4:placeholder-api", version.ref = "palceholder_api" }
server_translations_api = { module = "xyz.nucleoid:server-translations-api", version.ref = "server_translations_api" }
polymer_core = { module = "eu.pb4:polymer-core", version.ref = "polymer" }
polymer_resource_pack = { module = "eu.pb4:polymer-resource-pack", version.ref = "polymer" }
polymer_virtual_entity = { module = "eu.pb4:polymer-virtual-entity", version.ref = "polymer" }
predicate_api = { module = "eu.pb4:predicate-api", version.ref = "predicate_api" }
common_protection_api = { module = "eu.pb4:common-protection-api", version.ref = "common_protection_api" }
fabric_permissions_api = { module = "me.lucko:fabric-permissions-api", version.ref = "fabric_permissions_api" }
placeholder-api = { module = "eu.pb4:placeholder-api", version.ref = "placeholder-api" }
polymer-core = { module = "eu.pb4:polymer-core", version.ref = "polymer" }
polymer-resource-pack = { module = "eu.pb4:polymer-resource-pack", version.ref = "polymer" }
polymer-virtual-entity = { module = "eu.pb4:polymer-virtual-entity", version.ref = "polymer" }
predicate-api = { module = "eu.pb4:predicate-api", version.ref = "predicate-api" }
common-protection-api = { module = "eu.pb4:common-protection-api", version.ref = "common-protection-api" }
server-translations-api = { module = "xyz.nucleoid:server-translations-api", version.ref = "server-translations-api" }
fabric-permissions-api = { module = "me.lucko:fabric-permissions-api", version.ref = "fabric-permissions-api" }

trinkets = { module = "dev.emi:trinkets", version.ref = "trinkets" }

# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
[bundles]
quilted_fabric_api = ["quilted_fabric_api", "quilted_fabric_api_deprecated"]
universal_graves_dependencies = ["sgui", "palceholder_api", "server_translations_api", "polymer_core", "polymer_resource_pack", "polymer_virtual_entity", "predicate_api", "common_protection_api", "fabric_permissions_api"]
universalgraves_runtime = ["universalgraves", "sgui", "placeholder-api", "polymer-core", "polymer-resource-pack", "polymer-virtual-entity", "predicate-api", "common-protection-api", "server-translations-api", "fabric-permissions-api"]

[plugins]
quilt_loom = { id = "org.quiltmc.loom", version.ref = "quilt_loom" }
chenille = { id = "io.github.ladysnake.chenille", version.ref = "chenille" }
Loading

0 comments on commit 5ea6f5d

Please sign in to comment.