mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
Use title packet for actionbar methods (#3959)
This commit is contained in:
@@ -26,9 +26,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
// Paper start
|
||||
+ @Override
|
||||
+ public void sendActionBar(BaseComponent[] message) {
|
||||
+ if (getHandle().playerConnection == null) return;
|
||||
+ getHandle().playerConnection.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, message, -1, -1, -1));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendActionBar(String message) {
|
||||
+ if (getHandle().playerConnection == null || message == null || message.isEmpty()) return;
|
||||
+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO, SystemUtils.getNullUUID()));
|
||||
+ getHandle().playerConnection.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, CraftChatMessage.fromStringOrNull(message)));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
Reference in New Issue
Block a user