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

GsonComponentSerializer throws NoSuchMethodError for deserializeOrNull #832

Closed
libraryaddict opened this issue Jun 14, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@libraryaddict
Copy link
Contributor

libraryaddict commented Jun 14, 2024

Describe the bug
On 1.15 this works fine, on 1.17 this works fine. However on 1.16.5 there is an error thrown.
Error is at the bottom of the issue.
It's likely to be from #814, though I'm not too sure on the details given that I don't quite understand how the patching works.

Could be that an older version of 1.16.5 was tested, such as 1.16.4 or 1.16.3, etc. Or it could be an issue unique to me.

Software brand
Paper version git-Paper-794

Plugins
Lib's Disguises, PacketEvents

How To Reproduce
Steps to reproduce the behavior:

  1. Call AdventureSerializer.parseComponent("text")
  2. See error

Expected behavior
Malformed text error or component is returned.

Error

[18:51:41] [Server thread/WARN]: java.lang.NoSuchMethodError: io.github.retrooper.packetevents.adventure.serializer.gson.GsonComponentSerializer.deserializeOrNull(Ljava/lang/Object;)Lnet/kyori/adventure/text/Component;
[18:51:41] [Server thread/WARN]: 	at com.github.retrooper.packetevents.util.adventure.AdventureSerializer.parseComponent(AdventureSerializer.java:93)
[18:51:41] [Server thread/WARN]: 	at com.github.retrooper.packetevents.wrapper.PacketWrapper.readComponentAsJSON(PacketWrapper.java:637)
[18:51:41] [Server thread/WARN]: 	at com.github.retrooper.packetevents.wrapper.PacketWrapper.readComponent(PacketWrapper.java:628)
[18:51:41] [Server thread/WARN]: 	at com.github.retrooper.packetevents.wrapper.PacketWrapper.readEntityMetadata(PacketWrapper.java:905)```
@libraryaddict libraryaddict added the bug Something isn't working label Jun 14, 2024
@AbhigyaKrishna
Copy link
Collaborator

What version of PacketEvents are you using? And attach the full stacktrace which the error.

@libraryaddict
Copy link
Contributor Author

What version of PacketEvents are you using? And attach the full stacktrace which the error.

I'm using https://github.com/retrooper/packetevents/actions/runs/9472749262

And sorry, looks like github's blockquote trimmed the first line as I didn't newline it.

The full trace regardless is

[20:10:16] [Server thread/WARN]: java.lang.NoSuchMethodError: io.github.retrooper.packetevents.adventure.serializer.gson.GsonComponentSerializer.deserializeOrNull(Ljava/lang/Object;)Lnet/kyori/adventure/text/Component;
[20:10:16] [Server thread/WARN]: 	at com.github.retrooper.packetevents.util.adventure.AdventureSerializer.parseComponent(AdventureSerializer.java:93)
[20:10:16] [Server thread/WARN]: 	at com.github.retrooper.packetevents.wrapper.PacketWrapper.readComponentAsJSON(PacketWrapper.java:637)
[20:10:16] [Server thread/WARN]: 	at com.github.retrooper.packetevents.wrapper.PacketWrapper.readComponent(PacketWrapper.java:628)
[20:10:16] [Server thread/WARN]: 	at com.github.retrooper.packetevents.wrapper.PacketWrapper.readEntityMetadata(PacketWrapper.java:905)
[20:10:16] [Server thread/WARN]: 	at me.libraryaddict.disguise.utilities.reflection.ReflectionManager.getEntityWatcher(ReflectionManager.java:2372)
[20:10:16] [Server thread/WARN]: 	at me.libraryaddict.disguise.utilities.reflection.ReflectionManager.createNMSValues(ReflectionManager.java:2241)
[20:10:16] [Server thread/WARN]: 	at me.libraryaddict.disguise.utilities.reflection.ReflectionManager.registerValues(ReflectionManager.java:2075)
[20:10:16] [Server thread/WARN]: 	at me.libraryaddict.disguise.LibsDisguises.onEnable(LibsDisguises.java:329)
[20:10:16] [Server thread/WARN]: 	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263)
[20:10:16] [Server thread/WARN]: 	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[20:10:16] [Server thread/WARN]: 	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[20:10:16] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518)
[20:10:16] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432)
[20:10:16] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599)
[20:10:16] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298)
[20:10:16] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074)
[20:10:16] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291)
[20:10:16] [Server thread/WARN]: 	at java.lang.Thread.run(Unknown Source)```

AbhigyaKrishna added a commit to AbhigyaKrishna/packetevents that referenced this issue Jun 21, 2024
….16.5

Fixed NoSuchMethodError in GsonComponentSerializer due to older version of abstract classes in version 1.16.5

Ticket: retrooper#832
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants