From a36cf3257c49b47fd614551efcffa41277e9c373 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 19 Mar 2023 16:35:16 +0100 Subject: [PATCH] Minecraft 1.19.4 --- gradle.properties | 12 +++++++----- mc1122/build.gradle | 2 +- .../florianmichael/viaforge/GuiProtocolSelector.java | 4 ++-- .../java/de/florianmichael/viaforge/ViaForge.java | 5 ++--- .../viaforge/mixin/impl/MixinNetworkManagerSub5.java | 10 +++++----- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gradle.properties b/gradle.properties index e4db68a..6eaa55c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,14 +5,16 @@ org.gradle.daemon=false # forge mod_id=viaforge mod_name=ViaForge -mod_version=3.0.0 +mod_version=3.1.0 mod_base_package=de.enzaxd # mixin mixin_version=0.8.3 # via-version -vialoadingbase_version=ad5fd83ad1 -viaversion_version=4.6.0-23w04a-SNAPSHOT -viabackwards_version=4.6.0-23w03a-SNAPSHOT -viarewind_version=2.0.3-SNAPSHOT +vialoadingbase_version=6dad0a2561 +viaversion_version=4.6.2-SNAPSHOT +viabackwards_version=4.6.2-SNAPSHOT +viarewind_version=2.0.4-SNAPSHOT +snake_yml_version=2.0 + diff --git a/mc1122/build.gradle b/mc1122/build.gradle index 5512b7a..2229c1e 100644 --- a/mc1122/build.gradle +++ b/mc1122/build.gradle @@ -90,7 +90,7 @@ def viaLibs = [ "com.viaversion:viaversion:${project.viaversion_version}", "com.viaversion:viabackwards:${project.viabackwards_version}", "com.viaversion:viarewind-core:${project.viarewind_version}", - "org.yaml:snakeyaml:1.29", + "org.yaml:snakeyaml:${project.snake_yml_version}", "com.github.FlorianMichael:ViaLoadingBase:${project.vialoadingbase_version}" ] diff --git a/mc1122/src/main/java/de/florianmichael/viaforge/GuiProtocolSelector.java b/mc1122/src/main/java/de/florianmichael/viaforge/GuiProtocolSelector.java index 43d2767..d64499b 100644 --- a/mc1122/src/main/java/de/florianmichael/viaforge/GuiProtocolSelector.java +++ b/mc1122/src/main/java/de/florianmichael/viaforge/GuiProtocolSelector.java @@ -3,7 +3,7 @@ package de.florianmichael.viaforge; import com.mojang.realmsclient.gui.ChatFormatting; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.api.version.InternalProtocolList; +import de.florianmichael.vialoadingbase.platform.InternalProtocolList; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -86,7 +86,7 @@ public class GuiProtocolSelector extends GuiScreen { protected void drawSlot(int i, int i1, int i2, int i3, int i4, int i5, float v) { final ProtocolVersion version = InternalProtocolList.getProtocols().get(i); - drawCenteredString(mc.fontRenderer,(ViaLoadingBase.getTargetVersion().getVersion() == version.getVersion() ? ChatFormatting.GREEN.toString() : ChatFormatting.DARK_RED.toString()) + version.getName(), width / 2, i2, -1); + drawCenteredString(mc.fontRenderer,(ViaLoadingBase.getClassWrapper().getTargetVersion().getVersion() == version.getVersion() ? ChatFormatting.GREEN.toString() : ChatFormatting.DARK_RED.toString()) + version.getName(), width / 2, i2, -1); } } } diff --git a/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java b/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java index 37eefab..1e766cd 100644 --- a/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java +++ b/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java @@ -11,13 +11,12 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ViaForge { @Mod.EventHandler - public void init(FMLPreInitializationEvent event) throws Exception { + public void init(FMLPreInitializationEvent event) { ViaLoadingBase.ViaLoadingBaseBuilder. create(). runDirectory(Minecraft.getMinecraft().gameDir). nativeVersion(RealmsSharedConstants.NETWORK_PROTOCOL_VERSION). - singlePlayerProvider(() -> Minecraft.getMinecraft().isSingleplayer()). - eventLoop(new DefaultEventLoop(ViaLoadingBase.EXECUTOR_SERVICE)). + forceNativeVersionCondition(() -> Minecraft.getMinecraft().isSingleplayer()). build(); } } diff --git a/mc1122/src/main/java/de/florianmichael/viaforge/mixin/impl/MixinNetworkManagerSub5.java b/mc1122/src/main/java/de/florianmichael/viaforge/mixin/impl/MixinNetworkManagerSub5.java index 904a7fc..86adb9f 100644 --- a/mc1122/src/main/java/de/florianmichael/viaforge/mixin/impl/MixinNetworkManagerSub5.java +++ b/mc1122/src/main/java/de/florianmichael/viaforge/mixin/impl/MixinNetworkManagerSub5.java @@ -4,9 +4,9 @@ import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.connection.UserConnectionImpl; import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.netty.CustomViaDecodeHandler; -import de.florianmichael.vialoadingbase.netty.CustomViaEncodeHandler; import de.florianmichael.vialoadingbase.netty.NettyConstants; +import de.florianmichael.vialoadingbase.netty.VLBViaDecodeHandler; +import de.florianmichael.vialoadingbase.netty.VLBViaEncodeHandler; import io.netty.channel.Channel; import io.netty.channel.socket.SocketChannel; import net.minecraft.realms.RealmsSharedConstants; @@ -20,14 +20,14 @@ public class MixinNetworkManagerSub5 { @Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false) private void onInitChannel(Channel channel, CallbackInfo ci) { - if (channel instanceof SocketChannel && ViaLoadingBase.getTargetVersion().getVersion() != RealmsSharedConstants.NETWORK_PROTOCOL_VERSION) { + if (channel instanceof SocketChannel && ViaLoadingBase.getClassWrapper().getTargetVersion().getVersion() != RealmsSharedConstants.NETWORK_PROTOCOL_VERSION) { UserConnection user = new UserConnectionImpl(channel, true); new ProtocolPipelineImpl(user); channel.pipeline() - .addBefore("encoder", NettyConstants.HANDLER_ENCODER_NAME, new CustomViaEncodeHandler(user)) - .addBefore("decoder", NettyConstants.HANDLER_DECODER_NAME, new CustomViaDecodeHandler(user)); + .addBefore("encoder", NettyConstants.HANDLER_ENCODER_NAME, new VLBViaEncodeHandler(user)) + .addBefore("decoder", NettyConstants.HANDLER_DECODER_NAME, new VLBViaDecodeHandler(user)); } } }