summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java6
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/MixinPlayerEntry.java11
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java b/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java
index bc37e7c..3bd8bfc 100644
--- a/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java
@@ -28,7 +28,7 @@ public class NoReportsConfig {
private static NoReportsConfig INSTANCE;
private boolean demandOnClient, demandOnServer, enableDebugLog, convertToGameMessage = true,
forceAllowMultiplayer = true, showServerSafety = true, suppressMessageTrustIndicators = true,
- scrambleTimestamps = true;
+ scrambleTimestamps = true, alwaysHideReportButton = false;
private List<String> whitelistedServers;
private static NoReportsConfig getInstance() {
@@ -121,4 +121,8 @@ public class NoReportsConfig {
return getInstance().scrambleTimestamps;
}
+ public static boolean alwaysHideReportButton() {
+ return getInstance().alwaysHideReportButton;
+ }
+
}
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/MixinPlayerEntry.java b/src/main/java/com/aizistral/nochatreports/mixins/MixinPlayerEntry.java
index 4b7a5eb..b084732 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/MixinPlayerEntry.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/MixinPlayerEntry.java
@@ -12,6 +12,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import com.aizistral.nochatreports.core.NoReportsConfig;
import com.aizistral.nochatreports.core.ServerSafetyLevel;
import com.aizistral.nochatreports.core.ServerSafetyState;
import com.mojang.blaze3d.vertex.PoseStack;
@@ -46,7 +47,15 @@ public class MixinPlayerEntry {
@Inject(method = "<init>", at = @At("RETURN"))
private void onConstructed(Minecraft minecraft, SocialInteractionsScreen socialInteractionsScreen, UUID uUID, String string, Supplier<ResourceLocation> supplier, CallbackInfo info) {
- if (ServerSafetyState.getCurrent() == ServerSafetyLevel.SECURE && this.reportButton != null) {
+ if (NoReportsConfig.alwaysHideReportButton()) {
+ this.reportButton = new Button(0, 0, 20, 20, Component.empty(), button -> {}) {
+ @Override
+ public void render(PoseStack poseStack, int i, int j, float f) {
+ // NO-OP
+ }
+ };
+ this.reportButton.active = this.reportButton.visible = false;
+ } else if (ServerSafetyState.getCurrent() == ServerSafetyLevel.SECURE && this.reportButton != null) {
this.reportButton = new ImageButton(0, 0, 20, 20, 0, 0, 20, REPORT_BUTTON_LOCATION, 64, 64, button -> {}, new Button.OnTooltip() {
@Override
public void onTooltip(Button button, PoseStack poseStack, int i, int j) {