From dfcf9cf3547e28094fe72b63cd27729485f1685e Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Thu, 20 May 2021 09:46:34 -0300 Subject: [PATCH] update to 21w20a --- build.gradle | 2 +- .../mixin/debug/client/MixinDebugHud.java | 3 +- .../mixin/debug/client/MixinDebugHud.java | 3 +- .../mixin/debug/client/MixinDebugHud.java | 3 +- viafabric-mc117/build.gradle.kts | 8 ++--- .../fabric/mc117/gui/ViaConfigScreen.java | 9 +++-- .../client/MixinAllowedAddressResolver.java | 36 +++++++------------ .../mixin/debug/client/MixinDebugHud.java | 3 +- .../gui/client/MixinMultiplayerScreen.java | 2 +- .../mixin/debug/client/MixinDebugHud.java | 3 +- 10 files changed, 28 insertions(+), 44 deletions(-) diff --git a/build.gradle b/build.gradle index 72c42fa..995b89f 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { } def ENV = System.getenv() -def vvVer = "4.0.0-21w19a-SNAPSHOT" +def vvVer = "4.0.0-21w20a-SNAPSHOT" description = "Client-side and server-side ViaVersion implementation for Fabric" version = "0.4.0+" + ENV.GITHUB_RUN_NUMBER + "-" + getBranch() diff --git a/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/mixin/debug/client/MixinDebugHud.java b/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/mixin/debug/client/MixinDebugHud.java index e5d600f..b6ec81b 100644 --- a/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/mixin/debug/client/MixinDebugHud.java +++ b/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/mixin/debug/client/MixinDebugHud.java @@ -28,8 +28,7 @@ public class MixinDebugHud { if (protocol != null) { ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion()); ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion()); - line += " / C: " + clientVer.getName() + " (" + clientVer.getVersion() + ") S: " - + serverVer.getName() + " (" + serverVer.getVersion() + ") A: " + protocol.getUser().isActive(); + line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive(); } } diff --git a/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/mixin/debug/client/MixinDebugHud.java b/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/mixin/debug/client/MixinDebugHud.java index 96a0182..128ed2e 100644 --- a/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/mixin/debug/client/MixinDebugHud.java +++ b/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/mixin/debug/client/MixinDebugHud.java @@ -28,8 +28,7 @@ public class MixinDebugHud { if (protocol != null) { ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion()); ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion()); - line += " / C: " + clientVer.getName() + " (" + clientVer.getVersion() + ") S: " - + serverVer.getName() + " (" + serverVer.getVersion() + ") A: " + protocol.getUser().isActive(); + line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive(); } } diff --git a/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/mixin/debug/client/MixinDebugHud.java b/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/mixin/debug/client/MixinDebugHud.java index e9c5ee8..153ca2c 100644 --- a/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/mixin/debug/client/MixinDebugHud.java +++ b/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/mixin/debug/client/MixinDebugHud.java @@ -28,8 +28,7 @@ public class MixinDebugHud { if (protocol != null) { ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion()); ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion()); - line += " / C: " + clientVer.getName() + " (" + clientVer.getVersion() + ") S: " - + serverVer.getName() + " (" + serverVer.getVersion() + ") A: " + protocol.getUser().isActive(); + line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive(); } } diff --git a/viafabric-mc117/build.gradle.kts b/viafabric-mc117/build.gradle.kts index a498d1f..2edc5c5 100644 --- a/viafabric-mc117/build.gradle.kts +++ b/viafabric-mc117/build.gradle.kts @@ -1,9 +1,9 @@ version = rootProject.version dependencies { - minecraft("com.mojang:minecraft:21w19a") - mappings("net.fabricmc:yarn:21w19a+build.9:v2") + minecraft("com.mojang:minecraft:21w20a") + mappings("net.fabricmc:yarn:21w20a+build.2:v2") - modImplementation("net.fabricmc.fabric-api:fabric-api:0.34.4+1.17") - modImplementation("com.terraformersmc:modmenu:1.16.9") + modImplementation("net.fabricmc.fabric-api:fabric-api:0.34.5+1.17") + modImplementation("com.terraformersmc:modmenu:2.0.0-beta.4") } diff --git a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/gui/ViaConfigScreen.java b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/gui/ViaConfigScreen.java index 7fd5d16..684a4d4 100644 --- a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/gui/ViaConfigScreen.java +++ b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/gui/ViaConfigScreen.java @@ -41,13 +41,13 @@ public class ViaConfigScreen extends Screen { protected void init() { int entries = 0; - this.addButton(new ButtonWidget(this.width / 2 - 155 + entries % 2 * 160, + this.method_37063(new ButtonWidget(this.width / 2 - 155 + entries % 2 * 160, this.height / 6 + 24 * (entries >> 1), 150, 20, getClientSideText(), this::onClickClientSide)); entries++; - this.addButton(new ButtonWidget(this.width / 2 - 155 + entries % 2 * 160, + this.method_37063(new ButtonWidget(this.width / 2 - 155 + entries % 2 * 160, this.height / 6 + 24 * (entries >> 1), 150, 20, getHideViaButtonText(), this::onHideViaButton)); @@ -65,14 +65,14 @@ public class ViaConfigScreen extends Screen { int clientSideVersion = ViaFabric.config.getClientSideVersion(); protocolVersion.setText(ProtocolUtils.getProtocolName(clientSideVersion)); - this.children.add(protocolVersion); + this.method_37063(protocolVersion); //noinspection ConstantConditions if (entries % 2 == 1) { entries++; } - this.addButton(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 24 * (entries >> 1), 200, 20, ScreenTexts.DONE, (buttonWidget) -> this.client.openScreen(this.parent))); + this.method_37063(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 24 * (entries >> 1), 200, 20, ScreenTexts.DONE, (buttonWidget) -> this.client.openScreen(this.parent))); } private void onChangeVersionField(String text) { @@ -159,7 +159,6 @@ public class ViaConfigScreen extends Screen { this.renderBackground(matrices); drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 20, 16777215); super.render(matrices, mouseX, mouseY, delta); - protocolVersion.render(matrices, mouseX, mouseY, delta); } @Override diff --git a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/mixin/address/client/MixinAllowedAddressResolver.java b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/mixin/address/client/MixinAllowedAddressResolver.java index 23d2f15..74dee81 100644 --- a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/mixin/address/client/MixinAllowedAddressResolver.java +++ b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/mixin/address/client/MixinAllowedAddressResolver.java @@ -3,9 +3,7 @@ package com.viaversion.fabric.mc117.mixin.address.client; import com.viaversion.fabric.common.VFAddressParser; import net.minecraft.client.network.Address; import net.minecraft.client.network.AllowedAddressResolver; -import net.minecraft.client.network.RedirectResolver; import net.minecraft.client.network.ServerAddress; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -20,14 +18,10 @@ import java.util.Optional; @Mixin(AllowedAddressResolver.class) public abstract class MixinAllowedAddressResolver { @Shadow - @Final - private RedirectResolver redirectResolver; - - @Shadow - protected abstract Optional
getAllowedAddress(ServerAddress address); + public abstract Optional resolve(ServerAddress address); @Inject(method = "resolve", at = @At(value = "HEAD"), cancellable = true) - private void resolveVF(ServerAddress address, CallbackInfoReturnable