From 9748b586f5332984d8b03d9d615a315c53f4b1d3 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Wed, 1 Jan 2025 23:59:04 +0100 Subject: [PATCH] Updated Via* API usage --- build.gradle | 12 ++++++------ gradle.properties | 2 +- .../protocoltranslator/ProtocolTranslator.java | 10 +++++----- .../protocoltranslator/impl/ViaProxyVLLoader.java | 2 +- .../protocoltranslator/impl/ViaProxyVLPipeline.java | 2 +- .../protocoltranslator/impl/ViaProxyViaCodec.java | 2 +- .../impl/ViaProxyViaLegacyPlatformImpl.java | 2 +- .../impl/ViaProxyViaVersionPlatformImpl.java | 2 +- .../providers/ViaProxyNettyPipelineProvider.java | 2 +- .../client2proxy/Client2ProxyChannelInitializer.java | 2 +- .../proxy2server/Proxy2ServerChannelInitializer.java | 2 +- .../proxy/session/BedrockProxyConnection.java | 4 ++-- .../net/raphimc/viaproxy/ui/impl/GeneralTab.java | 2 +- .../viaproxy/util/ProtocolVersionDetector.java | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index 3240ee3..1c87af0 100644 --- a/build.gradle +++ b/build.gradle @@ -61,16 +61,16 @@ repositories { } dependencies { - include "com.viaversion:viaversion-common:5.2.1-SNAPSHOT" - include "com.viaversion:viabackwards-common:5.2.1-SNAPSHOT" - include "com.viaversion:viarewind-common:4.0.5-SNAPSHOT" - include "net.raphimc:ViaLegacy:3.0.7-SNAPSHOT" - include "net.raphimc:viaaprilfools-common:3.0.5-SNAPSHOT" + include "com.viaversion:viaversion-common:5.2.1" + include "com.viaversion:viabackwards-common:5.2.1" + include "com.viaversion:viarewind-common:4.0.5" + include "net.raphimc:ViaLegacy:3.0.7" + include "com.viaversion:viaaprilfools-common:4.0.0" include("net.raphimc:ViaBedrock:0.0.14-SNAPSHOT") { exclude group: "io.netty" exclude group: "io.jsonwebtoken" } - include("net.raphimc:ViaLoader:3.0.5-SNAPSHOT") { + include("com.viaversion:vialoader:4.0.0") { exclude group: "org.slf4j", module: "slf4j-api" } diff --git a/gradle.properties b/gradle.properties index 800bb21..c596dd8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ org.gradle.jvmargs=-Xmx2G maven_group=net.raphimc maven_name=ViaProxy -maven_version=3.3.8-SNAPSHOT +maven_version=3.4.0-SNAPSHOT diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/ProtocolTranslator.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/ProtocolTranslator.java index c1ed426..81ea786 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/ProtocolTranslator.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/ProtocolTranslator.java @@ -17,14 +17,14 @@ */ package net.raphimc.viaproxy.protocoltranslator; +import com.viaversion.vialoader.ViaLoader; +import com.viaversion.vialoader.impl.platform.ViaAprilFoolsPlatformImpl; +import com.viaversion.vialoader.impl.platform.ViaBackwardsPlatformImpl; +import com.viaversion.vialoader.impl.platform.ViaBedrockPlatformImpl; +import com.viaversion.vialoader.impl.platform.ViaRewindPlatformImpl; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.protocol.version.VersionType; import com.viaversion.viaversion.protocols.v1_20_3to1_20_5.Protocol1_20_3To1_20_5; -import net.raphimc.vialoader.ViaLoader; -import net.raphimc.vialoader.impl.platform.ViaAprilFoolsPlatformImpl; -import net.raphimc.vialoader.impl.platform.ViaBackwardsPlatformImpl; -import net.raphimc.vialoader.impl.platform.ViaBedrockPlatformImpl; -import net.raphimc.vialoader.impl.platform.ViaRewindPlatformImpl; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.plugins.events.ProtocolTranslatorInitEvent; import net.raphimc.viaproxy.protocoltranslator.impl.ViaProxyVLLoader; diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLLoader.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLLoader.java index f2a109e..265cb43 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLLoader.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLLoader.java @@ -18,6 +18,7 @@ package net.raphimc.viaproxy.protocoltranslator.impl; import com.viaversion.viabackwards.protocol.v1_20_5to1_20_3.provider.TransferProvider; +import com.viaversion.vialoader.impl.viaversion.VLLoader; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.protocol.version.VersionProvider; import com.viaversion.viaversion.protocols.v1_8to1_9.provider.CompressionProvider; @@ -28,7 +29,6 @@ import net.raphimc.vialegacy.protocol.classic.c0_28_30toa1_0_15.provider.Classic import net.raphimc.vialegacy.protocol.release.r1_2_4_5tor1_3_1_2.provider.OldAuthProvider; import net.raphimc.vialegacy.protocol.release.r1_6_4tor1_7_2_5.provider.EncryptionProvider; import net.raphimc.vialegacy.protocol.release.r1_7_6_10tor1_8.provider.GameProfileFetcher; -import net.raphimc.vialoader.impl.viaversion.VLLoader; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.plugins.events.ViaLoadingEvent; import net.raphimc.viaproxy.protocoltranslator.providers.*; diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLPipeline.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLPipeline.java index 1af8964..ac87f01 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLPipeline.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyVLPipeline.java @@ -17,10 +17,10 @@ */ package net.raphimc.viaproxy.protocoltranslator.impl; +import com.viaversion.vialoader.netty.VLPipeline; import com.viaversion.viaversion.api.connection.UserConnection; import io.netty.channel.ChannelHandler; import net.raphimc.netminecraft.constants.MCPipeline; -import net.raphimc.vialoader.netty.VLPipeline; public class ViaProxyVLPipeline extends VLPipeline { diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaCodec.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaCodec.java index b3892ce..a9a9e53 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaCodec.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaCodec.java @@ -17,9 +17,9 @@ */ package net.raphimc.viaproxy.protocoltranslator.impl; +import com.viaversion.vialoader.netty.ViaCodec; import com.viaversion.viaversion.api.connection.UserConnection; import io.netty.channel.ChannelHandlerContext; -import net.raphimc.vialoader.netty.ViaCodec; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.util.logging.Logger; diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaLegacyPlatformImpl.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaLegacyPlatformImpl.java index 7e33f25..3914d07 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaLegacyPlatformImpl.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaLegacyPlatformImpl.java @@ -17,7 +17,7 @@ */ package net.raphimc.viaproxy.protocoltranslator.impl; -import net.raphimc.vialoader.impl.platform.ViaLegacyPlatformImpl; +import com.viaversion.vialoader.impl.platform.ViaLegacyPlatformImpl; import net.raphimc.viaproxy.ViaProxy; public class ViaProxyViaLegacyPlatformImpl extends ViaLegacyPlatformImpl { diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaVersionPlatformImpl.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaVersionPlatformImpl.java index dc0f947..c9ca233 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaVersionPlatformImpl.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/impl/ViaProxyViaVersionPlatformImpl.java @@ -17,9 +17,9 @@ */ package net.raphimc.viaproxy.protocoltranslator.impl; +import com.viaversion.vialoader.impl.platform.ViaVersionPlatformImpl; import com.viaversion.viaversion.libs.gson.JsonArray; import com.viaversion.viaversion.libs.gson.JsonObject; -import net.raphimc.vialoader.impl.platform.ViaVersionPlatformImpl; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.cli.ConsoleFormatter; import net.raphimc.viaproxy.plugins.ViaProxyPlugin; diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/providers/ViaProxyNettyPipelineProvider.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/providers/ViaProxyNettyPipelineProvider.java index c61b438..ab2309c 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/providers/ViaProxyNettyPipelineProvider.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/providers/ViaProxyNettyPipelineProvider.java @@ -17,6 +17,7 @@ */ package net.raphimc.viaproxy.protocoltranslator.providers; +import com.viaversion.vialoader.netty.VLPipeline; import com.viaversion.viaversion.api.connection.UserConnection; import io.netty.channel.Channel; import net.raphimc.netminecraft.constants.MCPipeline; @@ -24,7 +25,6 @@ import net.raphimc.viabedrock.api.io.compression.ProtocolCompression; import net.raphimc.viabedrock.netty.AesEncryptionCodec; import net.raphimc.viabedrock.netty.CompressionCodec; import net.raphimc.viabedrock.protocol.provider.NettyPipelineProvider; -import net.raphimc.vialoader.netty.VLPipeline; import net.raphimc.viaproxy.proxy.session.ProxyConnection; import javax.crypto.SecretKey; diff --git a/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/Client2ProxyChannelInitializer.java b/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/Client2ProxyChannelInitializer.java index b817299..adc7491 100644 --- a/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/Client2ProxyChannelInitializer.java +++ b/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/Client2ProxyChannelInitializer.java @@ -17,6 +17,7 @@ */ package net.raphimc.viaproxy.proxy.client2proxy; +import com.viaversion.vialoader.netty.VLPipeline; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.connection.UserConnectionImpl; import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; @@ -27,7 +28,6 @@ import net.raphimc.netminecraft.constants.MCPipeline; import net.raphimc.netminecraft.netty.codec.NoReadFlowControlHandler; import net.raphimc.netminecraft.netty.connection.MinecraftChannelInitializer; import net.raphimc.netminecraft.packet.registry.DefaultPacketRegistry; -import net.raphimc.vialoader.netty.VLPipeline; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.plugins.events.Client2ProxyChannelInitializeEvent; import net.raphimc.viaproxy.plugins.events.types.ITyped; 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 466de57..f25c039 100644 --- a/src/main/java/net/raphimc/viaproxy/proxy/proxy2server/Proxy2ServerChannelInitializer.java +++ b/src/main/java/net/raphimc/viaproxy/proxy/proxy2server/Proxy2ServerChannelInitializer.java @@ -17,6 +17,7 @@ */ package net.raphimc.viaproxy.proxy.proxy2server; +import com.viaversion.vialoader.netty.VLPipeline; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.connection.UserConnectionImpl; import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; @@ -32,7 +33,6 @@ import net.raphimc.netminecraft.netty.codec.NoReadFlowControlHandler; import net.raphimc.netminecraft.netty.connection.MinecraftChannelInitializer; import net.raphimc.netminecraft.packet.registry.DefaultPacketRegistry; import net.raphimc.viabedrock.api.BedrockProtocolVersion; -import net.raphimc.vialoader.netty.VLPipeline; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.plugins.events.Proxy2ServerChannelInitializeEvent; import net.raphimc.viaproxy.plugins.events.types.ITyped; diff --git a/src/main/java/net/raphimc/viaproxy/proxy/session/BedrockProxyConnection.java b/src/main/java/net/raphimc/viaproxy/proxy/session/BedrockProxyConnection.java index 77842c8..1728d83 100644 --- a/src/main/java/net/raphimc/viaproxy/proxy/session/BedrockProxyConnection.java +++ b/src/main/java/net/raphimc/viaproxy/proxy/session/BedrockProxyConnection.java @@ -17,6 +17,8 @@ */ package net.raphimc.viaproxy.proxy.session; +import com.viaversion.vialoader.netty.VLPipeline; +import com.viaversion.vialoader.netty.viabedrock.PingEncapsulationCodec; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; @@ -29,8 +31,6 @@ import net.raphimc.netminecraft.constants.ConnectionState; import net.raphimc.netminecraft.constants.MCPipeline; import net.raphimc.netminecraft.util.ChannelType; import net.raphimc.viabedrock.protocol.data.ProtocolConstants; -import net.raphimc.vialoader.netty.VLPipeline; -import net.raphimc.vialoader.netty.viabedrock.PingEncapsulationCodec; import net.raphimc.viaproxy.ViaProxy; import org.cloudburstmc.netty.channel.raknet.RakChannelFactory; import org.cloudburstmc.netty.channel.raknet.config.RakChannelOption; diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java index d5ad1f5..e9c2f34 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java @@ -17,13 +17,13 @@ */ package net.raphimc.viaproxy.ui.impl; +import com.viaversion.vialoader.util.ProtocolVersionList; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.lenni0451.commons.swing.GBC; import net.lenni0451.lambdaevents.EventHandler; import net.raphimc.viabedrock.api.BedrockProtocolVersion; import net.raphimc.vialegacy.api.LegacyProtocolVersion; -import net.raphimc.vialoader.util.ProtocolVersionList; import net.raphimc.viaproxy.ViaProxy; import net.raphimc.viaproxy.protocoltranslator.viaproxy.ViaProxyConfig; import net.raphimc.viaproxy.saves.impl.accounts.ClassicAccount; diff --git a/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionDetector.java b/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionDetector.java index d3ce488..b77aa48 100644 --- a/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionDetector.java +++ b/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionDetector.java @@ -17,11 +17,11 @@ */ package net.raphimc.viaproxy.util; +import com.viaversion.vialoader.util.ProtocolVersionList; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.lenni0451.mcping.MCPing; import net.lenni0451.mcping.pings.sockets.impl.factories.SocketChannelSocketFactory; import net.lenni0451.mcping.responses.MCPingResponse; -import net.raphimc.vialoader.util.ProtocolVersionList; import java.net.SocketAddress;