Skip to content

Commit 133cef0

Browse files
committed
2.7.0 - Update to support Velocity's new class name
1 parent bb7511d commit 133cef0

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ plugins {
2626
// --
2727
// Variables
2828
// --
29-
version = '2.6.1'
29+
version = '2.7.0'
3030
group = 'net.tcpshield.tcpshield'
3131
archivesBaseName = 'TCPShield'
3232

@@ -95,7 +95,7 @@ repositories {
9595
dependencies {
9696
// Bukkit
9797
compileOnly group: 'org.spigotmc', name: 'spigot-api', version: '1.11-R0.1-SNAPSHOT'
98-
compileOnly group: 'com.comphenix.protocol', name: 'ProtocolLib', version: '5.0.0-SNAPSHOT'
98+
compileOnly group: 'com.comphenix.protocol', name: 'ProtocolLib', version: '5.1.0'
9999

100100
// Paper
101101
compileOnly group: 'com.destroystokyo.paper', name: 'paper-api', version: '1.15.2-R0.1-SNAPSHOT'

src/main/java/net/tcpshield/tcpshield/TCPShieldPacketHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.tcpshield.tcpshield.util.validation.timestamp.impl.HTPDateTimestampValidator;
1515

1616
import java.io.IOException;
17+
import java.lang.reflect.InvocationTargetException;
1718
import java.net.InetAddress;
1819
import java.net.InetSocketAddress;
1920
import java.net.UnknownHostException;

src/main/java/net/tcpshield/tcpshield/velocity/handler/VelocityPacket.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ public class VelocityPacket implements PacketProvider {
3131
Class<?> inboundConnection = Class.forName("com.velocitypowered.proxy.connection.client.InitialInboundConnection");
3232

3333
HANDSHAKE_FIELD = ReflectionUtil.getPrivateField(inboundConnection, "handshake");
34-
HOSTNAME_FIELD = ReflectionUtil.getPrivateField(Class.forName("com.velocitypowered.proxy.protocol.packet.Handshake"), "serverAddress");
34+
35+
Field hostnameField;
36+
try {
37+
hostnameField = ReflectionUtil.getPrivateField(Class.forName("com.velocitypowered.proxy.protocol.packet.HandshakePacket"), "serverAddress");
38+
} catch (Exception e) {
39+
hostnameField = ReflectionUtil.getPrivateField(Class.forName("com.velocitypowered.proxy.protocol.packet.Handshake"), "serverAddress");
40+
}
41+
HOSTNAME_FIELD = hostnameField;
42+
3543
CLEANED_ADDRESS_FIELD = ReflectionUtil.getPrivateField(inboundConnection, "cleanedAddress");
3644
} catch (Exception e) {
3745
throw new InitializationException(new ReflectionException(e));

src/main/resources/bungee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: TCPShield
2-
version: 2.6.1
2+
version: 2.7.0
33
main: net.tcpshield.tcpshield.bungee.TCPShieldBungee
44
author: https://tcpshield.com
55
softdepends:

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: TCPShield
2-
version: 2.6.1
2+
version: 2.7.0
33
main: net.tcpshield.tcpshield.bukkit.TCPShieldBukkit
44
softdepend:
55
- ProtocolLib
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
{"id":"tcpshield","name":"TCPShield","version":"2.6.1","description":"TCPShield IP parsing capabilities for Velocity","authors":["TCPShield"],"dependencies":[{"id":"floodgate","optional":true}],"main":"net.tcpshield.tcpshield.velocity.TCPShieldVelocity"}
1+
{
2+
"id": "tcpshield",
3+
"name": "TCPShield",
4+
"version": "2.7.0",
5+
"description": "TCPShield IP parsing capabilities for Velocity",
6+
"authors": [
7+
"TCPShield"
8+
],
9+
"dependencies": [
10+
{
11+
"id": "floodgate",
12+
"optional": true
13+
}
14+
],
15+
"main": "net.tcpshield.tcpshield.velocity.TCPShieldVelocity"
16+
}

0 commit comments

Comments
 (0)