Skip to content

Commit

Permalink
Bump version to 2.8.1 & fix issues with ProtocolLib on 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanKeir committed Aug 4, 2024
1 parent 554d6c3 commit b316629
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ plugins {
// --
// Variables
// --
version = '2.8.0'
version = '2.8.1'
group = 'net.tcpshield.tcpshield'
archivesBaseName = 'TCPShield'

Expand Down Expand Up @@ -91,7 +91,9 @@ repositories {

dependencies {
// Bukkit
compileOnly group: 'com.comphenix.protocol', name: 'ProtocolLib', version: '5.1.0'
// compileOnly group: 'com.comphenix.protocol', name: 'ProtocolLib', version: '5.3.0-SNAPSHOT'

compileOnly(files("libs/ProtocolLib.jar")) // Temporary, currently using build #726 from the CI server since the maven repository is out of date.

// Paper - 1.19.4 so we can bump from JDK 8 -> JDK 17, using 1.20.x as a dependency would require bumping from JDK 8 -> JDK 21
compileOnly group: 'io.papermc.paper', name: 'paper-api', version: '1.19.4-R0.1-SNAPSHOT'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.tcpshield.tcpshield.bukkit.protocollib.handler;

import com.comphenix.protocol.injector.temporary.MinimalInjector;
import com.comphenix.protocol.injector.netty.Injector;
import com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory;
import net.tcpshield.tcpshield.provider.PlayerProvider;
import net.tcpshield.tcpshield.util.ReflectionUtil;
Expand Down Expand Up @@ -71,13 +71,12 @@ public void setIP(InetSocketAddress ip) throws PlayerManipulationException {
try {
this.ip = ip.getAddress().getHostAddress();

MinimalInjector ignored = TemporaryPlayerFactory.getInjectorFromPlayer(player);
Object injector = ReflectionUtil.getObjectInPrivateField(ignored, "injector");
Object networkManager = ReflectionUtil.getObjectInPrivateField(injector, "networkManager");
Injector ignored = TemporaryPlayerFactory.getInjectorFromPlayer(player);
Object networkManager = ReflectionUtil.getObjectInPrivateField(ignored, "networkManager");

ReflectionUtil.setFinalField(networkManager, ReflectionUtil.searchFieldByClass(networkManager.getClass(), SocketAddress.class), ip);

Object channel = ReflectionUtil.getObjectInPrivateField(injector, "wrappedChannel");
Object channel = ReflectionUtil.getObjectInPrivateField(ignored, "channel");
ReflectionUtil.setFinalField(channel, ReflectionUtil.getDeclaredField(abstractChannelClass, "remoteAddress"), ip);
} catch (Exception e) {
throw new PlayerManipulationException(e);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/bungee.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: TCPShield
version: 2.8.0
version: 2.8.1
main: net.tcpshield.tcpshield.bungee.TCPShieldBungee
author: https://tcpshield.com
softdepends:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: TCPShield
version: 2.8.0
version: 2.8.1
main: net.tcpshield.tcpshield.bukkit.TCPShieldBukkit
softdepend:
- ProtocolLib
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/velocity-plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "tcpshield",
"name": "TCPShield",
"version": "2.8.0",
"version": "2.8.1",
"description": "TCPShield IP parsing capabilities for Velocity",
"authors": [
"TCPShield"
Expand Down

0 comments on commit b316629

Please sign in to comment.