From f254cbebd202b61c3e513ba7abb351283b222934 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:58:33 +0100 Subject: [PATCH] cleanup --- .../vialegacy/MixinClassicProtocolExtension.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialegacy/MixinClassicProtocolExtension.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialegacy/MixinClassicProtocolExtension.java index ba4f9497..8911394e 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialegacy/MixinClassicProtocolExtension.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialegacy/MixinClassicProtocolExtension.java @@ -29,25 +29,19 @@ public class MixinClassicProtocolExtension { @Inject(method = "supportsVersion", at = @At("HEAD"), cancellable = true) public void allowExtensions_supportsVersion(int version, CallbackInfoReturnable cir) { - final ClassicProtocolExtension self = (ClassicProtocolExtension) (Object) this; - if (CustomClassicProtocolExtensions.ALLOWED_EXTENSIONS.contains(self)) { + if (CustomClassicProtocolExtensions.ALLOWED_EXTENSIONS.contains((ClassicProtocolExtension) (Object) this)) cir.setReturnValue(true); - } } @Inject(method = "isSupported", at = @At("HEAD"), cancellable = true) public void allowExtensions_isSupported(CallbackInfoReturnable cir) { - final ClassicProtocolExtension self = (ClassicProtocolExtension) (Object) this; - if (CustomClassicProtocolExtensions.ALLOWED_EXTENSIONS.contains(self)) { + if (CustomClassicProtocolExtensions.ALLOWED_EXTENSIONS.contains((ClassicProtocolExtension) (Object) this)) cir.setReturnValue(true); - } } @Inject(method = "getHighestSupportedVersion", at = @At("HEAD"), cancellable = true) public void allowExtensions_getHighestSupportedVersion(CallbackInfoReturnable cir) { - final ClassicProtocolExtension self = (ClassicProtocolExtension) (Object) this; - if (CustomClassicProtocolExtensions.ALLOWED_EXTENSIONS.contains(self)) { + if (CustomClassicProtocolExtensions.ALLOWED_EXTENSIONS.contains((ClassicProtocolExtension) (Object) this)) cir.setReturnValue(1); - } } }