6 Commits

Author SHA1 Message Date
886b2c37e0 feat: remove unneeded config 2023-01-04 09:36:43 -05:00
256ed10cfe fix: mod menu mods button offset
- fixes #5
- bump version to 1.3.1
- update button logic that replaces the report button to fix mod menu issue
- rename mixins.json to noreportbutton.mixins.json
- updated package from ncrb to nrb
- minor cleanup
2023-01-04 09:34:56 -05:00
64397c5497 docs: add badges for curseforge and modrinth
this allows to show mod downloads on github
2023-01-04 08:46:05 -05:00
1fa8e47900 add note to readme 2022-12-10 12:17:01 -05:00
bb3254389c update to 1.19.3
note: this version only supports 1.19.3, not older versions.
2022-12-10 12:13:12 -05:00
de212d0b6d fix: report button could still be interacted with
- fixes #3
2022-10-07 13:36:18 -04:00
10 changed files with 73 additions and 179 deletions

View File

@@ -1,25 +0,0 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/java/.devcontainer/base.Dockerfile
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster
ARG VARIANT="17-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
# [Option] Install Maven
ARG INSTALL_MAVEN="false"
ARG MAVEN_VERSION=""
# [Option] Install Gradle
ARG INSTALL_GRADLE="false"
ARG GRADLE_VERSION=""
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

View File

@@ -1,48 +0,0 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/java
{
"name": "Java",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Java version: 11, 17
// Append -bullseye or -buster to pin to an OS version.
// Use the -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "17-bullseye",
// Options
"INSTALL_MAVEN": "false",
"INSTALL_GRADLE": "true",
"NODE_VERSION": "none"
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"git": "os-provided",
"github-cli": "latest",
"sshd": "latest",
"fish": "latest"
}
}

View File

@@ -1,9 +1,14 @@
[![Mod Loader](https://img.shields.io/badge/Mod%20Loader-Fabric-lightyellow?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzku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W5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDowZWRiMWMyYy1mZjhjLWU0NDEtOTMxZi00OTVkNGYxNGM3NjAiIHN0RXZ0OndoZW49IjIwMTgtMTItMTZUMTY6NTQ6MTctMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE4IChXaW5kb3dzKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4/HiGMAAAAtUlEQVRYw+XXrQqAMBQF4D2P2eBL+QIG8RnEJFaNBjEum+0+zMQLtwwv+wV3ZzhhMDgfJ0wUSinxZUQWgKos1JP/AbD4OneIDyQPwCFniA+EJ4CaXm4TxAXCC0BNHgLhAdAnx9hC8PwGSRtAFVMQjF7cNTWED8B1cgwW20yfJgAvrssAsZ1cB3g/xckAxr6FmCDU5N6f488BrpCQ4rQBJkiMYh4ACmLzwOQF0CExinkCsvw7vgGikl+OotaKRwAAAABJRU5ErkJggg==)](https://fabricmc.net)
[![curseforge-downloads](https://cf.way2muchnoise.eu/full_658722_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/no-report-button)
[![modrinth-downloads](https://modrinth-utils.vercel.app/api/badge/downloads?id=9WJeSpTH&logo=true)](https://modrinth.com/mod/nrb)
# No Report Button
Removes the chat report button from the game menu screen
Supports fabric 1.19.1+, forge support is coming soon!\
Supports fabric 1.19.3+, forge support is coming soon!\
The fabric api is not required.
For minecraft versions 1.19.2 or older use NRB v1.2.1, the latest version only supports 1.19.3+.
## Links
Curseforge: https://www.curseforge.com/minecraft/mc-mods/no-report-button<br>
Modrinth: https://modrinth.com/mod/nrb

View File

@@ -10,13 +10,7 @@ archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
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.
}
repositories {}
configurations {
includeModImplementation
@@ -35,15 +29,6 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
// modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
includeModImplementation fabricApi.module("fabric-api-base", project.fabric_version)
includeModImplementation fabricApi.module("fabric-screen-api-v1", project.fabric_version)
}
@@ -57,14 +42,10 @@ processResources {
}
tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}
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()
}
@@ -73,20 +54,3 @@ jar {
rename { "${it}_${project.archivesBaseName}"}
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
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.
}
}

View File

@@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.1
loader_version=0.14.8
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.1
loader_version=0.14.11
# Mod Properties
mod_version = 1.2.0
mod_version = 1.3.1
maven_group = me.lucaslah
archives_base_name = no-report-button
# Dependencies
fabric_version=0.58.6+1.19.2
fabric_version=0.68.1+1.19.3

View File

@@ -1,55 +0,0 @@
package me.lucaslah.ncrb.mixin;
import net.fabricmc.fabric.api.client.screen.v1.Screens;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.OpenToLanScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
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> buttons = Screens.getButtons(this);
ClickableWidget reportButton = null;
boolean reportButtonFound = false;
for (ClickableWidget button : buttons) {
if (button.getMessage().getString().equals(I18n.translate("menu.playerReporting"))) {
button.setWidth(-9999);
reportButton = button;
reportButtonFound = true;
}
}
if (reportButtonFound) {
//reportButton.setWidth(-9999);
//reportButton.setMessage(Text.of(""));
//reportButton.active = false;
ButtonWidget openToLanButton = this.addDrawableChild(new ButtonWidget(this.width / 2 + 4, this.height / 4 + 96 + -16, 98, 20, Text.translatable("menu.shareToLan"), (button) -> {
assert this.client != null;
this.client.setScreen(new OpenToLanScreen(this));
}));
assert this.client != null;
openToLanButton.active = this.client.isIntegratedServerRunning() && !Objects.requireNonNull(this.client.getServer()).isRemote();
}
}
}

View File

@@ -1,10 +1,8 @@
package me.lucaslah.ncrb;
package me.lucaslah.nrb;
import net.fabricmc.api.ModInitializer;
public class NoReportButton implements ModInitializer {
@Override
public void onInitialize() {
// Do nothing
}
public void onInitialize() {}
}

View File

@@ -0,0 +1,55 @@
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;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.gui.widget.GridWidget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
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);
List<? extends Element> buttons = null;
for (ClickableWidget clickableWidget : widgets) {
if (clickableWidget instanceof GridWidget widget) {
List<? extends Element> children = widget.children();
if (children != null) {
buttons = children;
}
}
}
if (buttons != null) {
for (Element element : buttons) {
if (element instanceof ClickableWidget button) {
if (button.getMessage().getString().equals(I18n.translate("menu.playerReporting"))) {
if (this.client != null) {
button.active = this.client.isIntegratedServerRunning() && !Objects.requireNonNull(this.client.getServer()).isRemote();
}
button.setMessage(Text.translatable("menu.shareToLan"));
}
}
}
}
}
}

View File

@@ -19,16 +19,16 @@
"environment": "*",
"entrypoints": {
"main": [
"me.lucaslah.ncrb.NoReportButton"
"me.lucaslah.nrb.NoReportButton"
]
},
"mixins": [
"mixins.json"
"noreportbutton.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.6",
"minecraft": "~1.19",
"minecraft": ">=1.19.3",
"java": ">=17",
"fabric-screen-api-v1": ">=1.0.4"
}

View File

@@ -1,7 +1,7 @@
{
"required": true,
"minVersion": "0.8",
"package": "me.lucaslah.ncrb.mixin",
"package": "me.lucaslah.nrb.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
],