summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAizistral2023-01-02 14:37:04 +0100
committerAizistral2023-01-02 14:37:04 +0100
commitaf90a12079c558ea4a1efc9385e93bcdcb9917dd (patch)
tree2eccea5899a998bbd52be8fa15c5eb6cd0430ae0 /src
parent6d61f99a1547eab58e88dcea7e3901511f0929d2 (diff)
Commence work on branch unification
Diffstat (limited to 'src')
-rw-r--r--src/fabric/java/com/aizistral/nochatreports/fabric/RandomFabricClass.java9
-rw-r--r--src/fabric/java/com/aizistral/nochatreports/fabric/mixins/MixinMinecraft.java20
-rw-r--r--src/fabric/resources/fabric.mod.json (renamed from src/main/resources/fabric.mod.json)3
-rw-r--r--src/fabric/resources/nochatreports-fabric.mixins.json (renamed from src/test/resources/nochatreportstest.mixins.json)4
-rw-r--r--src/fabric/resources/nochatreports.accesswidener (renamed from src/main/resources/nochatreports.accesswidener)0
-rw-r--r--src/main/java/com/aizistral/nochatreports/NoChatReports.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/JSONConfig.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfig.java6
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRServerPreferences.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/ServerAddressAdapter.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/ServerSafetyState.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/SigningMode.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java5
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java5
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java4
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java5
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java4
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/Encryption.java7
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/AdvancedImageButton.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java4
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/RealmsWarningScreen.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/TriageWarningScreen.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/UnsafeServerScreen.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java1
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java3
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinServerStatusPinger$1.java33
-rw-r--r--src/main/resources/nochatreports.mixins.json3
-rw-r--r--src/test/java/com/aizistral/nochatreports/debug/NoChatReportsDebug.java44
-rw-r--r--src/test/java/com/aizistral/nochatreports/debug/ReportWriter.java41
-rw-r--r--src/test/java/com/aizistral/nochatreports/debug/UnrealPlayer.java64
-rw-r--r--src/test/java/com/aizistral/nochatreports/debug/mixins/MixinAbuseReportSenderServices.java39
-rw-r--r--src/test/java/com/aizistral/nochatreports/debug/mixins/MixinMinecraft.java24
-rw-r--r--src/test/java/com/aizistral/nochatreports/debug/mixins/MixinPlayerEntry.java26
-rw-r--r--src/test/resources/NCR_logo.pngbin1580 -> 0 bytes
-rw-r--r--src/test/resources/assets/minecraft/textures/gui/title/edition.pngbin453 -> 0 bytes
-rw-r--r--src/test/resources/fabric.mod.json36
54 files changed, 153 insertions, 290 deletions
diff --git a/src/fabric/java/com/aizistral/nochatreports/fabric/RandomFabricClass.java b/src/fabric/java/com/aizistral/nochatreports/fabric/RandomFabricClass.java
new file mode 100644
index 0000000..c2bfc09
--- /dev/null
+++ b/src/fabric/java/com/aizistral/nochatreports/fabric/RandomFabricClass.java
@@ -0,0 +1,9 @@
+package com.aizistral.nochatreports.fabric;
+
+public class RandomFabricClass {
+ public static final String HELLO = "HELLO";
+
+ public RandomFabricClass() {
+
+ }
+}
diff --git a/src/fabric/java/com/aizistral/nochatreports/fabric/mixins/MixinMinecraft.java b/src/fabric/java/com/aizistral/nochatreports/fabric/mixins/MixinMinecraft.java
new file mode 100644
index 0000000..70f3f9e
--- /dev/null
+++ b/src/fabric/java/com/aizistral/nochatreports/fabric/mixins/MixinMinecraft.java
@@ -0,0 +1,20 @@
+package com.aizistral.nochatreports.fabric.mixins;
+
+import org.spongepowered.asm.mixin.Mixin;
+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.NoChatReports;
+
+import net.minecraft.client.Minecraft;
+
+@Mixin(Minecraft.class)
+public class MixinMinecraft {
+
+ @Inject(method = "run", at = @At("HEAD"))
+ private void onRun(CallbackInfo info) {
+ NoChatReports.LOGGER.info("Game entered main loop!");
+ }
+
+}
diff --git a/src/main/resources/fabric.mod.json b/src/fabric/resources/fabric.mod.json
index e158781..c883c9f 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/fabric/resources/fabric.mod.json
@@ -33,7 +33,8 @@
]
},
"mixins": [
- "nochatreports.mixins.json"
+ "nochatreports.mixins.json",
+ "nochatreports-fabric.mixins.json"
],
"depends": {
diff --git a/src/test/resources/nochatreportstest.mixins.json b/src/fabric/resources/nochatreports-fabric.mixins.json
index 94fec99..3406294 100644
--- a/src/test/resources/nochatreportstest.mixins.json
+++ b/src/fabric/resources/nochatreports-fabric.mixins.json
@@ -1,14 +1,12 @@
{
"required": true,
"minVersion": "0.8",
- "package": "com.aizistral.nochatreports.debug.mixins",
+ "package": "com.aizistral.nochatreports.fabric.mixins",
"compatibilityLevel": "JAVA_17",
"verbose": true,
"mixins": [
],
"client": [
- "MixinPlayerEntry",
- "MixinAbuseReportSenderServices",
"MixinMinecraft"
],
"server": [
diff --git a/src/main/resources/nochatreports.accesswidener b/src/fabric/resources/nochatreports.accesswidener
index ccf4f65..ccf4f65 100644
--- a/src/main/resources/nochatreports.accesswidener
+++ b/src/fabric/resources/nochatreports.accesswidener
diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReports.java b/src/main/java/com/aizistral/nochatreports/NoChatReports.java
index a70f8f0..584e8ac 100644
--- a/src/main/java/com/aizistral/nochatreports/NoChatReports.java
+++ b/src/main/java/com/aizistral/nochatreports/NoChatReports.java
@@ -1,6 +1,5 @@
package com.aizistral.nochatreports;
-import com.aizistral.nochatreports.config.NCRConfig;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.networking.v1.PacketSender;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
@@ -12,6 +11,8 @@ import net.minecraft.server.network.ServerGamePacketListenerImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import com.aizistral.nochatreports.config.NCRConfig;
+
import java.nio.charset.Charset;
/**
diff --git a/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java b/src/main/java/com/aizistral/nochatreports/NoChatReportsClient.java
index 4cd2f8e..2fa7ecf 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.NoChatReports;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.core.ServerDataExtension;
import com.aizistral.nochatreports.core.ServerSafetyLevel;
diff --git a/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java b/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java
index edc8bec..6f5f488 100644
--- a/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java
@@ -9,6 +9,8 @@ import java.util.Optional;
import java.util.function.Supplier;
import com.aizistral.nochatreports.NoChatReports;
+import com.aizistral.nochatreports.config.JSONConfig;
+import com.aizistral.nochatreports.config.ServerAddressAdapter;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
diff --git a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java
index 7a90aa8..6163a88 100644
--- a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java
+++ b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports.config;
+import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.core.ServerSafetyState;
import com.aizistral.nochatreports.core.SigningMode;
import com.aizistral.nochatreports.gui.FontHelper;
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java
index 7f203bc..5a1137f 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java
@@ -1,6 +1,12 @@
package com.aizistral.nochatreports.config;
import com.aizistral.nochatreports.NoChatReports;
+import com.aizistral.nochatreports.config.JSONConfig;
+import com.aizistral.nochatreports.config.NCRConfigClient;
+import com.aizistral.nochatreports.config.NCRConfigCommon;
+import com.aizistral.nochatreports.config.NCRConfigEncryption;
+import com.aizistral.nochatreports.config.NCRServerPreferences;
+
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.loader.api.FabricLoader;
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java
index 6054f7e..800deaf 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java
@@ -1,5 +1,7 @@
package com.aizistral.nochatreports.config;
+import com.aizistral.nochatreports.config.JSONConfig;
+import com.aizistral.nochatreports.config.NCRConfigClient;
import com.aizistral.nochatreports.core.ServerSafetyLevel;
import com.aizistral.nochatreports.core.SigningMode;
import com.aizistral.nochatreports.mixins.client.MixinChatListener;
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java
index 38df30e..861f57d 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfigCommon.java
@@ -1,5 +1,8 @@
package com.aizistral.nochatreports.config;
+import com.aizistral.nochatreports.config.JSONConfig;
+import com.aizistral.nochatreports.config.NCRConfigCommon;
+
public final class NCRConfigCommon extends JSONConfig {
protected static final String FILE_NAME = "NoChatReports/NCR-Common.json";
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java
index 525abff..6cd4f0a 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java
@@ -1,5 +1,7 @@
package com.aizistral.nochatreports.config;
+import com.aizistral.nochatreports.config.JSONConfig;
+import com.aizistral.nochatreports.config.NCRConfigEncryption;
import com.aizistral.nochatreports.encryption.Encryption;
import com.aizistral.nochatreports.encryption.Encryptor;
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRServerPreferences.java b/src/main/java/com/aizistral/nochatreports/config/NCRServerPreferences.java
index d94be20..81ad97f 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRServerPreferences.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRServerPreferences.java
@@ -8,6 +8,8 @@ import java.util.Optional;
import org.jetbrains.annotations.Nullable;
import com.aizistral.nochatreports.NoChatReportsClient;
+import com.aizistral.nochatreports.config.JSONConfig;
+import com.aizistral.nochatreports.config.NCRServerPreferences;
import com.aizistral.nochatreports.core.ServerSafetyLevel;
import com.aizistral.nochatreports.core.ServerSafetyState;
import com.aizistral.nochatreports.core.SigningMode;
diff --git a/src/main/java/com/aizistral/nochatreports/config/ServerAddressAdapter.java b/src/main/java/com/aizistral/nochatreports/config/ServerAddressAdapter.java
index c68aed9..8d63bd1 100644
--- a/src/main/java/com/aizistral/nochatreports/config/ServerAddressAdapter.java
+++ b/src/main/java/com/aizistral/nochatreports/config/ServerAddressAdapter.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports.config;
+import com.aizistral.nochatreports.config.ServerAddressAdapter;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
diff --git a/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java b/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java
index 39e9a11..a614bba 100644
--- a/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java
+++ b/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java
@@ -2,6 +2,7 @@ package com.aizistral.nochatreports.core;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.encryption.Encryptor;
+
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentContents;
import net.minecraft.network.chat.MutableComponent;
diff --git a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java
index 69e69aa..817f192 100644
--- a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java
+++ b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java
@@ -1,5 +1,7 @@
package com.aizistral.nochatreports.core;
+import com.aizistral.nochatreports.core.ServerSafetyState;
+
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.network.chat.Component;
diff --git a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyState.java b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyState.java
index ced4281..73b08ad 100644
--- a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyState.java
+++ b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyState.java
@@ -1,6 +1,8 @@
package com.aizistral.nochatreports.core;
+import com.aizistral.nochatreports.core.ServerSafetyLevel;
import com.aizistral.nochatreports.gui.UnsafeServerScreen;
+
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
diff --git a/src/main/java/com/aizistral/nochatreports/core/SigningMode.java b/src/main/java/com/aizistral/nochatreports/core/SigningMode.java
index 3402d6c..32b6dba 100644
--- a/src/main/java/com/aizistral/nochatreports/core/SigningMode.java
+++ b/src/main/java/com/aizistral/nochatreports/core/SigningMode.java
@@ -3,6 +3,7 @@ package com.aizistral.nochatreports.core;
import org.jetbrains.annotations.Nullable;
import com.aizistral.nochatreports.config.NCRConfig;
+import com.aizistral.nochatreports.core.SigningMode;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java
index 09b075c..197f753 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java
@@ -2,6 +2,9 @@ package com.aizistral.nochatreports.encryption;
import java.security.InvalidKeyException;
+import com.aizistral.nochatreports.encryption.AESCFB8Encryptor;
+import com.aizistral.nochatreports.encryption.AESEncryption;
+
public class AESCFB8Encryption extends AESEncryption {
protected AESCFB8Encryption() {
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java
index 63476f3..c4f045d 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java
@@ -4,6 +4,11 @@ import net.minecraft.util.Tuple;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
+
+import com.aizistral.nochatreports.encryption.AESCFB8Encryption;
+import com.aizistral.nochatreports.encryption.AESEncryptor;
+import com.aizistral.nochatreports.encryption.Encryption;
+
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.spec.AlgorithmParameterSpec;
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java
index 359d509..5c4216a 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java
@@ -2,6 +2,9 @@ package com.aizistral.nochatreports.encryption;
import java.security.InvalidKeyException;
+import com.aizistral.nochatreports.encryption.AESECBEncryptor;
+import com.aizistral.nochatreports.encryption.AESEncryption;
+
public class AESECBEncryption extends AESEncryption {
protected AESECBEncryption() {
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java
index a853f0c..d12051a 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java
@@ -3,6 +3,11 @@ package com.aizistral.nochatreports.encryption;
import net.minecraft.util.Tuple;
import javax.crypto.SecretKey;
+
+import com.aizistral.nochatreports.encryption.AESECBEncryption;
+import com.aizistral.nochatreports.encryption.AESEncryptor;
+import com.aizistral.nochatreports.encryption.Encryption;
+
import java.security.InvalidKeyException;
import java.security.spec.AlgorithmParameterSpec;
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java
index f2c4922..84145d2 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java
@@ -7,6 +7,9 @@ import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
+
+import com.aizistral.nochatreports.encryption.Encryption;
+
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java
index 2094c5a8..cfde341 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java
@@ -4,6 +4,10 @@ import net.minecraft.util.Tuple;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
+
+import com.aizistral.nochatreports.encryption.AESEncryption;
+import com.aizistral.nochatreports.encryption.Encryptor;
+
import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java
index f50ec85..edb5eb4 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java
@@ -2,6 +2,9 @@ package com.aizistral.nochatreports.encryption;
import java.security.InvalidKeyException;
+import com.aizistral.nochatreports.encryption.AESEncryption;
+import com.aizistral.nochatreports.encryption.AESGCMEncryptor;
+
public class AESGCMEncryption extends AESEncryption {
protected AESGCMEncryption() {
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java
index 9ef7ed7..c2f5450 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java
@@ -4,6 +4,11 @@ import net.minecraft.util.Tuple;
import javax.crypto.SecretKey;
import javax.crypto.spec.GCMParameterSpec;
+
+import com.aizistral.nochatreports.encryption.AESEncryptor;
+import com.aizistral.nochatreports.encryption.AESGCMEncryption;
+import com.aizistral.nochatreports.encryption.Encryption;
+
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.spec.AlgorithmParameterSpec;
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java
index 16536bc..5ea07d7 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java
@@ -3,6 +3,9 @@ package com.aizistral.nochatreports.encryption;
import java.security.InvalidKeyException;
import java.security.SecureRandom;
+import com.aizistral.nochatreports.encryption.CaesarEncryptor;
+import com.aizistral.nochatreports.encryption.Encryption;
+
public class CaesarEncryption extends Encryption {
protected CaesarEncryption() {
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java
index 926c657..ada6a66 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java
@@ -2,6 +2,10 @@ package com.aizistral.nochatreports.encryption;
import java.security.InvalidKeyException;
+import com.aizistral.nochatreports.encryption.CaesarEncryption;
+import com.aizistral.nochatreports.encryption.Encryption;
+import com.aizistral.nochatreports.encryption.Encryptor;
+
public class CaesarEncryptor extends Encryptor<CaesarEncryption> {
private static final char PARAGRAPH = '\u00a7', PARAGRAPH_PLACEHOLDER = '\uffef',
DELETE = '\u007f', DELETE_PLACEHOLDER = '\ufff0';
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java b/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java
index 0e32da8..e9e2248 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java
@@ -6,6 +6,13 @@ import java.util.Base64;
import java.util.Collections;
import java.util.List;
+import com.aizistral.nochatreports.encryption.AESCFB8Encryption;
+import com.aizistral.nochatreports.encryption.AESECBEncryption;
+import com.aizistral.nochatreports.encryption.AESGCMEncryption;
+import com.aizistral.nochatreports.encryption.CaesarEncryption;
+import com.aizistral.nochatreports.encryption.Encryption;
+import com.aizistral.nochatreports.encryption.Encryptor;
+
public abstract class Encryption {
private static final List<Encryption> REGISTERED = new ArrayList<>();
protected static final Base64.Encoder BASE64_ENCODER = Base64.getEncoder();
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java
index 0ccd39c..346db89 100644
--- a/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java
+++ b/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java
@@ -9,6 +9,8 @@ import java.security.InvalidKeyException;
import java.security.SecureRandom;
import java.util.Arrays;
+import com.aizistral.nochatreports.encryption.Encryption;
+
public abstract class Encryptor<T extends Encryption> {
protected static final SecureRandom RANDOM = new SecureRandom();
protected static final Char2CharMap BASE64R_SHIFTS = createBase64RShifts();
diff --git a/src/main/java/com/aizistral/nochatreports/gui/AdvancedImageButton.java b/src/main/java/com/aizistral/nochatreports/gui/AdvancedImageButton.java
index 0b1f2d8..25f6d54 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/AdvancedImageButton.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/AdvancedImageButton.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports.gui;
+import com.aizistral.nochatreports.gui.AdvancedTooltip;
import com.mojang.blaze3d.vertex.PoseStack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java b/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java
index 9523845..0dddb9c 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports.gui;
+import com.aizistral.nochatreports.gui.AdvancedTooltip;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*;
import net.fabricmc.api.EnvType;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java b/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java
index 2b0d94a..9303c18 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java
@@ -1,6 +1,10 @@
package com.aizistral.nochatreports.gui;
import com.aizistral.nochatreports.config.NCRConfig;
+import com.aizistral.nochatreports.gui.AdvancedImageButton;
+import com.aizistral.nochatreports.gui.EncryptionConfigScreen;
+import com.aizistral.nochatreports.gui.EncryptionWarningScreen;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.ImageButton;
import net.minecraft.client.gui.screens.Screen;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java b/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java
index 1ecbd34..89fa174 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java
@@ -3,6 +3,8 @@ package com.aizistral.nochatreports.gui;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.config.NCRConfigEncryption;
import com.aizistral.nochatreports.encryption.Encryption;
+import com.aizistral.nochatreports.gui.AdvancedImageButton;
+import com.aizistral.nochatreports.gui.AdvancedTooltip;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.fabricmc.api.EnvType;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java b/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java
index 0882a0a..0c1b9f3 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java
@@ -1,6 +1,9 @@
package com.aizistral.nochatreports.gui;
import com.aizistral.nochatreports.config.NCRConfig;
+import com.aizistral.nochatreports.gui.EncryptionConfigScreen;
+import com.aizistral.nochatreports.gui.TriageWarningScreen;
+
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.ChatFormatting;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/RealmsWarningScreen.java b/src/main/java/com/aizistral/nochatreports/gui/RealmsWarningScreen.java
index 3fb2b79..86120a4 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/RealmsWarningScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/RealmsWarningScreen.java
@@ -1,6 +1,8 @@
package com.aizistral.nochatreports.gui;
import com.aizistral.nochatreports.config.NCRConfig;
+import com.aizistral.nochatreports.gui.TriageWarningScreen;
+
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/TriageWarningScreen.java b/src/main/java/com/aizistral/nochatreports/gui/TriageWarningScreen.java
index 56817c6..03e31f9 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/TriageWarningScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/TriageWarningScreen.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports.gui;
+import com.aizistral.nochatreports.gui.AdaptiveWarningScreen;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
diff --git a/src/main/java/com/aizistral/nochatreports/gui/UnsafeServerScreen.java b/src/main/java/com/aizistral/nochatreports/gui/UnsafeServerScreen.java
index 36820a8..20c5604 100644
--- a/src/main/java/com/aizistral/nochatreports/gui/UnsafeServerScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/gui/UnsafeServerScreen.java
@@ -4,6 +4,7 @@ import com.aizistral.nochatreports.NoChatReports;
import com.aizistral.nochatreports.NoChatReportsClient;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.core.ServerSafetyState;
+import com.aizistral.nochatreports.gui.AdaptiveWarningScreen;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java
index b023769..0238320 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java
@@ -3,6 +3,7 @@ package com.aizistral.nochatreports.mixins.client;
import com.aizistral.nochatreports.NoChatReports;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.core.EncryptionUtil;
+
import net.minecraft.ChatFormatting;
import net.minecraft.client.GuiMessageTag;
import net.minecraft.client.gui.components.ChatComponent;
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
index 30ac570..675e642 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
@@ -8,6 +8,7 @@ import com.aizistral.nochatreports.core.ServerSafetyLevel;
import com.aizistral.nochatreports.core.ServerSafetyState;
import com.aizistral.nochatreports.core.SigningMode;
import com.aizistral.nochatreports.gui.UnsafeServerScreen;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.client.multiplayer.chat.ChatListener;
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 75e4705..73ec799 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinConnectScreen.java
@@ -3,6 +3,7 @@ package com.aizistral.nochatreports.mixins.client;
import com.aizistral.nochatreports.NoChatReports;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.core.ServerSafetyState;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ConnectScreen;
import net.minecraft.client.gui.screens.Screen;
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java
index 754db1f..969afd0 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java
@@ -1,12 +1,13 @@
package com.aizistral.nochatreports.mixins.client;
-import com.aizistral.nochatreports.config.NCRConfig;
import net.minecraft.client.GuiMessageTag;
import org.spongepowered.asm.mixin.Mixin;
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;
+
@Mixin(GuiMessageTag.class)
public class MixinGuiMessageTag {
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinServerStatusPinger$1.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinServerStatusPinger$1.java
index 7da207f..fb0d66b 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinServerStatusPinger$1.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinServerStatusPinger$1.java
@@ -1,5 +1,7 @@
package com.aizistral.nochatreports.mixins.client;
+import java.lang.reflect.Field;
+
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -17,8 +19,18 @@ import net.minecraft.network.protocol.status.ServerStatus;
@Mixin(targets = "net/minecraft/client/multiplayer/ServerStatusPinger$1")
public class MixinServerStatusPinger$1 {
- @Shadow @Final
- private ServerData val$data;
+ private static final Field SERVER_DATA_FIELD;
+
+ static {
+ // We use reflection here because Mixin's AP dies when trying to process @Shadow of this lol
+ try {
+ Class<?> pinger = Class.forName("net.minecraft.client.multiplayer.ServerStatusPinger$1");
+ SERVER_DATA_FIELD = pinger.getDeclaredField("val$p_105460_");
+ SERVER_DATA_FIELD.setAccessible(true);
+ } catch (Exception ex) {
+ throw new RuntimeException("Reflection failed in MixinServerStatusPinger$1", ex);
+ }
+ }
/**
* @reason Ensure "preventsChatReports" property is transferred from {@link ServerStatus} to
@@ -29,14 +41,17 @@ public class MixinServerStatusPinger$1 {
@Inject(method = "handleStatusResponse(Lnet/minecraft/network/protocol/status/ClientboundStatusResponsePacket;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/protocol/status/ServerStatus;getPlayers()Lnet/minecraft/network/protocol/status/ServerStatus$Players;", ordinal = 0, shift = At.Shift.BEFORE))
private void getNoChatReports(ClientboundStatusResponsePacket packet, CallbackInfo info) {
- boolean preventsReports = ((ServerDataExtension) packet.getStatus()).preventsChatReports();
- ((ServerDataExtension) this.val$data).setPreventsChatReports(preventsReports);
-
- if (NCRConfig.getCommon().enableDebugLog()) {
- NoChatReports.LOGGER.info("Received status response packet from server, preventsChatReports: {}",
- preventsReports);
+ try {
+ boolean preventsReports = ((ServerDataExtension) packet.getStatus()).preventsChatReports();
+ ((ServerDataExtension) SERVER_DATA_FIELD.get(this)).setPreventsChatReports(preventsReports);
+
+ if (NCRConfig.getCommon().enableDebugLog()) {
+ NoChatReports.LOGGER.info("Received status response packet from server, preventsChatReports: {}",
+ preventsReports);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException ex) {
+ throw new RuntimeException("Failed to get ServerData field via reflection", ex);
}
-
}
}
diff --git a/src/main/resources/nochatreports.mixins.json b/src/main/resources/nochatreports.mixins.json
index 82bf72c..c7c2bd0 100644
--- a/src/main/resources/nochatreports.mixins.json
+++ b/src/main/resources/nochatreports.mixins.json
@@ -39,5 +39,6 @@
],
"injectors": {
"defaultRequire": 1
- }
+ },
+ "refmap": "nochatreports.refmap.json"
}
diff --git a/src/test/java/com/aizistral/nochatreports/debug/NoChatReportsDebug.java b/src/test/java/com/aizistral/nochatreports/debug/NoChatReportsDebug.java
deleted file mode 100644
index 3d04e27..0000000
--- a/src/test/java/com/aizistral/nochatreports/debug/NoChatReportsDebug.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.aizistral.nochatreports.debug;
-
-import java.util.UUID;
-
-import com.mojang.authlib.minecraft.BanDetails;
-
-import net.fabricmc.api.ModInitializer;
-import net.fabricmc.fabric.api.networking.v1.PacketSender;
-import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
-import net.minecraft.network.chat.Component;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.network.ServerGamePacketListenerImpl;
-
-public final class NoChatReportsDebug implements ModInitializer {
- @Override
- public void onInitialize() {
- ServerPlayConnectionEvents.JOIN.register(this::onPlayReady);
- }
-
- private void onPlayReady(ServerGamePacketListenerImpl handler, PacketSender sender, MinecraftServer server) {
- server.execute(() -> {
- UnrealPlayer player = new UnrealPlayer(UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"), "Notch");
- //player.join(server, handler);
- Component component = Component.Serializer.fromJson("{\"translate\":\"%s\",\"with\":[{\"extra\":[{\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/tell Aizistral \"},\"hoverEvent\":{\"action\":\"show_entity\",\"contents\":{\"id\":\"bfa45411-874a-4ee0-b3bd-00c716059d95\",\"name\":{\"text\":\"Aizistral\"},\"type\":\"minecraft:player\"}},\"insertion\":\"Aizistral\",\"text\":\"Aizistral\"},{\"text\":\"> \"},{\"text\":\"['(9^~©²~.2>5¶(4,+:.9!¿¿\"}],\"text\":\"<\"},{\"text\":\"['(9^~©²~.2>5¶(4,+:.9!¿¿\"}]}");
- //player.sendSystem(server, handler, component);
-
- //player.sendMessage(server, handler, "This message is so real and legit", null);
-
- //UnrealPlayer.DEFAULT.join(server, handler);
- //UnrealPlayer.DEFAULT.sendMessage(server, handler, "I'm definitely not gay", "§8I§a'§bM §cG§dA§eY");
- //UnrealPlayer.DEFAULT.sendMessage(server, handler, "gOODBYE LOL", null);
- //UnrealPlayer.DEFAULT.leave(server, handler);
-
- //NoChatReports.LOGGER.info("Unreal player deployed");
- });
- }
-
- public static BanDetails getFakeBan() {
- return null;
- // return new BanDetails(UUID.fromString(Minecraft.getInstance().getUser().getUuid()),
- // null, null, null);
- }
-
-}
diff --git a/src/test/java/com/aizistral/nochatreports/debug/ReportWriter.java b/src/test/java/com/aizistral/nochatreports/debug/ReportWriter.java
deleted file mode 100644
index 538841b..0000000
--- a/src/test/java/com/aizistral/nochatreports/debug/ReportWriter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.aizistral.nochatreports.debug;
-
-import java.io.BufferedWriter;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Date;
-
-import com.aizistral.nochatreports.debug.mixins.MixinAbuseReportSenderServices;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.ibm.icu.text.SimpleDateFormat;
-import com.mojang.authlib.minecraft.client.ObjectMapper;
-import com.mojang.authlib.yggdrasil.request.AbuseReportRequest;
-
-import net.fabricmc.loader.api.FabricLoader;
-
-/**
- * Allows to save chat reports locally. See {@link MixinAbuseReportSenderServices} for details.
- *
- * @author Aizistral
- */
-
-public final class ReportWriter {
- private static final ObjectMapper MAPPER = ObjectMapper.create();
- private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
-
- public static void saveReport(AbuseReportRequest report) {
- String string = MAPPER.writeValueAsString(report);
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd_hh.mm.ss");
- Path path = FabricLoader.getInstance().getGameDir().resolve("intercepted-reports/report-"
- + format.format(Date.from(report.report.createdTime)) + ".json");
- path.getParent().toFile().mkdirs();
-
- try (BufferedWriter writer = Files.newBufferedWriter(path)) {
- GSON.toJson(GSON.fromJson(string, Object.class), writer);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
-}
diff --git a/src/test/java/com/aizistral/nochatreports/debug/UnrealPlayer.java b/src/test/java/com/aizistral/nochatreports/debug/UnrealPlayer.java
deleted file mode 100644
index 8681ae5..0000000
--- a/src/test/java/com/aizistral/nochatreports/debug/UnrealPlayer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.aizistral.nochatreports.debug;
-
-import java.util.UUID;
-
-/**
- * Exists solely to help with testing some of the features of the mod.
- * You can use this to trick client into thinking there is another player
- * on server, and send chat messages as if they are from that player.
- * <br><br>
- * DON'T FORGET TO TURN "convertToGameMessage" OFF!
- *
- * @author Aizistral
- */
-
-public class UnrealPlayer {
- public static final UnrealPlayer DEFAULT = new UnrealPlayer(UUID.fromString("bfa45411-874a-4ee0-b3bd-00c716059d95"), "Aizistral");
- private final UUID id;
- private final String name;
-
- public UnrealPlayer(UUID id, String name) {
- this.id = id;
- this.name = name;
- }
-
- // public void join(MinecraftServer server, ServerGamePacketListenerImpl connection) {
- // ClientboundPlayerInfoPacket packet = new ClientboundPlayerInfoPacket(Action.ADD_PLAYER,
- // this.getPlayer(server));
- // connection.send(packet);
- // }
- //
- // public void leave(MinecraftServer server, ServerGamePacketListenerImpl connection) {
- // ClientboundPlayerInfoPacket packet = new ClientboundPlayerInfoPacket(Action.REMOVE_PLAYER,
- // this.getPlayer(server));
- // connection.send(packet);
- // }
- //
- // public ServerPlayer getPlayer(MinecraftServer server) {
- // return new ServerPlayer(server, server.overworld(), new GameProfile(this.id, this.name), null);
- // }
- //
- // public void sendSystem(MinecraftServer server, ServerGamePacketListenerImpl connection, Component message) {
- // ServerPlayer player = this.getPlayer(server);
- // ClientboundSystemChatPacket packet = new ClientboundSystemChatPacket(message, false);
- // connection.send(packet);
- // }
- //
- // public void sendMessage(MinecraftServer server, ServerGamePacketListenerImpl connection, String message, @Nullable String unsigned) {
- // ServerPlayer player = this.getPlayer(server);
- // ClientboundPlayerChatPacket packet = new ClientboundPlayerChatPacket(new PlayerChatMessage(
- // new SignedMessageHeader(MessageSignature.EMPTY, this.id), MessageSignature.EMPTY,
- // new SignedMessageBody(new ChatMessageContent(message, Component.literal(message)), Instant.now(), 0,
- // LastSeenMessages.EMPTY), unsigned != null ? Optional.of(Component.literal(unsigned))
- // : Optional.empty(), FilterMask.PASS_THROUGH),
- // ChatType.bind(ChatType.CHAT, player).toNetwork(server.registryAccess()));
- //
- //
- // // new ClientboundPlayerChatPacket(Component.literal(message),
- // // unsigned != null ? Optional.of(Component.literal(unsigned)) : Optional.empty(), 0,
- // // new ChatSender(this.id, Component.literal(this.name)), Instant.now(),
- // // Crypt.SaltSignaturePair.EMPTY);
- // connection.send(packet);
- // }
-
-}
diff --git a/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinAbuseReportSenderServices.java b/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinAbuseReportSenderServices.java
deleted file mode 100644
index a3e7339..0000000
--- a/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinAbuseReportSenderServices.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.aizistral.nochatreports.debug.mixins;
-
-import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
-
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Overwrite;
-import org.spongepowered.asm.mixin.Shadow;
-
-import com.aizistral.nochatreports.debug.ReportWriter;
-import com.mojang.authlib.minecraft.report.AbuseReport;
-import com.mojang.authlib.yggdrasil.request.AbuseReportRequest;
-import com.mojang.datafixers.util.Unit;
-
-import net.minecraft.client.multiplayer.chat.report.AbuseReportSender;
-import net.minecraft.client.multiplayer.chat.report.ReportEnvironment;
-
-@Mixin(AbuseReportSender.Services.class)
-public class MixinAbuseReportSenderServices {
- @Shadow @Final
- private ReportEnvironment environment;
-
- /**
- * @reason Write report locally instead of trying to send it to Mojang.
- * Allows to intercept and examine contents of the report.
- * @author Aizistral
- */
-
- @Overwrite
- public CompletableFuture<Unit> send(UUID uuid, AbuseReport abuseReport) {
- AbuseReportRequest abuseReportRequest = new AbuseReportRequest(1, uuid,
- abuseReport, this.environment.clientInfo(), this.environment.thirdPartyServerInfo(),
- this.environment.realmInfo());
- ReportWriter.saveReport(abuseReportRequest);
- return CompletableFuture.supplyAsync(() -> Unit.INSTANCE);
- }
-
-}
diff --git a/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinMinecraft.java b/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinMinecraft.java
deleted file mode 100644
index 34fcf9f..0000000
--- a/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinMinecraft.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.aizistral.nochatreports.debug.mixins;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Overwrite;
-
-import com.aizistral.nochatreports.debug.NoChatReportsDebug;
-import com.mojang.authlib.minecraft.BanDetails;
-
-import net.minecraft.client.Minecraft;
-
-@Mixin(Minecraft.class)
-public class MixinMinecraft {
- /**
- * Replaces real ban screen with a fake one for testing.
- * @return Fake ban screen
- * @reason Testing
- * @author Aizistral
- */
- @Overwrite
- public BanDetails multiplayerBan() {
- return NoChatReportsDebug.getFakeBan();
- }
-
-}
diff --git a/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinPlayerEntry.java b/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinPlayerEntry.java
deleted file mode 100644
index e7e4cfc..0000000
--- a/src/test/java/com/aizistral/nochatreports/debug/mixins/MixinPlayerEntry.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.aizistral.nochatreports.debug.mixins;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Redirect;
-
-import net.minecraft.client.gui.screens.social.PlayerEntry;
-import net.minecraft.client.multiplayer.chat.report.AbuseReportSender;
-
-@Mixin(PlayerEntry.class)
-public class MixinPlayerEntry {
-
- /**
- * @reason Always allow to report players on server, even if services are
- * unreachable (which they are in IDE). Useful when used along with
- * {@link MixinAbuseReportSenderServices}.
- * @author Aizistral
- */
-
- @Redirect(method = "<init>", at = @At(value = "INVOKE", target =
- "Lnet/minecraft/client/multiplayer/chat/report/AbuseReportSender;isEnabled()Z"))
- private boolean forceEnableReporting(AbuseReportSender sender) {
- return true;
- }
-
-}
diff --git a/src/test/resources/NCR_logo.png b/src/test/resources/NCR_logo.png
deleted file mode 100644
index 9427c0b..0000000
--- a/src/test/resources/NCR_logo.png
+++ /dev/null
Binary files differ
diff --git a/src/test/resources/assets/minecraft/textures/gui/title/edition.png b/src/test/resources/assets/minecraft/textures/gui/title/edition.png
deleted file mode 100644
index 09004f4..0000000
--- a/src/test/resources/assets/minecraft/textures/gui/title/edition.png
+++ /dev/null
Binary files differ
diff --git a/src/test/resources/fabric.mod.json b/src/test/resources/fabric.mod.json
deleted file mode 100644
index d364a5f..0000000
--- a/src/test/resources/fabric.mod.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "schemaVersion": 1,
- "id": "nochatreportstest",
- "version": "${version}",
-
- "name": "No Chat Reports Test",
- "description": "Testmod",
- "authors": [
- "Aizistral"
- ],
- "contact": {
- "homepage": "https://www.curseforge.com/minecraft/mc-mods/no-chat-reports",
- "sources": "https://github.com/Aizistral-Studios/No-Chat-Reports"
- },
-
- "license": "WTFPL",
- "icon": "NCR_logo.png",
-
- "environment": "*",
- "entrypoints": {
- "main": [
- "com.aizistral.nochatreports.debug.NoChatReportsDebug"
- ]
- },
- "mixins": [
- "nochatreportstest.mixins.json"
- ],
-
- "depends": {
- "fabricloader": ">=0.14.6",
- "fabric": "*",
- "minecraft": "~1.19",
- "java": ">=17"
- },
- "suggests": {}
-}