From 4628c587d7b8b95fe3bf94140a98bd110a135231 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Sat, 27 Jan 2024 16:02:43 +0800 Subject: [PATCH] Update to latest Velocity --- build.gradle | 8 ++++---- src/main/java/io/izzel/arclight/lightcity/Lightcity.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 66a3a51..4f53ff1 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'io.izzel.arclight' -version = '1.0.0' +version = '1.1.0' repositories { mavenCentral() @@ -28,9 +28,9 @@ repositories { } dependencies { - compileOnly "com.velocitypowered:velocity-api:3.2.0-SNAPSHOT" - compileOnly "com.velocitypowered:velocity:3.3.0-SNAPSHOT:306@jar" - annotationProcessor "com.velocitypowered:velocity-api:3.2.0-SNAPSHOT" + compileOnly "com.velocitypowered:velocity-api:3.3.0-SNAPSHOT" + compileOnly "com.velocitypowered:velocity:3.3.0-SNAPSHOT:343@jar" + annotationProcessor "com.velocitypowered:velocity-api:3.3.0-SNAPSHOT" } java.toolchain.languageVersion = JavaLanguageVersion.of(17) diff --git a/src/main/java/io/izzel/arclight/lightcity/Lightcity.java b/src/main/java/io/izzel/arclight/lightcity/Lightcity.java index 2d8191b..cf388b2 100644 --- a/src/main/java/io/izzel/arclight/lightcity/Lightcity.java +++ b/src/main/java/io/izzel/arclight/lightcity/Lightcity.java @@ -10,7 +10,7 @@ import com.velocitypowered.proxy.config.VelocityConfiguration; import com.velocitypowered.proxy.connection.client.InitialInboundConnection; import com.velocitypowered.proxy.connection.client.LoginInboundConnection; -import com.velocitypowered.proxy.protocol.packet.Handshake; +import com.velocitypowered.proxy.protocol.packet.HandshakePacket; import org.slf4j.Logger; import java.util.Locale; @@ -46,7 +46,7 @@ public void onConnect(ConnectionHandshakeEvent event) throws Exception { var initConn = (InitialInboundConnection) delegateField.get(connection); var field = InitialInboundConnection.class.getDeclaredField("handshake"); field.setAccessible(true); - var handshake = (Handshake) field.get(initConn); + var handshake = (HandshakePacket) field.get(initConn); var host = handshake.getServerAddress(); if (host.contains("\0")) { var split = host.split("\0", 2);