summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorAizistral2022-06-18 19:45:34 +0200
committerAizistral2022-06-18 19:45:34 +0200
commita554b8f14911ce3b707954d1f35964d0dbaf02ea (patch)
tree1561abb24a4a6bb255b0d5b3e5c9d6cb0b1cc345 /src/main
parent42a3967f1994b8c2806e1ff3abd3de92be653c4d (diff)
Configure publishing
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/aizistral/nochatreports/NoChatReports.java4
-rw-r--r--src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java3
-rw-r--r--src/main/resources/assets/nochatreports/lang/en_us.json3
3 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReports.java b/src/main/java/com/aizistral/nochatreports/NoChatReports.java
index d45c5e8..dc4d17d 100644
--- a/src/main/java/com/aizistral/nochatreports/NoChatReports.java
+++ b/src/main/java/com/aizistral/nochatreports/NoChatReports.java
@@ -33,8 +33,8 @@ public class NoChatReports implements ModInitializer {
private void onPlayReady(ServerGamePacketListenerImpl handler, PacketSender sender, MinecraftServer server) {
server.execute(() -> {
- if (!ServerPlayNetworking.canSend(handler, CHANNEL)) {
- handler.disconnect(Component.translatable("disconnect.nochatreports.server"));
+ if (NoReportsConfig.demandsOnClient() && !ServerPlayNetworking.canSend(handler, CHANNEL)) {
+ handler.disconnect(Component.literal("You do not have No Chat Reports, and this server is configured to require it on client!"));
}
});
}
diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java
index 3899a5c..075b460 100644
--- a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java
+++ b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports;
+import com.aizistral.nochatreports.handlers.NoReportsConfig;
import com.aizistral.nochatreports.network.ClientChannelHandler;
import com.aizistral.nochatreports.network.ServerChannelHandler;
@@ -26,7 +27,7 @@ public class NoChatReportsClient implements ClientModInitializer {
private void onPlayReady(ClientPacketListener handler, PacketSender sender, Minecraft client) {
client.execute(() -> {
- if (!ClientPlayNetworking.canSend(NoChatReports.CHANNEL)) {
+ if (NoReportsConfig.demandsOnServer() && !ClientPlayNetworking.canSend(NoChatReports.CHANNEL)) {
handler.getConnection().disconnect(Component.translatable("disconnect.nochatreports.client"));
}
});
diff --git a/src/main/resources/assets/nochatreports/lang/en_us.json b/src/main/resources/assets/nochatreports/lang/en_us.json
index 19fed74..d1ff40d 100644
--- a/src/main/resources/assets/nochatreports/lang/en_us.json
+++ b/src/main/resources/assets/nochatreports/lang/en_us.json
@@ -1,5 +1,4 @@
{
"gui.nochatreport.secureChat": "This option cannot work with No Chat Reports, since there are no signatures to verify.",
- "disconnect.nochatreports.client": "This server does not have No Chat Reports, and you have it configured to require itself on server.",
- "disconnect.nochatreports.server": "You do not have No Chat Reports, and this server is configured to require it on client!"
+ "disconnect.nochatreports.client": "This server does not have No Chat Reports, and you have it configured to require itself on server."
} \ No newline at end of file