diff options
| author | Aizistral | 2022-08-06 19:28:58 +0200 |
|---|---|---|
| committer | GitHub | 2022-08-06 19:28:58 +0200 |
| commit | 041e6ca18241135af3f79f2c5db726593c57ab80 (patch) | |
| tree | bb9e3cc2a7ef94728a269495eaa72c73d86ac59c /src/main/java/com/aizistral | |
| parent | 96d03aeb1af670111769c0629a5724843aef592c (diff) | |
| parent | 6e8e743b17e547593d02ff6b80ae860ac27287fd (diff) | |
Merge pull request #124 from Madis0/skipwhitelist
Skip full-screen warning
Diffstat (limited to 'src/main/java/com/aizistral')
3 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java index 7f1d28d..e94e9b1 100644 --- a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java +++ b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java @@ -70,7 +70,7 @@ public class NoChatReportsClient implements ClientModInitializer { return; } else if (KEY_DISCONNECT_REASONS.contains(contents.getKey())) { if (ServerSafetyState.getLastConnectedServer() != null) { - if (!NoReportsConfig.isWhitelistedServer(ServerSafetyState.getLastConnectedServer())) { + if (!NoReportsConfig.isWhitelistedServer(ServerSafetyState.getLastConnectedServer()) && !NoReportsConfig.whitelistAllServers()) { client.setScreen(new UnsafeServerScreen()); } else { if (ServerSafetyState.getReconnectCount() <= 0) { diff --git a/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java b/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java index 403b3ff..214c676 100644 --- a/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java +++ b/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java @@ -43,7 +43,7 @@ public class NoReportsConfig { convertToGameMessage = false, showServerSafety = true, hideRedChatIndicators = true, hideYellowChatIndicators = true, hideGrayChatIndicators = true, hideWarningToast = true, alwaysHideReportButton = false, versionEasterEgg = true, disableTelemetry = true, - showReloadButton = true; + showReloadButton = true, whitelistAllServers = false; private List<String> whitelistedServers; private static NoReportsConfig getInstance() { @@ -278,4 +278,16 @@ public class NoReportsConfig { return getInstance().showReloadButton; } + /** + * @return True if the full-screen warning should be skipped for servers that require chat signing, + * letting users simply join the server. Because of that, servers will no longer be added to the whitelist. + * <br><br> + * + * This is false by default. + */ + + public static boolean whitelistAllServers() { + return getInstance().whitelistAllServers; + } + } diff --git a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java index 141116d..2897c5a 100644 --- a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java +++ b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java @@ -47,6 +47,8 @@ public enum ServerSafetyLevel { @Environment(EnvType.CLIENT) public Component getTooltip() { + if(NoReportsConfig.whitelistAllServers() && this.equals(ServerSafetyLevel.INSECURE)) + return Component.translatable("gui.nochatreports.status_insecure_whitelist_all_servers"); return Component.translatable("gui.nochatreports.status_" + this.name().toLowerCase()); } } |
