summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java16
-rw-r--r--src/main/resources/fabric.mod.json2
2 files changed, 17 insertions, 1 deletions
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 03af7d2..74a1f34 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java
@@ -10,6 +10,7 @@ import net.minecraft.util.Signer;
import net.minecraft.world.entity.player.ProfilePublicKey;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Group;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@@ -37,6 +38,7 @@ public class MixinProfileKeyPairManager {
* @author Aizistral
*/
+ @Group(min = 1, max = 1)
@Inject(method = "parsePublicKey", at = @At("HEAD"), cancellable = true)
private static void onParsePublicKey(KeyPairResponse response, CallbackInfoReturnable<ProfilePublicKey.Data> info) {
if (!ServerSafetyState.allowsUnsafeServer()) {
@@ -45,6 +47,20 @@ public class MixinProfileKeyPairManager {
}
/**
+ * @reason Accomplishes the same thing as {@link #onParsePublicKey(KeyPairResponse, CallbackInfoReturnable)},
+ * but only in 1.19.1.
+ * @author Aizistral
+ */
+
+ @Group(min = 1, max = 1)
+ @Inject(method = "profilePublicKeyData", at = @At("HEAD"), cancellable = true)
+ private void onProfilePublicKeyData(CallbackInfoReturnable<Optional<ProfilePublicKey.Data>> info) {
+ if (!ServerSafetyState.allowsUnsafeServer()) {
+ info.setReturnValue(Optional.empty());
+ }
+ }
+
+ /**
* @reason Prevent client from trying to produce signature in
* {@link ClientHandshakePacketListenerImpl#handleHello}.
* @author Aizistral
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index cbc106f..9ff7627 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -39,7 +39,7 @@
"fabric-screen-api-v1": "*",
"fabric-rendering-v1": "*",
"fabric-resource-loader-v0": "*",
- "minecraft": "=1.19.2",
+ "minecraft": [ "=1.19.1", "=1.19.2" ],
"java": ">=17"
},
"suggests": {},