TCPShield / RealIP

The Spigot, Bungee and Velocity plugin that parses client IP addresses passed from the TCPShield network.
https://tcpshield.com
MIT License
151 stars 55 forks source link

Error enabling latest TCPShield 2.8.0 plugin with Spigot 1.20.6 #107

Open Vlurk opened 5 months ago

Vlurk commented 5 months ago

Upgrade a working environment with older release and Spigot 1.20.4 to:

TCPShield=2.8.0 Spigot=1.20.6 ProtocolLib=5.3.0 Java=jdk-21.0.3+9

Server starts just fine, but the plugin doesn't log the IP of the clients, just the TCPShield proxies. In the server log, I get the following error:

[23:42:14] [Server thread/ERROR]: Error occurred while enabling TCPShield v2.8.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'java.lang.String org.bukkit.Server.getMinecraftVersion()'
        at net.tcpshield.tcpshield.bukkit.TCPShieldBukkit.onEnable(TCPShieldBukkit.java:42) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:491) ~[spigot-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R4.CraftServer.enablePlugin(CraftServer.java:541) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at org.bukkit.craftbukkit.v1_20_R4.CraftServer.enablePlugins(CraftServer.java:455) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:634) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:419) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:265) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1010) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:311) ~[spigot-1.20.6-R0.1-SNAPSHOT.jar:4149-Spigot-e2c1eee-4e7d749]
        at java.base/java.lang.Thread.run(Unknown Source) [?:?]

Just a quick check, and getMinecraftVersion is not a valid method with Spigot API: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Server.html

NoSuchMethodError would be pretty much expected in these circumstances. Looking at GitHub, I see that a new routine was added with commit 554d6c300e531e5cfc386bf354f19b3d6835c749, creating the error.

As a last resort, I tried to downgrade to the previous release, 2.7.0, I can confirm this error does not exist and everything work as expected: I get the client IPs in the logs.

DylanKeir commented 5 months ago

Yes, getMinecraftVersion() is a Paper-added method. Do you mind if I ask why you're using Spigot instead of the much improved fork? (https://github.com/papermc/paper)

Vlurk commented 5 months ago

I don't mind at all.

Odds are that most servers could be switched to Paper without any negative impacts. But that will need to be verified on a server by server basis.

Realistically, I host only one server that I would be concerned about. +4 years old, many thousands of hours, automations like you wouldn't believe. And Paper has been known to implement more fixes and optimizations, notably patch some duping techniques. I know some stuff can be restored through plugin though: https://forums.papermc.io/threads/gravitycontrol-sand-dupe-enabler-for-paper-servers.12/

I am afraid that in such instances, Paper wouldn't be a drop-in replacement.

But honestly, I am just a server operator, and not a good player myself. I am amongst the players that couldn't tell the difference, and for which Paper just looks superior.

If you tell me the project is going to drop supports for Spigot/Bukkit and become a Paper-only plugin, I could realistically contact the owner of that server, and convince them to give Paper a shot. If I assist her in the migration process. I would probably have better feedback at that point.