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

Sending FancyMessage's #68

Open
ThatCurlyFry opened this issue May 2, 2016 · 3 comments
Open

Sending FancyMessage's #68

ThatCurlyFry opened this issue May 2, 2016 · 3 comments

Comments

@ThatCurlyFry
Copy link

I was using this library in one of my plugins, and its been working, but for some reason, it just stopped working and is giving me this error:
02.05 17:23:21 [Server] WARN java.lang.NoSuchFieldException: playerConnection
02.05 17:23:21 [Server] WARN at java.lang.Class.getDeclaredField(Class.java:2070)
02.05 17:23:21 [Server] WARN at net.amoebaman.util.Reflection.getField(Reflection.java:147)
02.05 17:23:21 [Server] WARN at mkremins.fanciful.FancyMessage.send(FancyMessage.java:616)
02.05 17:23:21 [Server] WARN at mkremins.fanciful.FancyMessage.send(FancyMessage.java:605)
02.05 17:23:21 [Server] WARN at me.thatcurlyfry.showitem.Main.onChat(Main.java:159)
02.05 17:23:21 [Server] WARN at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
02.05 17:23:21 [Server] WARN at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
02.05 17:23:21 [Server] WARN at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
02.05 17:23:21 [Server] WARN at java.lang.reflect.Method.invoke(Method.java:498)
02.05 17:23:21 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300)
02.05 17:23:21 [Server] WARN at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74)
02.05 17:23:21 [Server] WARN at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
02.05 17:23:21 [Server] WARN at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501)
02.05 17:23:21 [Server] WARN at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:483)
02.05 17:23:21 [Server] WARN at net.minecraft.server.v1_8_R3.PlayerConnection.chat(PlayerConnection.java:1111)
02.05 17:23:21 [Server] WARN at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1026)
02.05 17:23:21 [Server] WARN at net.minecraft.server.v1_8_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:39)
02.05 17:23:21 [Server] WARN at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
02.05 17:23:21 [Server] WARN at java.util.concurrent.FutureTask.run(FutureTask.java:266)
02.05 17:23:21 [Server] WARN at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
02.05 17:23:21 [Server] WARN at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
02.05 17:23:21 [Server] WARN at java.lang.Thread.run(Thread.java:745)

PS: line 159 in my main class is just fancymessage.send(player)

@mkremins
Copy link
Owner

mkremins commented May 2, 2016

What server software are you using? It looks like the Player instance doesn't contain a playerConnection field, which is causing Fanciful's reflection hackery to fail.

@ThatCurlyFry
Copy link
Author

I'm using PaperSpigot 1.8.8

@mkremins
Copy link
Owner

It looks like Spigot's implementation of the Bukkit Player interface has diverged enough from the CraftBukkit implementation against which Fanciful was originally written that FancyMessage.send won't work on Spigot servers. I'd recommend using the Chat Component API instead of Fanciful if you're writing plugins for Spigot servers – the API is pretty similar to Fanciful's and it should be better supported.

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

No branches or pull requests

2 participants