diff --git a/README.md b/README.md index 7dba5ca..3a83b28 100755 --- a/README.md +++ b/README.md @@ -13,18 +13,19 @@ Should be compatible with any mods, but if you do find a mod that is not please See below for what NRB version to use. ## Released Versions -| Version | MC Version | Mod loaders | Git tag | Supported | -|------------|---------------|----------------------|-------------------------------------------------------------------------------------|-----------| -| 1.6.0 | 1.21 | fabric, forge, quilt | [1.6.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.6.0) | yes | -| 1.6.0-beta | 1.21 | fabric | [1.6.0-beta](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.6.0-beta) | no | -| 1.5.0 | 1.20.1-1.20.6 | fabric, forge, quilt | [1.5.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.5.0) | yes | -| 1.4.1 | 1.19.4 | fabric, forge, quilt | [1.4.1](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.4.1) | no | -| 1.4.0 | 1.19.3 | fabric, forge, quilt | [1.4.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.4.0) | no | -| 1.3.1 | 1.19.3 | fabric | [1.3.1](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.3.1) | no | -| 1.3.0 | 1.19.3 | fabric | [1.3.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.3.0) | no | -| 1.2.1 | 1.19.1-1.19.2 | fabric | [1.2.1](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.2.1) | no | -| 1.2.0 | 1.19.1-1.19.2 | fabric | [1.2.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.2.0) | no | -| 1.1.0 | 1.19.1-1.19.2 | fabric | [1.1.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.1.0) | no | +| Version | MC Version | Mod loaders | Git tag | Supported | +|------------|---------------|-------------------------|-------------------------------------------------------------------------------------|-----------| +| 1.6.1 | 1.21 | fabric, forge, neoforge | | yes | +| 1.6.0 | 1.21 | fabric, forge, quilt | [1.6.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.6.0) | no | +| 1.6.0-beta | 1.21 | fabric | [1.6.0-beta](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.6.0-beta) | no | +| 1.5.0 | 1.20.1-1.20.6 | fabric, forge, quilt | [1.5.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.5.0) | yes | +| 1.4.1 | 1.19.4 | fabric, forge, quilt | [1.4.1](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.4.1) | no | +| 1.4.0 | 1.19.3 | fabric, forge, quilt | [1.4.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.4.0) | no | +| 1.3.1 | 1.19.3 | fabric | [1.3.1](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.3.1) | no | +| 1.3.0 | 1.19.3 | fabric | [1.3.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.3.0) | no | +| 1.2.1 | 1.19.1-1.19.2 | fabric | [1.2.1](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.2.1) | no | +| 1.2.0 | 1.19.1-1.19.2 | fabric | [1.2.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.2.0) | no | +| 1.1.0 | 1.19.1-1.19.2 | fabric | [1.1.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.1.0) | no | ## Links Curseforge: https://www.curseforge.com/minecraft/mc-mods/no-report-button
diff --git a/build.gradle b/build.gradle index 500c565..6025231 100755 --- a/build.gradle +++ b/build.gradle @@ -1,41 +1,73 @@ plugins { - id "architectury-plugin" version "3.4.155" - id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false + id 'dev.architectury.loom' version '1.7-SNAPSHOT' apply false + id 'architectury-plugin' version '3.4-SNAPSHOT' + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false } architectury { - injectInjectables = false - minecraft = rootProject.properties["minecraft_version"] -} - -subprojects { - apply plugin: "dev.architectury.loom" - - loom { - silentMojangMappingsLicense() - } - - dependencies { - minecraft "com.mojang:minecraft:${rootProject.properties["minecraft_version"]}" - mappings "net.fabricmc:yarn:${rootProject.properties["yarn_mappings"]}:v2" - } + minecraft = project.minecraft_version } allprojects { - apply plugin: "java" - apply plugin: "architectury-plugin" - apply plugin: "maven-publish" + group = rootProject.maven_group + version = rootProject.mod_version +} - archivesBaseName = rootProject.properties["archives_base_name"] - version = rootProject.properties["mod_version"] - group = rootProject.properties["maven_group"] +subprojects { + apply plugin: 'dev.architectury.loom' + apply plugin: 'architectury-plugin' + apply plugin: 'maven-publish' - tasks.withType(JavaCompile).configureEach { - options.encoding = "UTF-8" - options.release.set(21) + base { + // Set up a suffixed format for the mod jar names, e.g. `example-fabric`. + archivesName = "$rootProject.archives_name-$project.name" + } + + repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. + } + + dependencies { + minecraft "net.minecraft:minecraft:$rootProject.minecraft_version" + mappings loom.layered { + it.mappings("net.fabricmc:yarn:$rootProject.yarn_mappings:v2") + it.mappings("dev.architectury:yarn-mappings-patch-neoforge:$rootProject.yarn_mappings_patch_neoforge_version") + } } java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. withSourcesJar() + + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + + tasks.withType(JavaCompile).configureEach { + it.options.release = 21 + } + + // Configure Maven publishing. + publishing { + publications { + mavenJava(MavenPublication) { + artifactId = base.archivesName.get() + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } } } diff --git a/fabric/build.gradle b/fabric/build.gradle index c0fe060..c5c8a33 100755 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,63 +1,49 @@ plugins { - id "com.github.johnrengelman.shadow" version "8.1.1" + id 'com.github.johnrengelman.shadow' } architectury { - injectInjectables = false platformSetupLoomIde() fabric() } configurations { - common - shadowCommon + common { + canBeResolved = true + canBeConsumed = false + } compileClasspath.extendsFrom common runtimeClasspath.extendsFrom common developmentFabric.extendsFrom common - archivesBaseName = rootProject.archives_base_name + "-fabric" + + // Files in this configuration will be bundled into your mod using the Shadow plugin. + // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files. + shadowBundle { + canBeResolved = true + canBeConsumed = false + } } dependencies { - modImplementation "net.fabricmc:fabric-loader:${rootProject.properties["fabric_loader_version"]}" + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" - common(project(path: ":common", configuration: "namedElements")) { transitive false } - shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } + common(project(path: ':common', configuration: 'namedElements')) { transitive false } + shadowBundle project(path: ':common', configuration: 'transformProductionFabric') } processResources { - inputs.property "version", project.version + inputs.property 'version', project.version - filesMatching("fabric.mod.json") { - expand "version": project.version + filesMatching('fabric.mod.json') { + expand version: project.version } } - shadowJar { - exclude "architectury.common.json" - - configurations = [project.configurations.shadowCommon] - setArchiveClassifier("dev-shadow") + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' } remapJar { - input.set shadowJar.archiveFile - dependsOn shadowJar - setArchiveClassifier(null) -} - -jar { - setArchiveClassifier("dev") -} - -sourcesJar { - def commonSources = project(":common").sourcesJar - dependsOn commonSources - from commonSources.archiveFile.map { zipTree(it) } -} - -components.java { - withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { - skip() - } + inputFile.set shadowJar.archiveFile } diff --git a/forge/build.gradle b/forge/build.gradle index cbbd4df..d4eb93b 100755 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,9 +1,8 @@ plugins { - id "com.github.johnrengelman.shadow" version "8.1.1" + id 'com.github.johnrengelman.shadow' } architectury { - injectInjectables = false platformSetupLoomIde() forge() } @@ -15,19 +14,27 @@ loom { } configurations { - common - shadowCommon + common { + canBeResolved = true + canBeConsumed = false + } compileClasspath.extendsFrom common runtimeClasspath.extendsFrom common developmentForge.extendsFrom common - archivesBaseName = rootProject.archives_base_name + "-forge" + + // Files in this configuration will be bundled into your mod using the Shadow plugin. + // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files. + shadowBundle { + canBeResolved = true + canBeConsumed = false + } } dependencies { forge "net.minecraftforge:forge:${rootProject.properties["forge_version"]}" common(project(path: ":common", configuration: "namedElements")) { transitive false } - shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } + shadowBundle(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } } processResources { @@ -39,31 +46,10 @@ processResources { } shadowJar { - exclude "fabric.mod.json" - exclude "architectury.common.json" - - configurations = [project.configurations.shadowCommon] - setArchiveClassifier("dev-shadow") + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' } remapJar { - input.set shadowJar.archiveFile - dependsOn shadowJar - setArchiveClassifier(null) -} - -jar { - setArchiveClassifier("dev") -} - -sourcesJar { - def commonSources = project(":common").sourcesJar - dependsOn commonSources - from commonSources.archiveFile.map { zipTree(it) } -} - -components.java { - withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { - skip() - } + inputFile.set shadowJar.archiveFile } diff --git a/gradle.properties b/gradle.properties index 6d4be3c..6f481be 100755 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,20 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx4G +org.gradle.parallel=true + +# Mod Properties +mod_version = 1.6.1 +maven_group = me.lucaslah +archives_name = no-report-button +enabled_platforms=fabric,forge,neoforge # Minecraft Properties minecraft_version=1.21 yarn_mappings=1.21+build.7 -fabric_loader_version=0.15.11 -enabled_platforms=fabric,forge - -# Mod Properties -mod_version = 1.6.0 -maven_group = me.lucaslah -archives_base_name = no-report-button # Dependencies fabric_version=0.100.1+1.21 +fabric_loader_version=0.15.11 forge_version=1.21-51.0.5 +neoforge_version=21.0.167 +yarn_mappings_patch_neoforge_version = 1.21+build.4 \ No newline at end of file diff --git a/neoforge/build.gradle b/neoforge/build.gradle new file mode 100644 index 0000000..739f22c --- /dev/null +++ b/neoforge/build.gradle @@ -0,0 +1,56 @@ +plugins { + id 'com.github.johnrengelman.shadow' +} + +architectury { + platformSetupLoomIde() + neoForge() +} + +configurations { + common { + canBeResolved = true + canBeConsumed = false + } + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentNeoForge.extendsFrom common + + // Files in this configuration will be bundled into your mod using the Shadow plugin. + // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files. + shadowBundle { + canBeResolved = true + canBeConsumed = false + } +} + +repositories { + maven { + name = 'NeoForged' + url = 'https://maven.neoforged.net/releases' + } +} + +dependencies { + neoForge "net.neoforged:neoforge:$rootProject.neoforge_version" + + common(project(path: ':common', configuration: 'namedElements')) { transitive false } + shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge') +} + +processResources { + inputs.property 'version', project.version + + filesMatching('META-INF/neoforge.mods.toml') { + expand version: project.version + } +} + +shadowJar { + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' +} + +remapJar { + inputFile.set shadowJar.archiveFile +} diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties new file mode 100644 index 0000000..2914393 --- /dev/null +++ b/neoforge/gradle.properties @@ -0,0 +1 @@ +loom.platform=neoforge \ No newline at end of file diff --git a/neoforge/src/main/java/me/lucaslah/nrb/NoReportButtonNeoForge.java b/neoforge/src/main/java/me/lucaslah/nrb/NoReportButtonNeoForge.java new file mode 100644 index 0000000..f9cb809 --- /dev/null +++ b/neoforge/src/main/java/me/lucaslah/nrb/NoReportButtonNeoForge.java @@ -0,0 +1,7 @@ +package me.lucaslah.nrb; + +import net.neoforged.fml.common.Mod; + +@Mod("noreportbutton") +public class NoReportButtonNeoForge { +} diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml new file mode 100644 index 0000000..1db0ae0 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -0,0 +1,31 @@ +modLoader = "javafml" +loaderVersion = "[0,)" +license = "GNU LESSER GENERAL PUBLIC LICENSE" +clientSideOnly=true + +[[mods]] +modId = "noreportbutton" +version = "${version}" +displayName = "No Report Button" +authors = "Lucaslah" +description = ''' +Removes the chat report button from the multiplayer menu screen +''' +logoFile = "icon.png" + +[[dependencies.noreportbutton]] +modId = "neoforge" +mandatory = true +versionRange = "[0,)" +ordering = "NONE" +side = "CLIENT" + +[[dependencies.noreportbutton]] +modId = "minecraft" +mandatory = true +versionRange = "[1.21,)" +ordering = "NONE" +side = "CLIENT" + +[[mixins]] +config = "noreportbutton.mixins.json" \ No newline at end of file diff --git a/neoforge/src/main/resources/icon.png b/neoforge/src/main/resources/icon.png new file mode 100644 index 0000000..c0975fd Binary files /dev/null and b/neoforge/src/main/resources/icon.png differ diff --git a/neoforge/src/main/resources/pack.mcmeta b/neoforge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..0cf0874 --- /dev/null +++ b/neoforge/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "NoReportButton", + "pack_format": 9 + } +} diff --git a/settings.gradle b/settings.gradle index ec4a829..5195848 100755 --- a/settings.gradle +++ b/settings.gradle @@ -17,3 +17,4 @@ rootProject.name = "No-Report-Button" include 'common' include 'fabric' include 'forge' +include 'neoforge' \ No newline at end of file