diff options
| author | Aizistral | 2022-08-26 18:04:26 +0200 |
|---|---|---|
| committer | Aizistral | 2022-08-26 18:04:26 +0200 |
| commit | 7df016a51f9251adaece0cf31fd20d35c436442d (patch) | |
| tree | 3f795c11318702a9b9fdf8198b25b177e650c81b /src/main | |
| parent | 42f30e286ebd49dbcfffcfd6f4b1001152a56e2b (diff) | |
Add some backwards compatibility with 1.19.1
Closes #170
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/com/aizistral/nochatreports/mixins/client/MixinProfileKeyPairManager.java | 16 | ||||
| -rw-r--r-- | src/main/resources/fabric.mod.json | 2 |
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": {}, |
