Closed KeyboardKobold closed 2 years ago
I just did the same update myself too and saw that you opened this PR 3 hours ago, lol
The issue with the message prompt is that you seem to be using the wrong method in ActionBarUtil.java, the one you're using sends a message in the chat but this class's sendMessage method is meant to show a message over the hotbar and repeats itself to prevent the message to disappear until the player placed the image.
Here's a working version of this class :
class ActionBarUtil extends com.andavin.util.ActionBarUtil {
@Override
protected void sendMessage(Player player, String message) {
((CraftPlayer) player).getHandle().connection.send(
new ClientboundSystemChatPacket(Component.translatable(message), 2));
}
}
Thank you, I'll update this PR asap!
You can also remove the ID attribute and java.util.UUID import from that class as they are now unused.
You can also remove the ID attribute and java.util.UUID import from that class as they are now unused.
Oh, good point! Completely forgot, usually I try to keep everything clean.
Also, may I ask how you figured out what Clientbound*Packet to use and how to use the Component factory? I tried looking at the Spigot API, but I can't seem to find it in there.
Also, may I ask how you figured out what Clientbound*Packet to use and how to use the Component factory? I tried looking at the Spigot API, but I can't seem to find it in there.
I used IntelliJ autocomplete to find ClientboundSystemChatPacket as ClientboundChatPacket was removed and I was trying to see if something else replaced it. For the Component factory, I found this thread on the Forge forums where it is suggested to use one of the factory methods in the Component class.
Btw the main dev of this plugin has already made 1.19 support on the dev branch.
Updated to work with Minecraft 1.19
I just tried to get this up and running for our server quickly and it seems to work, however the message prompt to place the image is now being sent multiple times. Not sure on how to fix it, open to any input!