From f4ce31638f9c775fc50bb40a829710255cd21176 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Tue, 21 Mar 2023 20:36:18 +0100 Subject: [PATCH] Bump version --- gradle.properties | 2 +- .../injection/mixin/bridge/MixinAddServerScreen.java | 3 +-- .../mixin/fixes/minecraft/screen/MixinConnectScreen_1.java | 6 +----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7eb4c40f..79b5b918 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ loader_version=0.14.17 fabric_api_version=0.76.0+1.19.4 # viafabricplus -mod_version=2.2.1 +mod_version=2.3.1 maven_group=de.florianmichael archives_base_name=viafabricplus diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/bridge/MixinAddServerScreen.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/bridge/MixinAddServerScreen.java index 80673eea..eb7d3146 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/bridge/MixinAddServerScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/bridge/MixinAddServerScreen.java @@ -44,8 +44,7 @@ public class MixinAddServerScreen extends Screen { @Inject(method = "init", at = @At("RETURN")) public void injectButton(CallbackInfo ci) { final ComparableProtocolVersion forcedVersion = ((IServerInfo) server).viafabricplus_forcedVersion(); - this.addDrawableChild(ButtonWidget. - builder(Text.literal(forcedVersion == null ? "Set version for this server" :forcedVersion.getName()), button -> + this.addDrawableChild(ButtonWidget.builder(Text.literal(forcedVersion == null ? "Set version for this server" :forcedVersion.getName()), button -> client.setScreen(new ForceVersionScreen(this, version -> ((IServerInfo) server).viafabricplus_forceVersion(version)))). position(width - (forcedVersion == null ? 150 : 98) - 5, 5).size(forcedVersion == null ? 150 : 98, 20).build()); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java index 33810897..401ad732 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java @@ -70,7 +70,6 @@ public class MixinConnectScreen_1 { public String replaceAddress(InetSocketAddress instance) { if (ProtocolHack.isOlderThanOrEqualToOrForced(instance, ProtocolVersion.v1_17) || ProtocolHack.isEqualToOrForced(instance, BedrockProtocolVersion.bedrockLatest)) return field_33737.getAddress(); - return instance.getHostString(); } @@ -78,7 +77,6 @@ public class MixinConnectScreen_1 { public int replacePort(InetSocketAddress instance) { if (ProtocolHack.isOlderThanOrEqualToOrForced(instance, ProtocolVersion.v1_17) || ProtocolHack.isEqualToOrForced(instance, BedrockProtocolVersion.bedrockLatest)) return field_33737.getPort(); - return instance.getPort(); } @@ -86,9 +84,7 @@ public class MixinConnectScreen_1 { public Object mapSocketAddress(Optional instance) { final InetSocketAddress address = instance.get(); final ComparableProtocolVersion forcedVersion = ((IServerInfo) field_40415).viafabricplus_forcedVersion(); - if (forcedVersion != null) { - ProtocolHack.getForcedVersions().put(address, forcedVersion); - } + if (forcedVersion != null) ProtocolHack.getForcedVersions().put(address, forcedVersion); return address; }