diff --git a/.gitignore b/.gitignore
index 461017f..e23bd4c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,8 +11,7 @@ out
*.ipr
*.iws
*.iml
-.idea/*
-!.idea/scopes
+.idea
# gradle
build
diff --git a/.idea/scopes/Fabric_sources.xml b/.idea/scopes/Fabric_sources.xml
deleted file mode 100644
index 0448412..0000000
--- a/.idea/scopes/Fabric_sources.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/scopes/Forge_sources.xml b/.idea/scopes/Forge_sources.xml
deleted file mode 100644
index 7b5f24d..0000000
--- a/.idea/scopes/Forge_sources.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3446c53..85ac657 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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.
@@ -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
diff --git a/README.md b/README.md
index 6d17c51..7732063 100644
--- a/README.md
+++ b/README.md
@@ -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)
diff --git a/build.gradle b/build.gradle
index f5d450d..006c00d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,13 +1,13 @@
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"
@@ -15,239 +15,6 @@ sonar {
}
}
-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"
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
new file mode 100644
index 0000000..0aa2ba4
--- /dev/null
+++ b/buildSrc/build.gradle
@@ -0,0 +1,3 @@
+plugins {
+ id "groovy-gradle-plugin"
+}
diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle
new file mode 100644
index 0000000..70d94e3
--- /dev/null
+++ b/buildSrc/src/main/groovy/multiloader-common.gradle
@@ -0,0 +1,251 @@
+plugins {
+ id "java-library"
+ id "maven-publish"
+ id "com.hypherionmc.modutils.modpublisher"
+}
+
+base {
+ archivesName = "$mod_id_kebab-$name"
+ version = "$minecraft_version-$mod_version"
+}
+
+java {
+ toolchain.languageVersion = JavaLanguageVersion.of(java_version)
+ withSourcesJar()
+ withJavadocJar()
+}
+
+tasks.withType(JavaCompile).configureEach {
+ it.options.encoding = "UTF-8"
+ it.options.getRelease().set(java_version as Integer)
+}
+
+repositories {
+ mavenCentral()
+ exclusiveContent {
+ forRepository {
+ maven {
+ name = "Sponge"
+ url = "https://repo.spongepowered.org/repository/maven-public"
+ }
+ }
+ filter { includeGroupAndSubgroups("org.spongepowered") }
+ }
+ exclusiveContent {
+ forRepositories(
+ maven {
+ name = "ParchmentMC"
+ url = "https://maven.parchmentmc.org/"
+ },
+ maven {
+ name = "NeoForge"
+ url = "https://maven.neoforged.net/releases"
+ }
+ )
+ filter { includeGroup("org.parchmentmc.data") }
+ }
+ maven {
+ name = "Crystal Nest"
+ url = "https://maven.crystalnest.it"
+ }
+ exclusiveContent {
+ forRepository {
+ maven {
+ url "https://cursemaven.com"
+ }
+ }
+ filter {
+ includeGroup "curse.maven"
+ }
+ }
+}
+
+if (name != "fabric") {
+ dependencies {
+ implementation "it.crystalnest:cobweb-$name:$minecraft_version-$cobweb_version"
+ }
+}
+
+["apiElements", "runtimeElements", "sourcesElements", "javadocElements"].each { variant ->
+ configurations."$variant".outgoing {
+ capability("$group:${base.archivesName.get()}:$version")
+ capability("$group:$mod_id-${project.name}-$minecraft_version:$version")
+ capability("$group:$mod_id:$version")
+ }
+ publishing.publications.configureEach {
+ suppressPomMetadataWarningsFor(variant)
+ }
+}
+
+sourcesJar {
+ from(rootProject.file("LICENSE")) {
+ rename { "${it}_$mod_title" }
+ }
+}
+
+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
+ ])
+ }
+}
+
+processResources {
+ def expandProps = [
+ "java_version" : java_version,
+ "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,
+ "neoforge_version" : neoforge_version,
+ "neoforge_loader_version_range": neoforge_loader_version_range,
+ "cobweb_version" : cobweb_version,
+ ]
+ filesMatching(["pack.mcmeta", "fabric.mod.json", "META-INF/neoforge.mods.toml", "*.mixins.json"]) {
+ expand expandProps
+ }
+ inputs.properties(expandProps)
+}
+
+def noPublish = name == "common"
+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 (name) {
+ case "fabric":
+ loader = "Fabric"
+ 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(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_21]) // Remember to update this to match java_version gradle property.
+ 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 "NeoForge":
+ break
+ }
+ }
+ curseDepends {
+ required "cobweb"
+ switch (loader) {
+ case "Fabric":
+ required "fabric-api"
+ break
+ case "NeoForge":
+ break
+ }
+ }
+}
+
+tasks.register("publishLoader") {
+ group = "publishing"
+ description = "Publish $loader specific versions to all platforms"
+ dependsOn "publish"
+ dependsOn "publishMod"
+}
diff --git a/buildSrc/src/main/groovy/multiloader-loader.gradle b/buildSrc/src/main/groovy/multiloader-loader.gradle
new file mode 100644
index 0000000..618b808
--- /dev/null
+++ b/buildSrc/src/main/groovy/multiloader-loader.gradle
@@ -0,0 +1,44 @@
+plugins {
+ id "multiloader-common"
+}
+
+configurations {
+ commonJava{
+ canBeResolved = true
+ }
+ commonResources{
+ canBeResolved = true
+ }
+}
+
+dependencies {
+ compileOnly(project(":common")) {
+ capabilities {
+ requireCapability "$group:$mod_id"
+ }
+ }
+ commonJava project(path: ":common", configuration: "commonJava")
+ commonResources project(path: ":common", configuration: "commonResources")
+}
+
+tasks.named('compileJava', JavaCompile) {
+ dependsOn(configurations.commonJava)
+ source(configurations.commonJava)
+}
+
+processResources {
+ dependsOn(configurations.commonResources)
+ from(configurations.commonResources)
+}
+
+tasks.named("javadoc", Javadoc).configure {
+ dependsOn(configurations.commonJava)
+ source(configurations.commonJava)
+}
+
+tasks.named("sourcesJar", Jar) {
+ dependsOn(configurations.commonJava)
+ from(configurations.commonJava)
+ dependsOn(configurations.commonResources)
+ from(configurations.commonResources)
+}
diff --git a/common/build.gradle b/common/build.gradle
index 38e5ecd..4619786 100644
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -1,19 +1,40 @@
plugins {
- id "org.spongepowered.gradle.vanilla" version "0.2.1-SNAPSHOT"
- id "com.github.johnrengelman.shadow" version "8.1.0"
+ id "multiloader-common"
+ id "net.neoforged.moddev"
}
-minecraft {
- version(minecraft_version)
- if (file("src/main/resources/${mod_id}.accesswidener").exists()) {
- accessWideners(file("src/main/resources/${mod_id}.accesswidener"))
+neoForge {
+ neoFormVersion = neo_form_version
+ def at = file("src/main/resources/META-INF/accesstransformer.cfg")
+ if (at.exists()) {
+ accessTransformers.add(at.absolutePath)
+ }
+ parchment {
+ minecraftVersion = minecraft_version
+ mappingsVersion = parchment_version
}
}
dependencies {
compileOnly group: "org.spongepowered", name: "mixin", version: "0.8.5"
- compileOnly group: "io.github.llamalad7", name: "mixinextras-common", version: "0.3.6"
- implementation "it.crystalnest:cobweb-common:${minecraft_version}-${cobweb_version}"
+ compileOnly group: "io.github.llamalad7", name: "mixinextras-common", version: "0.3.5"
+ annotationProcessor group: "io.github.llamalad7", name: "mixinextras-common", version: "0.3.5"
+}
+
+configurations {
+ commonJava {
+ canBeResolved = false
+ canBeConsumed = true
+ }
+ commonResources {
+ canBeResolved = false
+ canBeConsumed = true
+ }
+}
+
+artifacts {
+ commonJava sourceSets.main.java.sourceDirectories.singleFile
+ commonResources sourceSets.main.resources.sourceDirectories.singleFile
}
// Disable publishing tasks where common is not published
diff --git a/common/src/main/java/it/crystalnest/leathered_boots/CommonModLoader.java b/common/src/main/java/it/crystalnest/leathered_boots/CommonModLoader.java
index 91e6598..139d640 100644
--- a/common/src/main/java/it/crystalnest/leathered_boots/CommonModLoader.java
+++ b/common/src/main/java/it/crystalnest/leathered_boots/CommonModLoader.java
@@ -1,6 +1,5 @@
package it.crystalnest.leathered_boots;
-import it.crystalnest.leathered_boots.enchantment.EnchantmentRegistry;
import it.crystalnest.leathered_boots.item.ItemRegistry;
import it.crystalnest.leathered_boots.loot.CommonLootRegistry;
import org.jetbrains.annotations.ApiStatus;
@@ -17,7 +16,6 @@ private CommonModLoader() {}
*/
public static void init() {
ItemRegistry.register();
- EnchantmentRegistry.register();
CommonLootRegistry.register();
Constants.LEATHERED_BOOTS_DYNAMIC_DATA_PACK.register();
}
diff --git a/common/src/main/java/it/crystalnest/leathered_boots/Constants.java b/common/src/main/java/it/crystalnest/leathered_boots/Constants.java
index 1d78faf..5be8115 100644
--- a/common/src/main/java/it/crystalnest/leathered_boots/Constants.java
+++ b/common/src/main/java/it/crystalnest/leathered_boots/Constants.java
@@ -4,19 +4,18 @@
import it.crystalnest.cobweb.api.pack.DynamicDataPack;
import it.crystalnest.cobweb.api.pack.DynamicTagBuilder;
import it.crystalnest.leathered_boots.api.LeatheredBootsManager;
-import it.crystalnest.leathered_boots.item.LeatheredArmorMaterial;
+import it.crystalnest.leathered_boots.item.ItemRegistry;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.ItemTags;
-import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
+import net.minecraft.world.item.trading.ItemCost;
import net.minecraft.world.item.trading.MerchantOffer;
import org.jetbrains.annotations.ApiStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
-import java.util.Objects;
import java.util.function.Supplier;
/**
@@ -25,7 +24,7 @@
@ApiStatus.Internal
public final class Constants {
/**
- * Mod id.
+ * Mod ID.
*/
public static final String MOD_ID = "leathered_boots";
@@ -36,19 +35,19 @@ public final class Constants {
/**
* Leathered boots dynamic datapack.
- * Adds all leathered boots to {@link ItemTags#TRIMMABLE_ARMOR} and {@link ItemTags#FREEZE_IMMUNE_WEARABLES}.
+ * Adds all leathered boots to {@link ItemTags#DYEABLE}, {@link ItemTags#TRIMMABLE_ARMOR}, {@link ItemTags#TRIMMABLE_ARMOR} and {@link ItemTags#FOOT_ARMOR}.
*/
public static final DynamicDataPack LEATHERED_BOOTS_DYNAMIC_DATA_PACK = (DynamicDataPack) DynamicDataPack
- .named(new ResourceLocation(MOD_ID, "leathered_boots"))
- .add(() -> DynamicTagBuilder.of(Registries.ITEM, ItemTags.TRIMMABLE_ARMOR, ItemTags.FREEZE_IMMUNE_WEARABLES).addElements(LeatheredBootsManager.getBoots()));
+ .named(ResourceLocation.fromNamespaceAndPath(MOD_ID, "leathered_boots"))
+ .add(() -> DynamicTagBuilder.of(Registries.ITEM, ItemTags.DYEABLE, ItemTags.TRIMMABLE_ARMOR, ItemTags.FREEZE_IMMUNE_WEARABLES, ItemTags.FOOT_ARMOR).addElements(LeatheredBootsManager.getBoots()));
/**
* Leathered boots trade offers.
*/
public static final Supplier