From 3cbdc736575f9528aa485015d2c460e5e19293d7 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Fri, 10 Mar 2023 18:20:10 +0100 Subject: [PATCH] Updated Via* --- build.gradle | 4 ++-- .../injection/mixins/MixinProtocolVersion.java | 2 +- .../viaproxy/protocolhack/impl/ViaProxyVPLoader.java | 4 ++-- .../protocolhack/impl/ViaProxyViaDecodeHandler.java | 4 ++-- .../proxy2server/Proxy2ServerChannelInitializer.java | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 82bb68a..ac444bf 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ repositories { dependencies { compileOnly sourceSets.java17compat.output - include "com.viaversion:viaversion:4.6.0-1.19.4-rc1-SNAPSHOT" + include "com.viaversion:viaversion:4.6.0-1.19.4-rc2-SNAPSHOT" include("com.viaversion:viabackwards-common:4.6.0-1.19.4-pre4-SNAPSHOT") { exclude group: "com.viaversion", module: "viaversion" exclude group: "io.netty", module: "netty-all" @@ -68,7 +68,7 @@ dependencies { include "com.viaversion:viarewind-core:2.0.3-SNAPSHOT" include "net.raphimc:ViaLegacy:2.2.8" include "net.raphimc:ViaAprilFools:2.0.6" - include("net.raphimc:ViaProtocolHack:2.1.9") { + include("net.raphimc:ViaProtocolHack:2.2.0") { exclude group: "org.slf4j", module: "slf4j-api" } diff --git a/src/main/java/net/raphimc/viaproxy/injection/mixins/MixinProtocolVersion.java b/src/main/java/net/raphimc/viaproxy/injection/mixins/MixinProtocolVersion.java index 0bcd96f..4307d6d 100644 --- a/src/main/java/net/raphimc/viaproxy/injection/mixins/MixinProtocolVersion.java +++ b/src/main/java/net/raphimc/viaproxy/injection/mixins/MixinProtocolVersion.java @@ -50,7 +50,7 @@ public abstract class MixinProtocolVersion { remaps.put("1.16.4/5", new Pair<>("1.16.4-1.16.5", null)); remaps.put("1.18/1.18.1", new Pair<>("1.18-1.18.1", null)); remaps.put("1.19.1/2", new Pair<>("1.19.1-1.19.2", null)); - remaps.put("1.19.4", new Pair<>("1.19.4-rc1", null)); + remaps.put("1.19.4", new Pair<>("1.19.4-rc2", null)); } @Redirect(method = "", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;register(ILjava/lang/String;)Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;")) diff --git a/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyVPLoader.java b/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyVPLoader.java index 2ae2cd8..f81f6be 100644 --- a/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyVPLoader.java +++ b/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyVPLoader.java @@ -27,12 +27,12 @@ import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.provide import net.raphimc.vialegacy.protocols.release.protocol1_3_1_2to1_2_4_5.providers.OldAuthProvider; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.providers.EncryptionProvider; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.providers.GameProfileFetcher; -import net.raphimc.viaprotocolhack.impl.viaversion.VPLoader; +import net.raphimc.viaprotocolhack.impl.viaversion.VPHLoader; import net.raphimc.viaproxy.plugins.PluginManager; import net.raphimc.viaproxy.plugins.events.ViaLoadingEvent; import net.raphimc.viaproxy.protocolhack.providers.*; -public class ViaProxyVPLoader extends VPLoader { +public class ViaProxyVPLoader extends VPHLoader { @Override public void load() { diff --git a/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyViaDecodeHandler.java b/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyViaDecodeHandler.java index fa5e702..92ede79 100644 --- a/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyViaDecodeHandler.java +++ b/src/main/java/net/raphimc/viaproxy/protocolhack/impl/ViaProxyViaDecodeHandler.java @@ -22,12 +22,12 @@ import com.viaversion.viaversion.exception.CancelCodecException; import com.viaversion.viaversion.util.PipelineUtil; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; -import net.raphimc.viaprotocolhack.netty.ViaDecodeHandler; +import net.raphimc.viaprotocolhack.netty.VPHDecodeHandler; import net.raphimc.viaproxy.util.logging.Logger; import java.util.List; -public class ViaProxyViaDecodeHandler extends ViaDecodeHandler { +public class ViaProxyViaDecodeHandler extends VPHDecodeHandler { public ViaProxyViaDecodeHandler(final UserConnection info) { super(info); diff --git a/src/main/java/net/raphimc/viaproxy/proxy/proxy2server/Proxy2ServerChannelInitializer.java b/src/main/java/net/raphimc/viaproxy/proxy/proxy2server/Proxy2ServerChannelInitializer.java index 2f1a6b7..15f4843 100644 --- a/src/main/java/net/raphimc/viaproxy/proxy/proxy2server/Proxy2ServerChannelInitializer.java +++ b/src/main/java/net/raphimc/viaproxy/proxy/proxy2server/Proxy2ServerChannelInitializer.java @@ -28,8 +28,8 @@ import net.raphimc.netminecraft.packet.registry.PacketRegistryUtil; import net.raphimc.vialegacy.netty.PreNettyDecoder; import net.raphimc.vialegacy.netty.PreNettyEncoder; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.baseprotocols.PreNettyBaseProtocol; -import net.raphimc.viaprotocolhack.netty.ViaEncodeHandler; -import net.raphimc.viaprotocolhack.netty.ViaPipeline; +import net.raphimc.viaprotocolhack.netty.VPHEncodeHandler; +import net.raphimc.viaprotocolhack.netty.VPHPipeline; import net.raphimc.viaprotocolhack.util.VersionEnum; import net.raphimc.viaproxy.plugins.PluginManager; import net.raphimc.viaproxy.plugins.events.Proxy2ServerChannelInitializeEvent; @@ -58,13 +58,13 @@ public class Proxy2ServerChannelInitializer extends MinecraftChannelInitializer super.initChannel(channel); channel.attr(MCPipeline.PACKET_REGISTRY_ATTRIBUTE_KEY).set(PacketRegistryUtil.getHandshakeRegistry(true)); - channel.pipeline().addBefore(MCPipeline.PACKET_CODEC_HANDLER_NAME, ViaPipeline.HANDLER_ENCODER_NAME, new ViaEncodeHandler(user)); - channel.pipeline().addBefore(MCPipeline.PACKET_CODEC_HANDLER_NAME, ViaPipeline.HANDLER_DECODER_NAME, new ViaProxyViaDecodeHandler(user)); + channel.pipeline().addBefore(MCPipeline.PACKET_CODEC_HANDLER_NAME, VPHPipeline.ENCODER_HANDLER_NAME, new VPHEncodeHandler(user)); + channel.pipeline().addBefore(MCPipeline.PACKET_CODEC_HANDLER_NAME, VPHPipeline.DECODER_HANDLER_NAME, new ViaProxyViaDecodeHandler(user)); if (ProxyConnection.fromChannel(channel).getServerVersion().isOlderThanOrEqualTo(VersionEnum.r1_6_4)) { user.getProtocolInfo().getPipeline().add(PreNettyBaseProtocol.INSTANCE); - channel.pipeline().addBefore(MCPipeline.SIZER_HANDLER_NAME, ViaPipeline.HANDLER_PRE_NETTY_ENCODER_NAME, new PreNettyEncoder(user)); - channel.pipeline().addBefore(MCPipeline.SIZER_HANDLER_NAME, ViaPipeline.HANDLER_PRE_NETTY_DECODER_NAME, new PreNettyDecoder(user)); + channel.pipeline().addBefore(MCPipeline.SIZER_HANDLER_NAME, VPHPipeline.PRE_NETTY_ENCODER_HANDLER_NAME, new PreNettyEncoder(user)); + channel.pipeline().addBefore(MCPipeline.SIZER_HANDLER_NAME, VPHPipeline.PRE_NETTY_DECODER_HANDLER_NAME, new PreNettyDecoder(user)); } if (PluginManager.EVENT_MANAGER.call(new Proxy2ServerChannelInitializeEvent(ITyped.Type.POST, channel)).isCancelled()) {