Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.20 #2420

Merged
merged 10 commits into from
Jun 10, 2023
Merged

Update to 1.20 #2420

merged 10 commits into from
Jun 10, 2023

Conversation

lukalt
Copy link
Contributor

@lukalt lukalt commented Jun 7, 2023

Update ProtocolLib to 1.20.

These changes have been tested on Spigot 1.20, Paper 1.19.4, and Spigot 1.8.8.

Basically all required converters and structures have been tested on 1.20 using external unit tests (see https://github.com/lukalt/PacketWrapper/tree/master/src/test/java/com/comphenix/packetwrapper).

@LOOHP
Copy link
Contributor

LOOHP commented Jun 7, 2023

I seem to be getting this error using this PR during server start on SpigotMC 1.20

[23:25:29] [Server thread/ERROR]: net/bytebuddy/dynamic/scaffold/subclass/ConstructorStrategy initializing ProtocolLib v5.2.0-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: net/bytebuddy/dynamic/scaffold/subclass/ConstructorStrategy
	at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:125) ~[?:?]
	at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:435) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy
	at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
	... 6 more

@lukalt
Copy link
Contributor Author

lukalt commented Jun 7, 2023

@LOOHP This happened to me as well. You need to use the build/libs/ProtocolLib.jar rather than build/libs/ProtocolLib-5.2.0-SNAPSHOT.jar. The latter one does not include the shadowed dependencies.

@LOOHP
Copy link
Contributor

LOOHP commented Jun 8, 2023

Got it. Now it's working most of the time. However, weirdly sometimes when I boot up the server, it might fail with this error.

[02:38:53] [Server thread/ERROR]: Cannot invoke "com.comphenix.protocol.ProtocolConfig.isChatWarnings()" because the return value of "com.comphenix.protocol.ProtocolLibrary.getConfig()" is null initializing ProtocolLib v5.2.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolConfig.isChatWarnings()" because the return value of "com.comphenix.protocol.ProtocolLibrary.getConfig()" is null
	at com.comphenix.protocol.error.DetailedErrorReporter.reportDetailed(DetailedErrorReporter.java:394) ~[?:?]
	at com.comphenix.protocol.error.DelegatedErrorReporter.reportDetailed(DelegatedErrorReporter.java:63) ~[?:?]
	at com.comphenix.protocol.error.DelegatedErrorReporter.reportDetailed(DelegatedErrorReporter.java:87) ~[?:?]
	at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:186) ~[?:?]
	at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:435) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3766-Spigot-81b9def-a345bb9]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

@lukalt
Copy link
Contributor Author

lukalt commented Jun 8, 2023

@LOOHP This was not caused by my changes but @dmulloy2 fixed it in the last commit

build.gradle Outdated Show resolved Hide resolved
src/test/java/com/comphenix/protocol/PacketTypeTest.java Outdated Show resolved Hide resolved
@lukalt
Copy link
Contributor Author

lukalt commented Jun 8, 2023

@dmulloy2 thx, I implemented your suggestions

@metabrixkt
Copy link

Still randomly fails to load with the following error:

[17:23:39 INFO]: [ProtocolLib] Loading server plugin ProtocolLib v5.1.0-SNAPSHOT
[17:23:39 WARN]: [ProtocolLib] Version (MC: 1.20.0) has not yet been tested! Proceed with caution.
[17:23:40 ERROR]: [ProtocolLib] Error initializing plugin 'ProtocolLib.jar' in folder 'plugins' (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolConfig.isChatWarnings()" because the return value of "com.comphenix.protocol.ProtocolLibrary.getConfig()" is null
        at com.comphenix.protocol.error.DetailedErrorReporter.reportDetailed(DetailedErrorReporter.java:394) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.error.DelegatedErrorReporter.reportDetailed(DelegatedErrorReporter.java:63) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.error.DelegatedErrorReporter.reportDetailed(DelegatedErrorReporter.java:87) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:186) ~[ProtocolLib.jar:?]
        at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:40) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:451) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:305) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1119) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:324) ~[satellite-1.20.jar:git-Satellite-"c69f4fb"]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Running a private Purpur fork that does not introduce any changes that could possibly affect ProtocolLib

dmulloy2
dmulloy2 previously approved these changes Jun 10, 2023
@dmulloy2 dmulloy2 enabled auto-merge (squash) June 10, 2023 23:53
@dmulloy2 dmulloy2 merged commit 1537c7e into dmulloy2:master Jun 10, 2023
3 checks passed
@CrazyCraft88
Copy link

Hi Guys ehm your plugin dosnt Work:

[00:01:07] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v5.1.0

[00:01:07] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.20.2) has not yet been tested! Proceed with caution.

[00:01:08] [Server thread/ERROR]: [ProtocolLib] INTERNAL ERROR: Cannot load ProtocolLib.
If this problem hasn't already been reported, please open a ticket
at https://github.com/dmulloy2/ProtocolLib/issues with the following data:
Stack Trace:
java.lang.IllegalArgumentException: Unable to find a field that matches {modifiers=[required: 10000, banned: 1000], type={ type input instanceof interface java.util.Map }}
at com.comphenix.protocol.reflect.FuzzyReflection.getField(FuzzyReflection.java:352)
at com.comphenix.protocol.injector.packet.PacketRegistry.createNewRegister(PacketRegistry.java:188)
at com.comphenix.protocol.injector.packet.PacketRegistry.initialize(PacketRegistry.java:292)
at com.comphenix.protocol.injector.packet.PacketRegistry.getClientPacketTypes(PacketRegistry.java:327)
at com.comphenix.protocol.injector.PacketFilterManager.<init>(PacketFilterManager.java:120)
at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:121)
at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:183)
at org.bukkit.craftbukkit.v1_20_R2.CraftServer.loadPlugins(CraftServer.java:442)
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:954)
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:298)
at java.base/java.lang.Thread.run(Thread.java:840)
Dump:
Parameters:
[NULL]
Sender:
com.comphenix.protocol.ProtocolLib@358a6b2d[
statistics=<null>
packetTask=<null>
tickCounter=0
configExpectedMod=-1
updater=com.comphenix.protocol.updater.SpigotUpdater@686122c9
redirectHandler=<null>
scheduler=com.comphenix.protocol.scheduler.DefaultScheduler@5f985ce6
commandProtocol=<null>
commandPacket=<null>
commandFilter=<null>
packetLogging=<null>
skipDisable=false
isEnabled=false
loader=org.bukkit.plugin.java.JavaPluginLoader@c44e2e6
server=CraftServer{serverName=CraftBukkit,serverVersion=3949-Spigot-2888990-e54f39a,minecraftVersion=1.20.2}
file=plugins/ProtocolLib.jar
description=org.bukkit.plugin.PluginDescriptionFile@b6723bd
dataFolder=plugins/ProtocolLib
classLoader=org.bukkit.plugin.java.PluginClassLoader@46306767
naggable=true
newConfig=YamlConfiguration[path='', root='YamlConfiguration']
configFile=plugins/ProtocolLib/config.yml
logger=org.bukkit.plugin.PluginLogger@3dfdb2af
]
Version:
ProtocolLib v5.1.0
Java Version:
17.0.9
Server:
3949-Spigot-2888990-e54f39a (MC: 1.20.2)

Is there another update coming, right?

Weill various plugins don't work :S

Please answer me thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants