mirror of
https://github.com/Lucaslah/No-Report-Button.git
synced 2026-01-02 19:47:51 +00:00
feat: add forge support
This commit is contained in:
32
.github/workflows/build.yml
vendored
Normal file
32
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: build
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
java: [17]
|
||||
os: [ubuntu-22.04]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: validate gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- name: setup jdk ${{ matrix.java }}
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
- name: make gradle wrapper executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: build
|
||||
run: ./gradlew build
|
||||
- name: upload build artifacts
|
||||
if: ${{ matrix.java == '17' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: NoReportButtonBuild
|
||||
path: |
|
||||
fabric/build/libs
|
||||
forge/build/libs
|
||||
26
README.md
26
README.md
@@ -1,20 +1,26 @@
|
||||
[](https://fabricmc.net)
|
||||
[](https://www.curseforge.com/minecraft/mc-mods/no-report-button)
|
||||
[](https://modrinth.com/mod/nrb)
|
||||
# No Report Button
|
||||
Removes the chat report button from the game menu screen
|
||||
|
||||
Supports fabric 1.19.3+, forge support is coming soon!\
|
||||
The fabric api is not required.
|
||||
Supports fabric, forge and quilt 1.19.1+\
|
||||
Should be compatible with any mods, but if you do find a mod that is not please open an issue.
|
||||
|
||||
For minecraft versions 1.19.2 or older use NRB v1.2.1, the latest version only supports 1.19.3+.
|
||||
**Fabric API not required.**\
|
||||
**Mod is client size only, this mod will not do anything if used on the server.**
|
||||
|
||||
## Supported Version
|
||||
| Version | MC Version | Branch |
|
||||
|---------|---------------|-----------|
|
||||
| 1.2.1 | 1.19.1-1.19.2 | mc-1.19.1 |
|
||||
| 1.3.1 | 1.19.3+ | mc-1.19.3 |
|
||||
For Minecraft versions 1.19.1 and 1.19.2 use NRB v1.2.1, the latest version only supports 1.19.3+.
|
||||
|
||||
## Released Versions
|
||||
| Version | MC Version | Mod loaders | Git tag | Supported |
|
||||
|---------|---------------|----------------------|---------------------------------------------------------------------------|-----------|
|
||||
| 1.4.0 | 1.19.3 | fabric, forge, quilt | [1.4.0](https://github.com/Lucaslah/No-Report-Button/releases/tag/v1.4.0) | yes |
|
||||
| 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) | yes |
|
||||
| 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<br>
|
||||
Curseforge: https://www.curseforge.com/minecraft/mc-mods/no-report-button <br>
|
||||
Modrinth: https://modrinth.com/mod/nrb
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 1.3.1 | :white_check_mark: |
|
||||
|---------|--------------------|
|
||||
| 1.4.0 | :white_check_mark: |
|
||||
| 1.3.1 | :x: |
|
||||
| 1.3.0 | :x: |
|
||||
| 1.2.1 | :white_check_mark: |
|
||||
| < 1.2.1 | :x: |
|
||||
| < 1.2.1 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
||||
69
build.gradle
69
build.gradle
@@ -1,56 +1,41 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||
id "dev.architectury.loom" version "1.0-SNAPSHOT" apply false
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
group = project.maven_group
|
||||
|
||||
repositories {}
|
||||
|
||||
configurations {
|
||||
includeModImplementation
|
||||
includeImplementation
|
||||
|
||||
include.extendsFrom includeImplementation
|
||||
include.extendsFrom includeModImplementation
|
||||
|
||||
implementation.extendsFrom includeImplementation
|
||||
modImplementation.extendsFrom includeModImplementation
|
||||
architectury {
|
||||
injectInjectables = false
|
||||
minecraft = rootProject.properties["minecraft_version"]
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
subprojects {
|
||||
apply plugin: "dev.architectury.loom"
|
||||
|
||||
includeModImplementation fabricApi.module("fabric-api-base", project.fabric_version)
|
||||
includeModImplementation fabricApi.module("fabric-screen-api-v1", project.fabric_version)
|
||||
}
|
||||
loom {
|
||||
silentMojangMappingsLicense()
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${rootProject.properties["minecraft_version"]}"
|
||||
mappings "net.fabricmc:yarn:${rootProject.properties["yarn_mappings"]}:v2"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
it.options.release = 17
|
||||
}
|
||||
allprojects {
|
||||
apply plugin: "java"
|
||||
apply plugin: "architectury-plugin"
|
||||
apply plugin: "maven-publish"
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
archivesBaseName = rootProject.properties["archives_base_name"]
|
||||
version = rootProject.properties["mod_version"]
|
||||
group = rootProject.properties["maven_group"]
|
||||
|
||||
jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${project.archivesBaseName}"}
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(17)
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
|
||||
8
common/build.gradle
Normal file
8
common/build.gradle
Normal file
@@ -0,0 +1,8 @@
|
||||
architectury {
|
||||
injectInjectables = false
|
||||
common(rootProject.properties["enabled_platforms"].split(","))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.property("fabric_loader_version")}"
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package me.lucaslah.nrb.mixin;
|
||||
|
||||
import net.fabricmc.fabric.api.client.screen.v1.Screens;
|
||||
import net.minecraft.client.gui.Element;
|
||||
import net.minecraft.client.gui.screen.GameMenuScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
@@ -18,17 +17,16 @@ import java.util.Objects;
|
||||
|
||||
@Mixin(GameMenuScreen.class)
|
||||
public abstract class GameMenuScreenMixin extends Screen {
|
||||
|
||||
protected GameMenuScreenMixin(Text title) {
|
||||
super(title);
|
||||
}
|
||||
|
||||
@Inject(method = "initWidgets()V", at = @At(value = "RETURN"))
|
||||
public void initWidgets(CallbackInfo ci) {
|
||||
final List<ClickableWidget> widgets = Screens.getButtons(this);
|
||||
final List<Element> widgets = ((ScreenAccessor) this).getChildren();
|
||||
List<? extends Element> buttons = null;
|
||||
|
||||
for (ClickableWidget clickableWidget : widgets) {
|
||||
for (Element clickableWidget : widgets) {
|
||||
if (clickableWidget instanceof GridWidget widget) {
|
||||
List<? extends Element> children = widget.children();
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package me.lucaslah.nrb.mixin;
|
||||
|
||||
import net.minecraft.client.gui.Element;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public interface ScreenAccessor {
|
||||
@Accessor
|
||||
List<Element> getChildren();
|
||||
}
|
||||
2
common/src/main/resources/architectury.common.json
Normal file
2
common/src/main/resources/architectury.common.json
Normal file
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
@@ -1,14 +1,13 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "me.lucaslah.nrb.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
"minVersion": "0.8",
|
||||
"client": [
|
||||
"GameMenuScreenMixin"
|
||||
"GameMenuScreenMixin",
|
||||
"ScreenAccessor"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
63
fabric/build.gradle
Normal file
63
fabric/build.gradle
Normal file
@@ -0,0 +1,63 @@
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||
}
|
||||
|
||||
architectury {
|
||||
injectInjectables = false
|
||||
platformSetupLoomIde()
|
||||
fabric()
|
||||
}
|
||||
|
||||
configurations {
|
||||
common
|
||||
shadowCommon
|
||||
compileClasspath.extendsFrom common
|
||||
runtimeClasspath.extendsFrom common
|
||||
developmentFabric.extendsFrom common
|
||||
archivesBaseName = rootProject.archives_base_name + "-fabric"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.properties["fabric_loader_version"]}"
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
shadowJar {
|
||||
exclude "architectury.common.json"
|
||||
|
||||
configurations = [project.configurations.shadowCommon]
|
||||
classifier "dev-shadow"
|
||||
}
|
||||
|
||||
remapJar {
|
||||
input.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
classifier null
|
||||
}
|
||||
|
||||
jar {
|
||||
classifier "dev"
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
from commonSources.archiveFile.map { zipTree(it) }
|
||||
}
|
||||
|
||||
components.java {
|
||||
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package me.lucaslah.nrb;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class NoReportButton implements ModInitializer {
|
||||
public class NoReportButtonFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {}
|
||||
}
|
||||
@@ -16,10 +16,10 @@
|
||||
"license": "lgpl-3",
|
||||
"icon": "assets/noreportbutton/icon.png",
|
||||
|
||||
"environment": "*",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"me.lucaslah.nrb.NoReportButton"
|
||||
"me.lucaslah.nrb.NoReportButtonFabric"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
@@ -29,7 +29,6 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.6",
|
||||
"minecraft": ">=1.19.3",
|
||||
"java": ">=17",
|
||||
"fabric-screen-api-v1": ">=1.0.4"
|
||||
"java": ">=17"
|
||||
}
|
||||
}
|
||||
69
forge/build.gradle
Normal file
69
forge/build.gradle
Normal file
@@ -0,0 +1,69 @@
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||
}
|
||||
|
||||
architectury {
|
||||
injectInjectables = false
|
||||
platformSetupLoomIde()
|
||||
forge()
|
||||
}
|
||||
|
||||
loom {
|
||||
forge {
|
||||
mixinConfig "noreportbutton.mixins.json"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
common
|
||||
shadowCommon
|
||||
compileClasspath.extendsFrom common
|
||||
runtimeClasspath.extendsFrom common
|
||||
developmentForge.extendsFrom common
|
||||
archivesBaseName = rootProject.archives_base_name + "-forge"
|
||||
}
|
||||
|
||||
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 }
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("META-INF/mods.toml") {
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude "fabric.mod.json"
|
||||
exclude "architectury.common.json"
|
||||
|
||||
configurations = [project.configurations.shadowCommon]
|
||||
classifier "dev-shadow"
|
||||
}
|
||||
|
||||
remapJar {
|
||||
input.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
classifier null
|
||||
}
|
||||
|
||||
jar {
|
||||
classifier "dev"
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
from commonSources.archiveFile.map { zipTree(it) }
|
||||
}
|
||||
|
||||
components.java {
|
||||
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
}
|
||||
1
forge/gradle.properties
Normal file
1
forge/gradle.properties
Normal file
@@ -0,0 +1 @@
|
||||
loom.platform=forge
|
||||
@@ -0,0 +1,7 @@
|
||||
package me.lucaslah.nrb;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod("noreportbutton")
|
||||
public class NoReportButtonForge {
|
||||
}
|
||||
27
forge/src/main/resources/META-INF/mods.toml
Normal file
27
forge/src/main/resources/META-INF/mods.toml
Normal file
@@ -0,0 +1,27 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[43,)"
|
||||
license = "GNU LESSER GENERAL PUBLIC LICENSE"
|
||||
|
||||
[[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 = "forge"
|
||||
mandatory = true
|
||||
versionRange = "[43,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
|
||||
[[dependencies.noreportbutton]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.19.3,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
BIN
forge/src/main/resources/icon.png
Normal file
BIN
forge/src/main/resources/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
6
forge/src/main/resources/pack.mcmeta
Normal file
6
forge/src/main/resources/pack.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "NoReportButton",
|
||||
"pack_format": 9
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
# Minecraft Properties
|
||||
minecraft_version=1.19.3
|
||||
yarn_mappings=1.19.3+build.1
|
||||
loader_version=0.14.11
|
||||
yarn_mappings=1.19.3+build.3
|
||||
fabric_loader_version=0.14.11
|
||||
quilt_loader_version=0.18.1-beta.23
|
||||
enabled_platforms=quilt,fabric,forge
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.3.1
|
||||
mod_version = 1.4.0
|
||||
maven_group = me.lucaslah
|
||||
archives_base_name = no-report-button
|
||||
|
||||
# Dependencies
|
||||
architectury_version=6.2.43
|
||||
fabric_version=0.68.1+1.19.3
|
||||
forge_version=1.19.3-44.0.18
|
||||
|
||||
@@ -4,7 +4,17 @@ pluginManagement {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
}
|
||||
maven { url "https://maven.architectury.dev/" }
|
||||
maven { url "https://maven.minecraftforge.net/" }
|
||||
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "no-report-button"
|
||||
|
||||
include 'common'
|
||||
include 'fabric'
|
||||
include 'forge'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user