aadnk / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
287 stars 92 forks source link

Ancient Gson version? #121

Closed dadus33 closed 7 years ago

dadus33 commented 7 years ago

Hello! Firstly, I'm sorry I don't respect the issue template, but I really think it would be much easier for both of everyone if I'd just link you to the spigot post that made me post this: https://www.spigotmc.org/threads/chatitem-display-items-in-chat.126220/page-12#post-2118949 I'm rather certain this is not a ProtocolLib issue, as the last modification to the ComponentParser was on the 6th of August, and I think I'm right in my belief of how the getConstructor method works. However, can you please enlighten me on what the issue might be? From the looks of it, JsonReader was indeed found at the requested location, but it's constructor didn't match. I've tried diving deep into Gson's history back to 2013, but I still couldn't find any version that didn't have that constructor. So what might the problem be? Again, sorry to post it in the Issues section, but I think that solving this might actually contribute to the development of ProtocolLib.

dmulloy2 commented 7 years ago

It's an issue with the GSON version bundled with Spigot 1.8. Why people are still using such an old version is beyond me, but I can look into fixing compatibility.

dadus33 commented 7 years ago

Thanks for solving that! So in the end, I was wrong about how the getConstructor method works? I thought you could supply an extending class as an argument and it would still find it. For instance, running getConstructor(StringReader.class) should return the same as getConstructor(Reader.class), as StringReader extends Reader. But looks like I was wrong...

dmulloy2 commented 7 years ago

I guess I assumed the same as well. Either that or I didn't look at the documentation close enough lol

dadus33 commented 7 years ago

I've read the docs too (https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getConstructor(java.lang.Class...)), but it doesn't explain that there.