From d934eae3899efe9c0a73fa4aa0b27c85bfd1d10a Mon Sep 17 00:00:00 2001 From: Aizistral Date: Thu, 19 Nov 2026 00:42:04 +0100 Subject: Make enableMod a startup-only switch in common config --- .../aizistral/nochatreports/NCRMixinPlugin.java | 46 ++++++++++++++++++ .../com/aizistral/nochatreports/NoChatReports.java | 17 +++++-- .../nochatreports/NoChatReportsClient.java | 22 +++------ .../aizistral/nochatreports/config/JSONConfig.java | 13 ++++-- .../aizistral/nochatreports/config/NCRConfig.java | 54 +++++++++++----------- .../nochatreports/config/NCRConfigClient.java | 14 +----- .../nochatreports/config/NCRConfigCommon.java | 10 ++++ .../mixins/client/MixinChatOptionsScreen.java | 7 --- .../mixins/client/MixinChatScreen.java | 2 +- .../mixins/client/MixinClientboundHelloPacket.java | 4 -- .../mixins/client/MixinConnectScreen.java | 3 -- .../mixins/client/MixinJoinMultiplayerScreen.java | 28 +++++------ .../mixins/client/MixinLocalPlayer.java | 7 --- .../nochatreports/mixins/client/MixinOptions.java | 4 -- .../mixins/client/MixinProfileKeyPairManager.java | 13 ------ .../mixins/client/MixinRealmsConnect.java | 4 -- .../resources/assets/nochatreports/lang/en_pt.json | 3 -- .../resources/assets/nochatreports/lang/en_us.json | 8 ++-- .../resources/assets/nochatreports/lang/et_ee.json | 3 -- .../resources/assets/nochatreports/lang/ko_kr.json | 3 -- .../resources/assets/nochatreports/lang/pl_pl.json | 3 -- .../resources/assets/nochatreports/lang/pt_br.json | 3 -- .../resources/assets/nochatreports/lang/ru_ru.json | 3 -- .../resources/assets/nochatreports/lang/th_th.json | 3 -- src/main/resources/nochatreports.mixins.json | 1 + 25 files changed, 133 insertions(+), 145 deletions(-) create mode 100644 src/main/java/com/aizistral/nochatreports/NCRMixinPlugin.java (limited to 'src/main') diff --git a/src/main/java/com/aizistral/nochatreports/NCRMixinPlugin.java b/src/main/java/com/aizistral/nochatreports/NCRMixinPlugin.java new file mode 100644 index 0000000..ab2ca85 --- /dev/null +++ b/src/main/java/com/aizistral/nochatreports/NCRMixinPlugin.java @@ -0,0 +1,46 @@ +package com.aizistral.nochatreports; + +import java.util.List; +import java.util.Set; + +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +import com.aizistral.nochatreports.config.NCRConfig; + +public class NCRMixinPlugin implements IMixinConfigPlugin { + private static final String TOGGLE_BUTTON_MIXIN = "com.aizistral.nochatreports.mixins.client.MixinJoinMultiplayerScreen"; + + @Override + public void onLoad(String mixinPackage) { + } + + @Override + public String getRefMapperConfig() { + return null; + } + + @Override + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { + return NCRConfig.isModRunning() || TOGGLE_BUTTON_MIXIN.equals(mixinClassName); + } + + @Override + public void acceptTargets(Set myTargets, Set otherTargets) { + } + + @Override + public List getMixins() { + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } + +} diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReports.java b/src/main/java/com/aizistral/nochatreports/NoChatReports.java index 1d5f054..f702d92 100644 --- a/src/main/java/com/aizistral/nochatreports/NoChatReports.java +++ b/src/main/java/com/aizistral/nochatreports/NoChatReports.java @@ -14,6 +14,7 @@ import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.server.network.ServerLoginPacketListenerImpl; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; @@ -24,6 +25,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.loading.FMLEnvironment; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.event.EventNetworkChannel; import net.minecraftforge.network.simple.SimpleChannel; @@ -39,6 +41,11 @@ public class NoChatReports { private static boolean detectedOnClient = false, detectedOnServer = false; public NoChatReports() { + if (!NCRConfig.isModRunning()) { + LOGGER.info("No Chat Reports is disabled in its config and will not initialize."); + return; + } + LOGGER.info("KONNICHIWA ZA WARUDO!"); LOGGER.info("Default JVM text encoding is: " + Charset.defaultCharset().displayName()); @@ -49,7 +56,12 @@ public class NoChatReports { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onLoadComplete); MinecraftForge.EVENT_BUS.register(this); - NCRConfig.load(); + + if (FMLEnvironment.dist == Dist.CLIENT) { + NoChatReportsClient.registerListeners(); + } + + NCRConfig.save(); } private void onLoadComplete(FMLLoadCompleteEvent event) { @@ -60,9 +72,6 @@ public class NoChatReports { channel = NetworkRegistry.ChannelBuilder.named(new ResourceLocation(MODID, "main")) .networkProtocolVersion(() -> PTC_VERSION) .clientAcceptedVersions(version -> { - if (!NCRConfig.getClient().enableMod()) - return true; - detectedOnServer = !isAbsentOrVanilla(version); return NCRConfig.getClient().demandOnServer() ? PTC_VERSION.equals(version) : true; }) diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java index 27cdb64..684973d 100644 --- a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java +++ b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java @@ -25,12 +25,9 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.ClientPlayerNetworkEvent; import net.minecraftforge.client.event.ScreenEvent; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod.EventBusSubscriber; -import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; -@EventBusSubscriber(modid = NoChatReports.MODID, bus = Bus.FORGE) public class NoChatReportsClient { private static final List KEY_DISCONNECT_REASONS = ImmutableList.of( "multiplayer.disconnect.missing_public_key", @@ -49,15 +46,17 @@ public class NoChatReportsClient { throw new IllegalStateException("Can't touch this"); } - @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public static void registerListeners() { + MinecraftForge.EVENT_BUS.addListener(NoChatReportsClient::onScreenInit); + MinecraftForge.EVENT_BUS.addListener(NoChatReportsClient::onPlayReady); + } + @OnlyIn(Dist.CLIENT) public static void onScreenInit(ScreenEvent.Init.Post event) { Minecraft client = Minecraft.getInstance(); Screen screen = event.getScreen(); - if (!NCRConfig.getClient().enableMod()) - return; - if (screen instanceof AccessorDisconnectedScreen dsc) { if (screenOverride || ServerSafetyState.isOnServer() || screen.getTitle() == CONNECT_FAILED_NCR) return; @@ -117,9 +116,6 @@ public class NoChatReportsClient { @OnlyIn(Dist.CLIENT) public static void onDisconnect(Minecraft client) { - if (!NCRConfig.getClient().enableMod()) - return; - if (NCRConfig.getCommon().enableDebugLog()) { NoChatReports.LOGGER.info("Disconnected from server, resetting safety state!"); } @@ -128,14 +124,10 @@ public class NoChatReportsClient { ServerSafetyState.setDisconnectMillis(Util.getMillis()); } - @SubscribeEvent @OnlyIn(Dist.CLIENT) public static void onPlayReady(ClientPlayerNetworkEvent.LoggingIn event) { Minecraft client = Minecraft.getInstance(); - if (!NCRConfig.getClient().enableMod()) - return; - client.execute(() -> { ServerSafetyState.setReconnectCount(0); ServerSafetyState.setOnServer(true); diff --git a/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java b/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java index e92a067..fc0b2cb 100644 --- a/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java +++ b/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java @@ -8,7 +8,9 @@ import java.nio.file.Path; import java.util.Optional; import java.util.function.Supplier; -import com.aizistral.nochatreports.NoChatReports; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import com.google.gson.ExclusionStrategy; import com.google.gson.FieldAttributes; import com.google.gson.Gson; @@ -17,6 +19,7 @@ import com.google.gson.GsonBuilder; import net.minecraftforge.fml.loading.FMLPaths; public abstract class JSONConfig { + protected static final Logger LOGGER = LogManager.getLogger("NoChatReports"); protected static final Path CONFIG_DIR = FMLPaths.CONFIGDIR.get(); protected static final Gson GSON = new GsonBuilder().setPrettyPrinting() .setExclusionStrategies(new ExclusionStrategy() { @@ -44,7 +47,7 @@ public abstract class JSONConfig { } public void saveFile() { - NoChatReports.LOGGER.info("Writing config file {}...", this.fileName); + LOGGER.info("Writing config file {}...", this.fileName); writeFile(this.fileName, this); } @@ -55,7 +58,7 @@ public abstract class JSONConfig { public abstract JSONConfig getDefault(); public static T loadConfig(Class configClass, Supplier freshInstance, String fileName) { - NoChatReports.LOGGER.info("Reading config file {}...", fileName); + LOGGER.info("Reading config file {}...", fileName); T config = readFile(fileName, configClass).orElseGet(freshInstance); config.uponLoad(); return config; @@ -70,7 +73,7 @@ public abstract class JSONConfig { try (BufferedReader reader = Files.newBufferedReader(file)) { return Optional.of(GSON.fromJson(reader, configClass)); } catch (IOException ex) { - NoChatReports.LOGGER.fatal("Could not read config file: {}", file); + LOGGER.fatal("Could not read config file: {}", file); ex.printStackTrace(); return null; } @@ -85,7 +88,7 @@ public abstract class JSONConfig { GSON.toJson(config, writer); } } catch (Exception ex) { - NoChatReports.LOGGER.fatal("Could not write config file: {}", file); + LOGGER.fatal("Could not write config file: {}", file); throw new RuntimeException(ex); } } diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java index 548cc15..5120e53 100644 --- a/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java +++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java @@ -5,12 +5,10 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Objects; -import java.util.function.Supplier; +import java.util.List; import javax.annotation.Nullable; -import com.aizistral.nochatreports.NoChatReports; - import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.loading.FMLEnvironment; @@ -19,51 +17,51 @@ public final class NCRConfig { private static NCRConfigCommon common = null; private static NCRConfigClient client = null; private static NCRServerWhitelist whitelist = null; + private static boolean modRunning = false; private NCRConfig() { throw new IllegalStateException("Can't touch this"); } - public static NCRConfigCommon getCommon() { - return checkLoaded(() -> common); - } + public static synchronized NCRConfigCommon getCommon() { + if (common == null) { + common = JSONConfig.loadConfig(NCRConfigCommon.class, NCRConfigCommon::new, NCRConfigCommon.FILE_NAME); + modRunning = common.getSavedEnableMod(); + JSONConfig.LOGGER.info("Mod Enabled: {}", modRunning); + } - @OnlyIn(Dist.CLIENT) - public static NCRConfigClient getClient() { - return checkLoaded(() -> client); + return common; } - @OnlyIn(Dist.CLIENT) - public static NCRServerWhitelist getServerWhitelist() { - return checkLoaded(() -> whitelist); + public static boolean isModRunning() { + getCommon(); + return modRunning; } - private static T checkLoaded(Supplier config) { - if (config.get() == null) { - load(); + @OnlyIn(Dist.CLIENT) + public static synchronized NCRConfigClient getClient() { + if (client == null) { + client = JSONConfig.loadConfig(NCRConfigClient.class, NCRConfigClient::new, NCRConfigClient.FILE_NAME); } - return config.get(); + return client; } - public static void load() { - common = JSONConfig.loadConfig(NCRConfigCommon.class, NCRConfigCommon::new, NCRConfigCommon.FILE_NAME); - - if (FMLEnvironment.dist == Dist.CLIENT) { - client = JSONConfig.loadConfig(NCRConfigClient.class, NCRConfigClient::new, NCRConfigClient.FILE_NAME); + @OnlyIn(Dist.CLIENT) + public static synchronized NCRServerWhitelist getServerWhitelist() { + if (whitelist == null) { whitelist = JSONConfig.loadConfig(NCRServerWhitelist.class, NCRServerWhitelist::new, NCRServerWhitelist.FILE_NAME); } - save(); + return whitelist; } public static void save() { - checkLoaded(() -> common).saveFile(); + List configs = FMLEnvironment.dist == Dist.CLIENT + ? List.of(getCommon(), getClient(), getServerWhitelist()) + : List.of(getCommon()); - if (FMLEnvironment.dist == Dist.CLIENT) { - checkLoaded(() -> client).saveFile(); - checkLoaded(() -> whitelist).saveFile(); - } + configs.forEach(JSONConfig::saveFile); Path readme = JSONConfig.CONFIG_DIR.resolve("NoChatReports/README.md"); try { @@ -73,7 +71,7 @@ public final class NCRConfig { https://github.com/Aizistral-Studios/No-Chat-Reports/wiki/Configuration-Files """, StandardCharsets.UTF_8); } catch (Exception ex) { - NoChatReports.LOGGER.fatal("Could not write README file: {}", readme); + JSONConfig.LOGGER.fatal("Could not write README file: {}", readme); throw new RuntimeException(ex); } } diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java index 7f0e5e3..3c1294e 100644 --- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java +++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java @@ -22,7 +22,7 @@ public final class NCRConfigClient extends JSONConfig { hideYellowChatIndicators = true, hideGrayChatIndicators = true, hideWarningToast = true, alwaysHideReportButton = false, disableTelemetry = true, whitelistAllServers = false, verifiedIconEnabled = true, showNCRButton = true, - enableMod = true, skipRealmsWarning = false; + skipRealmsWarning = false; protected int verifiedIconOffsetX = 0, verifiedIconOffsetY = 0, reconnectAwaitSeconds = 4, postDisconnectAwaitSeconds = 10, signingCheckDelaySeconds = 43200; @@ -37,10 +37,6 @@ public final class NCRConfigClient extends JSONConfig { return new NCRConfigClient(); } - public void toggleMod() { - this.enableMod = !this.enableMod; - } - /** * @return True if client with No Chat Reports installed should demand that mod is present on * every server that it tries to join. In that case client will not be able to join servers that @@ -184,14 +180,6 @@ public final class NCRConfigClient extends JSONConfig { return this.showNCRButton; } - /** - * @return Whether or not No Chat Reports should provide networking-related functionality. - */ - - public boolean enableMod() { - return this.enableMod; - } - /** * @return How many seconds No Chat Reports should wait before attemting automatic reconnects. * @see Issue #190 diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java index 7aa0322..3b2b02f 100644 --- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java +++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java @@ -8,6 +8,7 @@ import com.google.common.base.Preconditions; public final class NCRConfigCommon extends JSONConfig { protected static final String FILE_NAME = "NoChatReports/NCR-Common.json"; + protected boolean enableMod = true; protected String demandOnClientMessage = "You do not have No Chat Reports, and this server is" + " configured to require it on client!"; protected boolean demandOnClient = true, enableDebugLog = false, convertToGameMessage = false, @@ -22,6 +23,15 @@ public final class NCRConfigCommon extends JSONConfig { return new NCRConfigCommon(); } + public boolean getSavedEnableMod() { + return this.enableMod; + } + + public void setSavedEnableMod(boolean enableMod) { + this.enableMod = enableMod; + this.saveFile(); + } + /** * @return True if server with No Chat Reports installed should demand that mod is present on * every client that tries to join. Mod's installation on client is optional otherwise.

diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java index 6b3d0f5..cbde922 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java @@ -5,7 +5,6 @@ import java.util.List; import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.Mixin; -import com.aizistral.nochatreports.config.NCRConfig; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; @@ -45,9 +44,6 @@ public class MixinChatOptionsScreen extends SimpleOptionsSubScreen { protected void init() { super.init(); - if (!NCRConfig.getClient().enableMod()) - return; - this.secureChatTooltip = Minecraft.getInstance().font.split(Component.translatable("gui.nochatreport.secureChat"), 200); this.onlyShowSecureChat = this.list.findOption(Minecraft.getInstance().options.onlyShowSecureChat()); @@ -66,9 +62,6 @@ public class MixinChatOptionsScreen extends SimpleOptionsSubScreen { public void render(@NotNull PoseStack poseStack, int x, int y, float f) { super.render(poseStack, x, y, f); - if (!NCRConfig.getClient().enableMod()) - return; - if (this.onlyShowSecureChat != null && this.onlyShowSecureChat.visible && x >= (double) this.onlyShowSecureChat.x && y >= (double) this.onlyShowSecureChat.y && x < (double) (this.onlyShowSecureChat.x + this.onlyShowSecureChat.getWidth()) && y < (double) (this.onlyShowSecureChat.y + this.onlyShowSecureChat.getHeight())) { this.renderTooltip(poseStack, this.secureChatTooltip, x, y); } 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 6d11d92..b9e02cb 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java @@ -49,7 +49,7 @@ public abstract class MixinChatScreen extends Screen { private void onInit(CallbackInfo info) { int buttonX = this.width - 23; - if (NCRConfig.getClient().showServerSafety() && NCRConfig.getClient().enableMod()) { + if (NCRConfig.getClient().showServerSafety()) { ServerSafetyLevel trust = this.minecraft.isLocalServer() ? ServerSafetyLevel.SECURE : ServerSafetyState.getCurrent(); var button = new ImageButton(buttonX, this.height - 37, 20, 20, this.getXOffset(trust), diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinClientboundHelloPacket.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinClientboundHelloPacket.java index 82df5af..36989e8 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinClientboundHelloPacket.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinClientboundHelloPacket.java @@ -5,7 +5,6 @@ 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.config.NCRConfig; import com.aizistral.nochatreports.core.ServerSafetyLevel; import com.aizistral.nochatreports.core.ServerSafetyState; @@ -24,9 +23,6 @@ public class MixinClientboundHelloPacket { @Inject(method = "handle", at = @At("HEAD")) private void onHandle(ClientLoginPacketListener listener, CallbackInfo info) { - if (!NCRConfig.getClient().enableMod()) - return; - ServerSafetyState.setSessionRequestedKey(true); } diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java index 947729d..a371689 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java @@ -30,9 +30,6 @@ public class MixinConnectScreen { @Inject(method = "startConnecting", at = @At("HEAD")) private static void onStartConnecting(Screen screen, Minecraft minecraft, ServerAddress serverAddress, @Nullable ServerData serverData, CallbackInfo info) { - if (!NCRConfig.getClient().enableMod()) - return; - ServerSafetyState.updateCurrent(ServerSafetyLevel.UNDEFINED); // just to be 100% sure ServerSafetyState.setLastConnectedServer(serverAddress, serverData); diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinJoinMultiplayerScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinJoinMultiplayerScreen.java index 3f37f45..6c022d8 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinJoinMultiplayerScreen.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinJoinMultiplayerScreen.java @@ -6,13 +6,13 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.aizistral.nochatreports.config.NCRConfig; -import com.aizistral.nochatreports.core.ServerSafetyState; import net.minecraft.client.gui.components.ImageButton; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen; import net.minecraft.locale.Language; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; /** @@ -31,27 +31,29 @@ public abstract class MixinJoinMultiplayerScreen extends Screen { @Inject(method = "init", at = @At("HEAD")) private void onInit(CallbackInfo info) { - if (NCRConfig.getClient().showNCRButton()) { + if (!NCRConfig.isModRunning() || NCRConfig.getClient().showNCRButton()) { var button = new ImageButton(this.width/2 + 158, this.height - 28, 20, 20, - NCRConfig.getClient().enableMod() ? 0 : 20, 0, 20, TOGGLE_TEXTURE, 64, 64, + NCRConfig.getCommon().getSavedEnableMod() ? 0 : 20, 0, 20, TOGGLE_TEXTURE, 64, 64, btn -> { - NCRConfig.getClient().toggleMod(); - boolean enabled = NCRConfig.getClient().enableMod(); + NCRConfig.getCommon().setSavedEnableMod(!NCRConfig.getCommon().getSavedEnableMod()); + boolean enabled = NCRConfig.getCommon().getSavedEnableMod(); if (enabled) { ((ImageButton)btn).xTexStart = 0; } else { ((ImageButton)btn).xTexStart = 20; } + }, (btn, poseStack, i, j) -> { + boolean enabled = NCRConfig.getCommon().getSavedEnableMod(); + MutableComponent tooltip = Component.translatable("gui.nochatreports.ncr_toggle_tooltip", + Language.getInstance().getOrDefault("gui.nochatreports.ncr_state_" + (enabled ? "on" : "off"))); - ServerSafetyState.reset(); - }, (btn, poseStack, i, j) -> this.renderTooltip(poseStack, - this.minecraft.font.split( - Component.translatable("gui.nochatreports.ncr_toggle_tooltip", - Language.getInstance() - .getOrDefault("gui.nochatreports.ncr_state_" - + (NCRConfig.getClient().enableMod() - ? "on" : "off"))), 250), i, j), + if (enabled != NCRConfig.isModRunning()) { + tooltip.append("\n").append(Component.translatable("gui.nochatreports.ncr_toggle_restart_pending")); + } + + this.renderTooltip(poseStack, this.minecraft.font.split(tooltip, 250), i, j); + }, Component.translatable("gui.nochatreports.ncr_toggle")); button.active = true; button.visible = true; diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinLocalPlayer.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinLocalPlayer.java index 9e43d68..1f7d3be 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinLocalPlayer.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinLocalPlayer.java @@ -7,7 +7,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.aizistral.nochatreports.config.NCRConfig; import com.aizistral.nochatreports.core.ServerSafetyState; import com.mojang.brigadier.ParseResults; @@ -31,9 +30,6 @@ public class MixinLocalPlayer { @Inject(method = "signMessage", at = @At("HEAD"), cancellable = true) private void onSignMessage(MessageSigner signer, ChatMessageContent message, LastSeenMessages messages, CallbackInfoReturnable info) { - if (!NCRConfig.getClient().enableMod()) - return; - if (!ServerSafetyState.forceSignedMessages()) { info.setReturnValue(MessageSignature.EMPTY); } @@ -46,9 +42,6 @@ public class MixinLocalPlayer { @Inject(method = "signCommandArguments", at = @At("HEAD"), cancellable = true) private void onSignCommand(MessageSigner signer, ParseResults results, @Nullable Component component, LastSeenMessages messages, CallbackInfoReturnable info) { - if (!NCRConfig.getClient().enableMod()) - return; - if (!ServerSafetyState.forceSignedMessages()) { info.setReturnValue(ArgumentSignatures.EMPTY); } diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinOptions.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinOptions.java index 8bbdbfb..b6cde14 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinOptions.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinOptions.java @@ -6,7 +6,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.aizistral.nochatreports.config.NCRConfig; import com.google.common.collect.ImmutableList; import com.mojang.serialization.Codec; @@ -26,9 +25,6 @@ public class MixinOptions { @Inject(method = "onlyShowSecureChat", at = @At("RETURN"), cancellable = true) private void onlyShowSecureChat(CallbackInfoReturnable> cir) { - if (!NCRConfig.getClient().enableMod()) - return; - if (this.alternativeOption == null) { this.alternativeOption = new OptionInstance<>("options.onlyShowSecureChat", OptionInstance.cachedConstantTooltip(Component.translatable("gui.nochatreport.secureChat")), diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java index 407a7ed..b9b4731 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java @@ -8,7 +8,6 @@ import org.spongepowered.asm.mixin.injection.Group; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.aizistral.nochatreports.config.NCRConfig; import com.aizistral.nochatreports.core.ServerSafetyState; import com.mojang.authlib.yggdrasil.response.KeyPairResponse; @@ -28,9 +27,6 @@ public class MixinProfileKeyPairManager { @Inject(method = "profilePublicKey", at = @At("HEAD"), cancellable = true) private void onProfilePublicKey(CallbackInfoReturnable> info) { - if (!NCRConfig.getClient().enableMod()) - return; - if (!ServerSafetyState.allowsUnsafeServer()) { info.setReturnValue(Optional.empty()); } @@ -45,9 +41,6 @@ public class MixinProfileKeyPairManager { @Group(min = 1, max = 2) @Inject(method = "parsePublicKey", at = @At("HEAD"), cancellable = true) private static void onParsePublicKey(KeyPairResponse response, CallbackInfoReturnable info) { - if (!NCRConfig.getClient().enableMod()) - return; - if (!ServerSafetyState.allowsUnsafeServer()) { info.setReturnValue(null); } @@ -62,9 +55,6 @@ public class MixinProfileKeyPairManager { @Group(min = 1, max = 2) @Inject(method = { "profilePublicKeyData", "method_43784" }, at = @At("HEAD"), cancellable = true, remap = false) private void onProfilePublicKeyData(CallbackInfoReturnable> info) { - if (!NCRConfig.getClient().enableMod()) - return; - if (!ServerSafetyState.allowsUnsafeServer()) { info.setReturnValue(Optional.empty()); } @@ -78,9 +68,6 @@ public class MixinProfileKeyPairManager { @Inject(method = "signer", at = @At("HEAD"), cancellable = true) private void onSigner(CallbackInfoReturnable> info) { - if (!NCRConfig.getClient().enableMod()) - return; - if (!ServerSafetyState.allowsUnsafeServer()) { info.setReturnValue(null); } 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 5fd58dd..cc26877 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinRealmsConnect.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinRealmsConnect.java @@ -5,7 +5,6 @@ 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.config.NCRConfig; import com.aizistral.nochatreports.core.ServerSafetyLevel; import com.aizistral.nochatreports.core.ServerSafetyState; import com.mojang.realmsclient.dto.RealmsServer; @@ -23,9 +22,6 @@ public class MixinRealmsConnect { @Inject(method = "connect", at = @At("HEAD")) private void onConnect(RealmsServer realmsServer, ServerAddress serverAddress, CallbackInfo info) { - if (!NCRConfig.getClient().enableMod()) - return; - ServerSafetyState.setLastConnectedServer(serverAddress, null); ServerSafetyState.updateCurrent(ServerSafetyLevel.REALMS); ServerSafetyState.setAllowsUnsafeServer(true); diff --git a/src/main/resources/assets/nochatreports/lang/en_pt.json b/src/main/resources/assets/nochatreports/lang/en_pt.json index 746ce50..93ea8eb 100644 --- a/src/main/resources/assets/nochatreports/lang/en_pt.json +++ b/src/main/resources/assets/nochatreports/lang/en_pt.json @@ -12,7 +12,6 @@ "gui.nochatreports.unsafe_server.contents": "This here server requires all chat messages to be signed, which means they can be reported to Mojang, which may result in a ban from all multiplayer servers. This here likely means that there the server owner kept \"enforce-secure-profile\" enabled in the server.properties, which be the default since 1.19.1. Ye can choose to play anyway, but No Chat Reports will not be able to protect ye.", "gui.nochatreports.unsafe_server.check": "Do not show again fer this here server", "gui.nochatreports.verified_server": "§a§lSafe Server§r\nWe could verify that there this here server 'as No Chat Reports installed, or prevents chat reports in some other known way. Ye can chat there safely.", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nDisable or enable most o' the mod's client-sided functionality. Ye may 'ave to do this here to join some Paper/Velocity servers, as they be known fer causin' issues with NCR.\nCertain networking-unrelated things, such as chat trust status tweaks an' removal o' vanilla's \"Chat messages can't be verified\" toast will still work; they can be disabled in config individually.", "gui.nochatreports.ncr_state_on": "§a§lEnabled§r", "gui.nochatreports.ncr_state_off": "§c§lDisabled§r", @@ -51,9 +50,7 @@ "option.NoChatReports.whitelistAllServers": "Whitelist all servers", "option.NoChatReports.whitelistAllServers.tooltip": "Makes the mod behave as if all servers was added to §oWhitelisted Servers§r list.", "option.NoChatReports.showNCRButton": "Show NCR button", - "option.NoChatReports.showNCRButton.tooltip": "Adds a button that there toggles most o' the mod's client-sided functionality to multiplayer menu.", "option.NoChatReports.enableMod": "Enable mod", - "option.NoChatReports.enableMod.tooltip": "Responsible fer enablin' most o' the mod's client-sided functionality, see option above.", "configuration.NoChatReports.category.whitelistedServers": "Whitelisted Servers", diff --git a/src/main/resources/assets/nochatreports/lang/en_us.json b/src/main/resources/assets/nochatreports/lang/en_us.json index b6ab939..7cddd24 100644 --- a/src/main/resources/assets/nochatreports/lang/en_us.json +++ b/src/main/resources/assets/nochatreports/lang/en_us.json @@ -14,7 +14,8 @@ "gui.nochatreports.unsafe_server.contents": "This server requires all chat messages to be signed, which means they can be reported to Mojang, which may result in a ban from all multiplayer servers. This likely means that the server owner kept \"enforce-secure-profile\" enabled in the server.properties, which is the default since 1.19.1. You can choose to play anyway, but No Chat Reports will not be able to protect you.", "gui.nochatreports.unsafe_server.check": "Do not show again for this server", "gui.nochatreports.verified_server": "§a§lSafe Server§r\nWe could verify that this server has No Chat Reports installed, or prevents chat reports in some other known way. You can chat there safely.", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nDisable or enable most of the mod's client-sided functionality. You may have to do this to join some Paper/Velocity servers, as they are known for causing issues with NCR.\nCertain networking-unrelated things, such as encryption, chat trust status tweaks and removal of vanilla's \"Chat messages can't be verified\" toast will still work; they can be disabled in config individually.", + "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nCompletely enables or disables the mod. Takes effect only after restarting the game.", + "gui.nochatreports.ncr_toggle_restart_pending": "§6Restart pending: restart the game to apply this change.§r", "gui.nochatreports.ncr_state_on": "§a§lEnabled§r", "gui.nochatreports.ncr_state_off": "§c§lDisabled§r", "gui.nochatreports.encryption_warning.learn_more": "Learn More", @@ -27,6 +28,7 @@ "configuration.NoChatReports.config": "No Chat Reports", + "configuration.NoChatReports.category.common": "Common", "configuration.NoChatReports.category.visual": "Visual", "option.NoChatReports.showServerSafety": "Show server safety", @@ -60,9 +62,9 @@ "option.NoChatReports.whitelistAllServers": "Whitelist all servers", "option.NoChatReports.whitelistAllServers.tooltip": "Makes the mod behave as if all servers were added to §oWhitelisted Servers§r list.", "option.NoChatReports.showNCRButton": "Show NCR button", - "option.NoChatReports.showNCRButton.tooltip": "Adds a button that toggles most of the mod's client-sided functionality to multiplayer menu.", + "option.NoChatReports.showNCRButton.tooltip": "Adds a button that completely enables or disables the mod to the multiplayer menu. The button is always shown while the mod is disabled.", "option.NoChatReports.enableMod": "Enable mod", - "option.NoChatReports.enableMod.tooltip": "Responsible for enabling most of the mod's client-sided functionality, see option above.", + "option.NoChatReports.enableMod.tooltip": "Completely enables or disables the mod. Takes effect only after restarting the game.", "option.NoChatReports.reconnectAwaitSeconds": "Reconnect await seconds", "option.NoChatReports.reconnectAwaitSeconds.tooltip": "Number of seconds which client should wait before automatic reconnect once server rejects connection without chat signing key, assuming user agreed to enter unsafe server.", "option.NoChatReports.postDisconnectAwaitSeconds": "Post disconnect await seconds", diff --git a/src/main/resources/assets/nochatreports/lang/et_ee.json b/src/main/resources/assets/nochatreports/lang/et_ee.json index f78c09a..98a7535 100644 --- a/src/main/resources/assets/nochatreports/lang/et_ee.json +++ b/src/main/resources/assets/nochatreports/lang/et_ee.json @@ -14,7 +14,6 @@ "gui.nochatreports.unsafe_server.contents": "See server nõuab kõikide vestlussõnumite signeerimist, seega neid saab Mojangile raporteerida ning tagajärjeks võib olla blokeering kõigist mitmikmängu serveritest. See tõenäoliselt tähendab, et serveri omanik jättis failis server.properties valiku \"enforce-secure-profile\" lubatuks, mis on ka vaikeväärtus alates versioonist 1.19.1. Sa võid siiski seal mängida, kuid No Chat Reports ei saa sind kaitsta.", "gui.nochatreports.unsafe_server.check": "Ära kuva selle serveri puhul uuesti", "gui.nochatreports.verified_server": "§a§lTurvaline server§r\nKinnitasime, et serverile on paigaldatud mod No Chat Reports või see piirab sõnumitest teatamist mõnel muul teadaoleval viisil. Sa saad turvaliselt vestelda.", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nKeela või luba enamus modi kliendipoolsest funktsionaalsusest. See võib olla vajalik teatud Paper/Velocity serveritega ühendumiseks, kuna need on teadaolevalt NCRiga probleeme põhjustanud.\nTeatud võrguga mitteseonduvad asjad, nagu serveri turvataseme kuvamine ning vanilli \"Vestlussõnumeid ei saa kinnitada\" hüpiku eemaldus töötavad siiski; neid saab seadistustes individuaalselt lülitada.", "gui.nochatreports.ncr_state_on": "§a§llubatud§r", "gui.nochatreports.ncr_state_off": "§c§lkeelatud§r", "gui.nochatreports.encryption_warning.learn_more": "Lisateave", @@ -60,9 +59,7 @@ "option.NoChatReports.whitelistAllServers": "Kõik serverid lubamisloendisse", "option.NoChatReports.whitelistAllServers.tooltip": "Sunnib modi käituma nii, nagu kõik serverid oleksid lisatud §olubamisloendis serverite§r loendisse.", "option.NoChatReports.showNCRButton": "Kuva NCRi nupp", - "option.NoChatReports.showNCRButton.tooltip": "Lisab mitmikmängumenüüsse nupu, mis lülitab enamikku modi kliendipoolsest funktsionaalsusest.", "option.NoChatReports.enableMod": "Mod lubatud", - "option.NoChatReports.enableMod.tooltip": "Vastutab enamiku modi kliendipoolse funktsionaalsuse eest, vaata ülalolevat valikut.", "option.NoChatReports.reconnectAwaitSeconds": "Taasühendamise ooteaeg sekundites", "option.NoChatReports.reconnectAwaitSeconds.tooltip": "Sekundite arv, mida klient peaks ootama enne automaatset taasühendumist, kui server lükkab ühenduse tagasi ilma vestluse allkirjastamise võtmeta, eeldades, et kasutaja on nõustunud sisenema ebaturvalisse serverisse.", "option.NoChatReports.postDisconnectAwaitSeconds": "Pärast-lahtiühendamist ooteaeg", diff --git a/src/main/resources/assets/nochatreports/lang/ko_kr.json b/src/main/resources/assets/nochatreports/lang/ko_kr.json index 67977a2..656b2b2 100644 --- a/src/main/resources/assets/nochatreports/lang/ko_kr.json +++ b/src/main/resources/assets/nochatreports/lang/ko_kr.json @@ -12,7 +12,6 @@ "gui.nochatreports.unsafe_server.contents": "이 서버는 모든 대화 메시지에 서명할 것을 요구하며, 이는 대화 메시지가 Mojang에 신고될 수 있다는 것을 의미합니다. 서버 소유자가 1.19.1 이후 기본값인 server.properties 내의 'enforce-secure-profile'을 켰을 수 있습니다. 이를 무시하고 플레이할 수 있지만 No Chat Reports는 당신을 보호할 수 없습니다.", "gui.nochatreports.unsafe_server.check": "이 서버에 대해 이 화면을 다시 보지 않기", "gui.nochatreports.verified_server": "§a§l안전한 서버§r\nNo Chat Reports가 설치되어 있거나 다른 알려진 방식으로 대화 메시지를 신고하는 것을 방지하는 것을 확인할 수 있습니다. 안전하게 대화할 수 있습니다.", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\n모드의 대부분의 클라이언트 기능들을 활성화하거나 비활성화합니다. No Chat Reports와 문제를 일으키는 것으로 알려진 일부 Paper/Velocity 서버에 접속하기 위해 모드를 비활성화해야할 수 있습니다.\n암호화, 대화 신뢰 상태 조정 및 바닐라의 \"대화 메세지가 검증될 수 없습니다.\" 알림 제거 등 네트워킹과 관련이 없는 일부 기능은 작동하며 모드 설정에서 개별적으로 비활성화할 수 있습니다.", "gui.nochatreports.ncr_state_on": "§a§l활성화됨§r", "gui.nochatreports.ncr_state_off": "§c§l비활성화됨§r", "gui.nochatreports.encryption_warning.learn_more": "더 알아보기", @@ -52,9 +51,7 @@ "option.NoChatReports.whitelistAllServers": "모든 서버를 화이트리스트에 추가", "option.NoChatReports.whitelistAllServers.tooltip": "모드가 모든 서버가 §o서버 화이트리스트§r 목록에 추가된 것처럼 작동하게 합니다.", "option.NoChatReports.showNCRButton": "NCR 버튼 표시", - "option.NoChatReports.showNCRButton.tooltip": "멀티플레이 메뉴에 모드의 대부분의 클라이언트 측 기능을 토글하는 버튼을 추가합니다.", "option.NoChatReports.enableMod": "모드 활성화", - "option.NoChatReports.enableMod.tooltip": "모드의 대부분의 클라이언트 측 기능을 활성화합니다. 위의 설정을 보십시오.", "configuration.NoChatReports.category.whitelistedServers": "서버 화이트리스트", diff --git a/src/main/resources/assets/nochatreports/lang/pl_pl.json b/src/main/resources/assets/nochatreports/lang/pl_pl.json index 9b9788b..c412902 100644 --- a/src/main/resources/assets/nochatreports/lang/pl_pl.json +++ b/src/main/resources/assets/nochatreports/lang/pl_pl.json @@ -12,7 +12,6 @@ "gui.nochatreports.unsafe_server.contents": "Ten serwer wymaga podpisania wszystkich wiadomości czatu, co oznacza, że można je zgłaszać do Mojang. Prawdopodobnie oznacza to, że właściciel serwera pozostawił włączony „enforce-secure-profile” w server.properties, co jest ustawieniem domyślnym od 1.19.1. Pomimo to możesz dalej zagrać, ale No Chat Reports nie będzie w stanie Cię ochronić.", "gui.nochatreports.unsafe_server.check": "Nie pokazuj ponownie dla tego serwera", "gui.nochatreports.verified_server": "§a§lBezpieczny serwer§r\nMożemy sprawdzić, czy na tym serwerze zainstalowano No Chat Reports lub w inny znany sposób zapobiec raportowaniu z czatu. Możesz tam bezpiecznie czatować.", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nWyłącz lub włącz większość funkcji po stronie klienta moda. Być może będziesz musiał to zrobić, aby dołączyć do niektórych serwerów Paper/Velocity, ponieważ są one znane z powodowania problemów z NCR.\nNiektóre rzeczy niezwiązane z siecią, takie jak szyfrowanie, poprawianie stanu zaufania czatu i usuwanie wanilii „Wiadomości na czacie nie mogą być zweryfikowane\" toasty nadal będą działać; można je wyłączyć w konfiguracji indywidualnie.", "gui.nochatreports.ncr_state_on": "§a§lWłączony§r", "gui.nochatreports.ncr_state_off": "§c§lWyłączony§r", "gui.nochatreports.encryption_warning.learn_more": "Dowiedz się więcej", @@ -52,9 +51,7 @@ "option.NoChatReports.whitelistAllServers": "Dodaj wszystkie serwery do białej listy", "option.NoChatReports.whitelistAllServers.tooltip": "Sprawia, że mod zachowuje się tak, jakby wszystkie serwery zostały dodane do §oBiałej listy serwerów§r.", "option.NoChatReports.showNCRButton": "Pokaż przycisk NCR", - "option.NoChatReports.showNCRButton.tooltip": "Dodaje przycisk, który przełącza większość funkcjonalności moda po stronie klienta do menu gry wieloosobowej.", "option.NoChatReports.enableMod": "Włącz modyfikacje", - "option.NoChatReports.enableMod.tooltip": "Odpowiedzialny za włączenie większości funkcjonalności modów po stronie klienta, patrz opcja powyżej.", "configuration.NoChatReports.category.whitelistedServers": "Serwery w białej liście", diff --git a/src/main/resources/assets/nochatreports/lang/pt_br.json b/src/main/resources/assets/nochatreports/lang/pt_br.json index 43c6e6a..28af379 100644 --- a/src/main/resources/assets/nochatreports/lang/pt_br.json +++ b/src/main/resources/assets/nochatreports/lang/pt_br.json @@ -14,7 +14,6 @@ "gui.nochatreports.unsafe_server.contents": "Este servidor exige que todas as mensagens de bate-papo sejam assinadas, o que significa que elas podem ser relatadas ao Mojang, o que pode resultar em uma proibição de todos os servidores multiplayer.Isso provavelmente significa que o proprietário do servidor manteve \"enforce-secure-profile\" ativado no server.properties, que é o padrão desde 1.19.1.Você pode optar por jogar de qualquer maneira, mas nenhum relatório de bate-papo não será capaz de protegê -lo.", "gui.nochatreports.unsafe_server.check": "Não mostre novamente para este servidor", "gui.nochatreports.verified_server": "§a§lServidor seguro§r\nPoderíamos verificar se este servidor não possui relatórios de bate-papo instalados ou evita relatórios de bate-papo de outra maneira conhecida.Você pode conversar lá com segurança.", - "gui.nochatreports.ncr_toggle_tooltip": "§lSem relatórios de bate-papo:§r %1$s\nDesative ou habilite a maioria da funcionalidade do lado do cliente do MOD.Você pode ter que fazer isso para ingressar em alguns servidores de papel/velocidade, pois eles são conhecidos por causar problemas com a NCR.\nCerta networking-unrelated things, como criptografia, ajustes de status de confiança de bate-papo e remoção de vanilla \"As mensagens de bate-papo não podem ser verificadas\" A torrada ainda funcionará;Eles podem ser desativados na configuração individualmente.", "gui.nochatreports.ncr_state_on": "§a§lHabilitada§r", "gui.nochatreports.ncr_state_off": "§c§lDesabilitada§r", "gui.nochatreports.encryption_warning.learn_more": "Saber mais", @@ -60,9 +59,7 @@ "option.NoChatReports.whitelistAllServers": "Whitelist todos os servidores", "option.NoChatReports.whitelistAllServers.tooltip": "Faz com que o mod se comporte como se todos os servidores fossem adicionados a §oServidores de permissões na lista de permissões§r Lista.", "option.NoChatReports.showNCRButton": "Mostre o botão NCR", - "option.NoChatReports.showNCRButton.tooltip": "Adiciona um botão que alterna a maior parte da funcionalidade do lado do Mod ao menu multiplayer.", "option.NoChatReports.enableMod": "Ativar mod", - "option.NoChatReports.enableMod.tooltip": "Responsável por ativar a maioria da funcionalidade do lado do Mod, consulte a opção acima.", "option.NoChatReports.reconnectAwaitSeconds": "Reconectar aguardar segundos", "option.NoChatReports.reconnectAwaitSeconds.tooltip": "Número de segundos, qual cliente deve esperar antes da reconectar automática assim que o servidor rejeitar a conexão sem a chave de assinatura de bate-papo, assumindo que o usuário concordasse em inserir o servidor inseguro.", "option.NoChatReports.postDisconnectAwaitSeconds": "Pós -desconexão aguarda segundos", diff --git a/src/main/resources/assets/nochatreports/lang/ru_ru.json b/src/main/resources/assets/nochatreports/lang/ru_ru.json index 32d32ca..a585369 100644 --- a/src/main/resources/assets/nochatreports/lang/ru_ru.json +++ b/src/main/resources/assets/nochatreports/lang/ru_ru.json @@ -13,7 +13,6 @@ "gui.nochatreports.unsafe_server.contents": "Сервер требует, чтобы все сообщения игроков были подписаны, поэтому они могут быть отправлены в Mojang, что может для вас обернуться §lглобальным баном§r. Скорее всего, владелец сервера не отключил \"enforce-secure-profile\" в \"server.properties\" (включено по умолчанию с 1.19.1). Это предупреждение можно проигнорировать, но тогда No Chat Reports не сможет защитить вас.", "gui.nochatreports.unsafe_server.check": "Больше не предупреждать об этом сервере", "gui.nochatreports.verified_server": "§a§lБезопасный сервер§r\nБыло обнаружено, что сервер либо содержит No Chat Reports, либо предотвращает возможность отправки жалоб иным известным способом. Здесь можно общаться безопасно.", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nПереключение большей части клиентского функционала мода. Это может быть необходимо для игры на серверах с Paper/Velocity, так как они известны своими проблемами с NCR.\nНекоторые несвязанные с сетевым взаимодействием функции, такие как \"удаление запугивающих уведомлений\", всё ещё могут работать и быть настроены индивидуально.", "gui.nochatreports.ncr_state_on": "§a§lВключено§r", "gui.nochatreports.ncr_state_off": "§c§lВыключено§r", @@ -52,9 +51,7 @@ "option.NoChatReports.whitelistAllServers": "Разрешить все серверы", "option.NoChatReports.whitelistAllServers.tooltip": "Считать каждый сервер добавленным в §oБелый список§r серверов.", "option.NoChatReports.showNCRButton": "Показать кнопку переключения", - "option.NoChatReports.showNCRButton.tooltip": "Добавить на экран сетевой игры кнопку для переключения большинства клиентских функций мода.", "option.NoChatReports.enableMod": "Включить мод", - "option.NoChatReports.enableMod.tooltip": "Ручное переключение большей части функций мода на стороне клиента.", "configuration.NoChatReports.category.whitelistedServers": "Белый список", diff --git a/src/main/resources/assets/nochatreports/lang/th_th.json b/src/main/resources/assets/nochatreports/lang/th_th.json index 412a0a1..59bf6e9 100644 --- a/src/main/resources/assets/nochatreports/lang/th_th.json +++ b/src/main/resources/assets/nochatreports/lang/th_th.json @@ -13,7 +13,6 @@ "gui.nochatreports.unsafe_server.contents": "เซิร์ฟเวอร์นี้ต้องการการลงนามข้อความแช็ตทุกข้อความ หมายความว่าข้อความเหล่านั้นมีสิทธิ์ที่จะถูกรายงานไปยัง Mojang ได้ ซึ่งอาจส่งผลให้ถูกแบนจากเซิร์ฟเวอร์ผู้เล่นหลายคนทุกเซิร์ฟเวอร์ สิ่งนี้มีความเป็นไปได้ว่าเจ้าของเซิร์ฟเวอร์ได้เปิดคุณสมบัติ \"enforce-secure-profile\" ไว้ในไฟล์ที่ชื่อว่า server.properties ซึ่งเป็นค่าเริ่มต้นตั้งแต่เวอร์ชั่น 1.19.1 ของเกม คุณสามารถเลือกที่จะเล่นต่อไปได้ แต่ม็อด No Chat Reports จะไม่สามารถปกป้องคุณได้ทุกกรณี", "gui.nochatreports.unsafe_server.check": "ไม่ต้องแสดงอีกสำหรับเซิร์ฟเวอร์นี้", "gui.nochatreports.verified_server": "§a§lเซิร์ฟเวอร์ดังกล่าวปลอดภัย§r\nเรายืนยันได้ว่าเซิร์ฟเวอร์นี้มีม็อด No Chat Reports ติดตั้งไว้ หรือมีการป้องการการรายงานแช็ตไม่ทางใดก็ทางหนึ่ง คุณสามารถพูดคุยผ่านแช็ตได้อย่างปลอดภัยหายห่วง", - "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nปิดหรือเปิดฟังก์ชันต่าง ๆ ของม็อดฝั่งไคลเอนต์ ซึ่งคุณอาจจำเป็นต้องเปิดหรือปิดตัวเลือกนี้เพื่อให้สามารถเข้าเล่นเซิร์ฟเวอร์ของ Paper หรือ Velocity บางเซิร์ฟเวอร์ได้, เนื่องมาจากเซิร์ฟเวอร์เหล่านี้มักมีปัญหากับม็อดนี้.\nฟีเจอร์บางอย่างที่ไม่เกี่ยวข้องกับเครือข่าย เช่น การเข้ารหัส การปรับปรุงสถานะความน่าเชื่อถือของแช็ต และการนำโทสต์ \"ไม่สามารถยืนยันข้อความแช็ตได้\" ออก จะยังคงใช้งานได้ตามปกติ ฟีเจอร์เหล่านี้สามารถปิดแยกแต่ละฟีเจอร์ได้", "gui.nochatreports.ncr_state_on": "§a§lเปิด§r", "gui.nochatreports.ncr_state_off": "§c§lปิด§r", "gui.nochatreports.encryption_warning.learn_more": "เรียนรู้เพิ่มเติม", @@ -55,9 +54,7 @@ "option.NoChatReports.whitelistAllServers": "อนุญาตทุกเซิร์ฟเวอร์", "option.NoChatReports.whitelistAllServers.tooltip": "ทำให้ม็อดทำตัวราวกับว่าเซิร์ฟเวอร์ทุกเซิร์ฟเวอร์ได้ถูกเพิ่มเข้าไปในรายการ §oเซิร์ฟเวอร์ที่ได้รับอนุญาต§r แล้ว", "option.NoChatReports.showNCRButton": "แสดงปุ่ม NCR", - "option.NoChatReports.showNCRButton.tooltip": "เพิ่มปุ่มที่สามารถเปิดปิดฟังก์ชันส่วนใหญ่ของม็อดฝั่งไคลเอนต์ได้เข้าไปในหน้าเมนูผู้เล่นหลายคน", "option.NoChatReports.enableMod": "เปิดการใช้งานม็อด", - "option.NoChatReports.enableMod.tooltip": "มีหน้าที่เปิดหรือปิดฟังก์ชันส่วนใหญ่ของม็อดฝั่งไคลเอนต์ โปรดดูตัวเลือกได้ทางด้านบนของตัวเลือก", "configuration.NoChatReports.category.whitelistedServers": "เซิร์ฟเวอร์ที่ได้รับอนุญาต", diff --git a/src/main/resources/nochatreports.mixins.json b/src/main/resources/nochatreports.mixins.json index e0b2fa6..e7457b9 100644 --- a/src/main/resources/nochatreports.mixins.json +++ b/src/main/resources/nochatreports.mixins.json @@ -2,6 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.aizistral.nochatreports.mixins", + "plugin": "com.aizistral.nochatreports.NCRMixinPlugin", "compatibilityLevel": "JAVA_17", "refmap": "nochatreports.refmap.json", "verbose": true, -- cgit v1.2.3