Skip to content

Commit

Permalink
Port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Jul 10, 2024
1 parent 5033805 commit 1c4efd1
Show file tree
Hide file tree
Showing 35 changed files with 436 additions and 630 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ out
*.ipr
*.iws
*.iml
.idea/*
!.idea/scopes
.idea

# gradle
build
Expand Down
3 changes: 0 additions & 3 deletions .idea/scopes/Fabric_sources.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/scopes/Forge_sources.xml

This file was deleted.

8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ and this project adheres to [Crystal Nest Semantic Versioning](https://crystalne

- Nothing new.

## [7.0.0] - 2024/06/24
## [v7.0.0] - 2024/07/10

- Ported to 1.21.

## [v7.0.0] - 2024/06/24

- Improve Soul Fire'd compatibility and update to v4.0.2.
- Upgrade to a multiloader environment and update standards.
Expand Down Expand Up @@ -195,7 +199,7 @@ and this project adheres to [Crystal Nest Semantic Versioning](https://crystalne
[Unreleased]: https://github.com/crystal-nest/torch-hit
[README]: https://github.com/crystal-nest/torch-hit#readme

[7.0.0]: https://github.com/crystal-nest/torch-hit/releases?q=7.0.0
[v7.0.0]: https://github.com/crystal-nest/torch-hit/releases?q=7.0.0

[1.20.4-6.0.2.0]: https://github.com/crystal-nest/torch-hit/releases/tag/v1.20.4-6.0.2.0
[1.20.2-6.0.2.0]: https://github.com/crystal-nest/torch-hit/releases/tag/v1.20.2-6.0.2.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Torch hit! banner](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/torch-hit/banner.gif)

---
![Minecraft](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/minecraft.svg)[![1.20.4](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-20-4.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.20.4)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.20.2](https://raw.githubusercontent.com/Nyphet/mod-fancy-assets/main/minecraft/1-20-2.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.20.2)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.20.1](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-20-1.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.20.1)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.19.4](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-19-4.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.19.4)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.19.2](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-19-2.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.19.2)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.18.2](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-18-2.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.18.2)
![Minecraft](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/minecraft.svg)[![1.21](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-21.svg "1.21")](https://modrinth.com/mod/torch-hit/versions?g=1.21)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.20.4](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-20-4.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.20.4)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.20.2](https://raw.githubusercontent.com/Nyphet/mod-fancy-assets/main/minecraft/1-20-2.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.20.2)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.20.1](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-20-1.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.20.1)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.19.4](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-19-4.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.19.4)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.19.2](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-19-2.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.19.2)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![1.18.2](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/minecraft/1-18-2.svg)](https://modrinth.com/mod/torch-hit/versions?g=1.18.2)

![Loader](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/loader/loader.svg)[![NeoForge](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/loader/neoforge.svg)](https://modrinth.com/mod/torch-hit/versions?l=neoforge)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![Forge](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/loader/forge.svg)](https://modrinth.com/mod/torch-hit/versions?l=forge)![Separator](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/separator.svg)[![Fabric](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/loader/fabric.svg)](https://modrinth.com/mod/torch-hit/versions?l=fabric)

Expand Down
241 changes: 3 additions & 238 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,255 +1,20 @@
plugins {
id "org.sonarqube" version "4.4.1.3373"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
id "com.hypherionmc.modutils.modpublisher" version "2.1.4" apply false
id "fabric-loom" version "1.5-SNAPSHOT" apply false
id "net.neoforged.moddev" version "0.1.110" apply false
id "fabric-loom" version "1.7-SNAPSHOT" apply false
}

sonar {
properties {
property "sonar.projectKey", "Crystal-Nest_${mod_id_kebab}"
property "sonar.projectKey", "Crystal-Nest_$mod_id_kebab"
property "sonar.organization", "crystal-nest"
property "sonar.projectVersion", mod_version
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.qualitygate.wait", "true"
}
}

subprojects { subproject ->
def noPublish = subproject.name === "common"
def isFabric = subproject.name == "fabric"

apply plugin: "java"
apply plugin: "idea"
apply plugin: "java-library"
apply plugin: "com.hypherionmc.modutils.modpublisher"
apply plugin: "maven-publish"
if (isFabric) {
apply plugin: "fabric-loom"
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
java.withJavadocJar()

archivesBaseName = "${mod_id_kebab}-${subproject.name}"
version = "${minecraft_version}-${mod_version}"

jar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_title}" }
}
manifest {
attributes([
"Specification-Title" : mod_title,
"Specification-Vendor" : mod_authors,
"Specification-Version" : project.version,
"Implementation-Title" : mod_title,
"Implementation-Vendor" : mod_authors,
"Implementation-Version" : project.version,
"Implementation-URL" : "https://github.com/${github_user}/${mod_id_kebab}/tree/${minecraft_version}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Timestamp" : System.currentTimeMillis(),
"Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
"Built-On-Minecraft" : minecraft_version
])
}
}

sourcesJar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_title}" }
}
}

repositories {
mavenCentral()
maven {
name = "Sponge / Mixin"
url = "https://repo.spongepowered.org/repository/maven-public/"
}
maven {
name = "Crystal Nest"
url = "https://maven.crystalnest.it"
}
maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
}

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

processResources {
def expandProps = [
"mod_version" : mod_version,
"group" : project.group,
"mod_authors" : mod_authors,
"mod_title" : mod_title,
"mod_id" : mod_id,
"mod_id_kebab" : mod_id_kebab,
"license" : license,
"description" : project.description,
"credits" : credits,
"github_user" : github_user,
"curseforge_id" : curseforge_id,
"minecraft_version" : minecraft_version,
"minecraft_version_range" : minecraft_version_range,
"fabric_version" : fabric_version,
"fabric_loader_version" : fabric_loader_version,
"forge_version" : forge_version,
"forge_loader_version_range" : forge_loader_version_range,
"neoforge_version" : neoforge_version,
"neoforge_loader_version_range": neoforge_loader_version_range,
"cobweb_version" : cobweb_version,
"fcap_version" : fcap_version,
"soul_fire_d_version" : soul_fire_d_version,
]

filesMatching(["pack.mcmeta", "fabric.mod.json", "META-INF/mods.toml", "*.mixins.json"]) {
expand expandProps
}
inputs.properties(expandProps)
}

tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}

def changelog_body = "See [Changelog](https://github.com/${github_user}/${mod_id_kebab}/blob/master/CHANGELOG.md#v${mod_version.replaceAll('\\.', '')}---${new Date().format("yyyyMMdd")})."
def version_type = mod_version.replaceFirst("([0-9]+\\.?)+-?", "") ?: "release"
def loader = "Common"
switch (subproject.name) {
case "fabric":
loader = "Fabric"
break
case "forge":
loader = "Forge"
break
case "neoforge":
loader = "NeoForge"
break
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${github_user}/${mod_id_kebab}")
credentials {
username = github_user
password = System.getenv("GITHUB_TOKEN") ?: ""
}
}
}
publications {
gpr(MavenPublication) {
groupId = project.group
artifactId = "${mod_id_kebab}-${loader.toLowerCase()}"
version = project.version
from components.java
pom {
name = "[${loader} - ${minecraft_version}] ${mod_title} v${mod_version}"
description = "${description}"
url = "https://github.com/${github_user}/${mod_id_kebab}/tree/${minecraft_version}"
issueManagement {
system = "github"
url = "https://github.com/${github_user}/${mod_id_kebab}/issues"
}
licenses {
license {
name = license
url = "https://spdx.org/licenses/${license}.html"
}
}
developers {
mod_authors.split(", ").each { author ->
developer {
id = author.toLowerCase()
name = author
}
}
}
}
}
}
}

publisher {
apiKeys {
github System.getenv("GITHUB_TOKEN") ?: ""
modrinth System.getenv("MODRINTH_TOKEN") ?: ""
curseforge System.getenv("CURSEFORGE_TOKEN") ?: ""
}
setDebug(noPublish)
setVersion(mod_version)
setChangelog(changelog_body)
setVersionType(version_type)
setArtifact(isFabric ? remapJar : jar)
setDisableMalwareScanner(true) // Disable the built in Fractureizer scanner.
setDisableEmptyJarCheck(true) // Disable check for valid mod metadata entry in artifact, which could possibly mean that the jar is empty.
setModrinthID(mod_id_kebab)
setCurseID(curseforge_id)
if (!noPublish) {
setLoaders(loader)
}
setGameVersions(minecraft_version)
setDisplayName("[${loader} - ${minecraft_version}] ${mod_title} v${mod_version}")
setJavaVersions([JavaVersion.VERSION_17])
setCurseEnvironment("server") // "server", "client" or "both".
github {
repo = "${github_user}/${mod_id_kebab}"
tag = "v${project.version}"
displayName("v${project.version}")
target = minecraft_version
createTag = true
createRelease = true
updateRelease = true
draft = false
}
modrinthDepends {
required "cobweb"
optional "soul-fire-d"
switch (loader) {
case "Fabric":
required "fabric-api"
required "forge-config-api-port"
break
case "Forge":
required "forge-config-api-port"
break
case "NeoForge":
break
}
}
curseDepends {
required "cobweb"
optional "soul-fire-d"
switch (loader) {
case "Fabric":
required "fabric-api"
required "forge-config-api-port-fabric"
break
case "Forge":
required "forge-config-api-port-fabric"
break
case "NeoForge":
break
}
}
}

tasks.register("publishLoader") {
group = "publishing"
description = "Publish ${loader} specific versions to all platforms"
dependsOn "publish"
dependsOn "publishMod"
}
}

tasks.register("publishAll") {
group = "publishing"
description = "Publish all loader specific versions to all platforms"
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id "groovy-gradle-plugin"
}
Loading

0 comments on commit 1c4efd1

Please sign in to comment.