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 14, 2024
1 parent 87a28fc commit 9e7cf70
Show file tree
Hide file tree
Showing 92 changed files with 738 additions and 1,564 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.

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

- Nothing new.

## [4.0.0] - 2024/07/04
## [v5.0.0] - 2024/07/14

- Ported to 1.21.
- Officially dropped support for Forge.
- Cobweb minimum version is now `v1.1.2`.
- Renamed data folder from plural to singular to comply with the new Minecraft standard.
- Added Soft Step as a data driven enchantment.
- Added every leathered boots registered via the API to Minecraft `dyeable` and `foot_armor` item tags too (before they were only in `trimmable_armor` and `freeze_immune_wearables`).
- `BiomesCheck` and `BiomesPredicate` are now both `record`s rather than a final classes.
- `LeatheredArmorMaterial` has been removed due to changes in Minecraft `ArmorMaterial`.
- `LeatheredBootsItem` now take in a `Holder` for the `ArmorMaterial` and a durability factor multiplier.
- `LeatheredBootsItem` now extend `ArmorItem`.
- Changed how `LeatheredBootsItem` are registered: first an instance of `BootsRegister` must be created with `LeatheredBootsManager#register(String)` passing a mod ID, then register each pair of boots one at a time with it.
- A `ResourceLocation` is now required to get a `LeatheredBootsItem` from the `LeatheredBootsManager` instead of a `LeatheredArmorMaterial`.

## [v4.0.0] - 2024/07/04

- Update to the newest standards.
- Add more language translations.
Expand Down Expand Up @@ -100,7 +115,8 @@ and this project adheres to [Crystal Nest Semantic Versioning](https://crystalne
[Unreleased]: https://github.com/crystal-nest/leathered-boots
[README]: https://github.com/crystal-nest/leathered-boots#readme

[4.0.0]: https://github.com/crystal-nest/leathered-boots/releases?q=4.0.0
[v5.0.0]: https://github.com/crystal-nest/leathered-boots/releases?q=5.0.0
[v4.0.0]: https://github.com/crystal-nest/leathered-boots/releases?q=4.0.0

[1.20.4-3.0.0.0]: https://github.com/crystal-nest/leathered-boots/releases/tag/v1.20.4-3.0.0.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 @@
![Leathered Boots banner](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/leathered-boots/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/leathered-boots/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/crystal-nest/mod-fancy-assets/main/minecraft/1-20-2.svg)](https://modrinth.com/mod/leathered-boots/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/leathered-boots/versions?g=1.20.1)![Separator](https://raw.githubusercontent.com/Nyphet/mod-fancy-assets/main/separator.svg)[![1.19.4](https://raw.githubusercontent.com/Nyphet/mod-fancy-assets/main/minecraft/1-19-4.svg)](https://modrinth.com/mod/leathered-boots/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/leathered-boots/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/leathered-boots/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)](https://modrinth.com/mod/leathered-boots/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/leathered-boots/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/crystal-nest/mod-fancy-assets/main/minecraft/1-20-2.svg)](https://modrinth.com/mod/leathered-boots/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/leathered-boots/versions?g=1.20.1)![Separator](https://raw.githubusercontent.com/Nyphet/mod-fancy-assets/main/separator.svg)[![1.19.4](https://raw.githubusercontent.com/Nyphet/mod-fancy-assets/main/minecraft/1-19-4.svg)](https://modrinth.com/mod/leathered-boots/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/leathered-boots/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/leathered-boots/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/leathered-boots/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/leathered-boots/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/leathered-boots/versions?l=fabric)

Expand Down
239 changes: 3 additions & 236 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,253 +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"
}
exclusiveContent {
forRepository {
maven {
url "https://cursemaven.com"
}
}
filter {
includeGroup "curse.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,
]

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("both") // "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"
switch (loader) {
case "Fabric":
required "fabric-api"
break
case "Forge":
break
case "NeoForge":
break
}
}
curseDepends {
required "cobweb"
switch (loader) {
case "Fabric":
required "fabric-api"
break
case "Forge":
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 9e7cf70

Please sign in to comment.