diff options
Diffstat (limited to 'src/main')
7 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java index ea1bdb4..f67821d 100644 --- a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java +++ b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java @@ -148,7 +148,9 @@ public final class NoChatReportsClient implements ClientModInitializer { if (!client.isLocalServer()) { boolean canSend = ClientPlayNetworking.canSend(NoChatReports.CHANNEL); - if (canSend) { + if (ServerSafetyState.getCurrent() == ServerSafetyLevel.REALMS) { + // NO-OP + } else if (canSend) { ServerSafetyState.updateCurrent(ServerSafetyLevel.SECURE); } else if (ServerSafetyState.forceSignedMessages()) { ServerSafetyState.updateCurrent(ServerSafetyLevel.INSECURE); diff --git a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java index 7454c45..6494dbc 100644 --- a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java +++ b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java @@ -38,6 +38,12 @@ public enum ServerSafetyLevel { INSECURE, /** + * For Realms specifically, as these are a whole new level of unsafe. + */ + + REALMS, + + /** * Transient status for when evaluation of safety level is not yet complete for current server. */ diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java index 433e183..a05152c 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java @@ -44,7 +44,7 @@ import net.minecraft.util.FormattedCharSequence; @Mixin(ChatScreen.class) public abstract class MixinChatScreen extends Screen { - private static final ResourceLocation CHAT_STATUS_ICONS = new ResourceLocation("nochatreports", "textures/gui/chat_status_icons.png"); + private static final ResourceLocation CHAT_STATUS_ICONS = new ResourceLocation("nochatreports", "textures/gui/chat_status_icons_extended.png"); private static final ResourceLocation ENCRYPTION_BUTTON = new ResourceLocation("nochatreports", "textures/gui/encryption_toggle_button.png"); protected MixinChatScreen() { @@ -78,7 +78,7 @@ public abstract class MixinChatScreen extends Screen { ServerSafetyLevel trust = this.minecraft.isLocalServer() ? ServerSafetyLevel.SECURE : ServerSafetyState.getCurrent(); var button = new ImageButton(buttonX, this.height - 37, 20, 20, this.getXOffset(trust), - 0, 20, CHAT_STATUS_ICONS, 64, 64, btn -> {}, (btn, poseStack, i, j) -> + 0, 20, CHAT_STATUS_ICONS, 128, 128, btn -> {}, (btn, poseStack, i, j) -> this.renderTooltipNoGap(poseStack, this.minecraft.font.split(trust.getTooltip(), 250), i, j), Component.empty()); button.active = false; @@ -129,6 +129,7 @@ public abstract class MixinChatScreen extends Screen { case SECURE -> 21; case UNINTRUSIVE, UNKNOWN -> 42; case INSECURE -> 0; + case REALMS -> 63; }; } diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinRealmsConnect.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinRealmsConnect.java index 351c43f..5fd58dd 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinRealmsConnect.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinRealmsConnect.java @@ -27,7 +27,7 @@ public class MixinRealmsConnect { return; ServerSafetyState.setLastConnectedServer(serverAddress, null); - ServerSafetyState.updateCurrent(ServerSafetyLevel.INSECURE); + ServerSafetyState.updateCurrent(ServerSafetyLevel.REALMS); ServerSafetyState.setAllowsUnsafeServer(true); } diff --git a/src/main/resources/assets/nochatreports/lang/en_us.json b/src/main/resources/assets/nochatreports/lang/en_us.json index 2ac30fc..55eef73 100644 --- a/src/main/resources/assets/nochatreports/lang/en_us.json +++ b/src/main/resources/assets/nochatreports/lang/en_us.json @@ -6,6 +6,7 @@ "gui.nochatreports.status_secure": "This server has No Chat Reports installed, or prevents your messages from being reportable in some other known way. You can chat safely.", "gui.nochatreports.status_unintrusive": "This server does not prevent chat reports, but allows you to send unsigned messages which cannot be reported to Mojang. Vanilla clients will still send signed messages, display unsigned messages as \"Not Secure\" and not show them if \"Only Show Secure Chat\" is enabled in chat options.", "gui.nochatreports.status_insecure": "This server demands all chat messages to be signed and you agreed to proceed with this arrangement. Everything you send in the chat is potentially incriminating evidence that can be used against you in the report. You can remove this server from §oWhitelisted Servers§r in the mod config to get warned again.", + "gui.nochatreports.status_realms": "This is a Realms server. Not only there is no way to prevent chat reports here, but Mojang also employ automated chat monitoring to identify potential \"online harms\" and escalate them for human review, whether owner of the realm likes it or not. Your only hope is chat encryption.", "gui.nochatreports.status_insecure_whitelist_all_servers": "This server demands all chat messages to be signed and you disabled the full-screen warning for it. Everything you send in the chat is potentially incriminating evidence that can be used against you in the report. You can disable §oWhitelist all servers§r in the mod config to get warned again.", "gui.nochatreports.status_unknown": "No Chat Reports could not evaluate the safety of this server. This should never happen, please report it as a bug to the mod developer.", "gui.nochatreports.unsafe_server.header": "Caution: Unsafe Server", diff --git a/src/main/resources/assets/nochatreports/textures/gui/chat_status_icons.png b/src/main/resources/assets/nochatreports/textures/gui/chat_status_icons.png Binary files differdeleted file mode 100644 index f3c48b3..0000000 --- a/src/main/resources/assets/nochatreports/textures/gui/chat_status_icons.png +++ /dev/null diff --git a/src/main/resources/assets/nochatreports/textures/gui/chat_status_icons_extended.png b/src/main/resources/assets/nochatreports/textures/gui/chat_status_icons_extended.png Binary files differnew file mode 100644 index 0000000..cc1d358 --- /dev/null +++ b/src/main/resources/assets/nochatreports/textures/gui/chat_status_icons_extended.png |
