Search in sources :

Example 1 with PacketPlayOutChat

use of net.minecraft.network.protocol.game.PacketPlayOutChat in project SwornAPI by dmulloy2.

the class Volatile method sendMessage.

public static boolean sendMessage(Player player, ChatPosition position, BaseComponent... message) {
    IChatBaseComponent component = IChatBaseComponent.ChatSerializer.a(ComponentSerializer.toString(message));
    ChatMessageType type = ChatMessageType.a(position.getValue());
    ((org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer) player).getHandle().b.a(new PacketPlayOutChat(component, type, SERVER_UUID));
    return true;
}
Also used : ChatMessageType(net.minecraft.network.chat.ChatMessageType) PacketPlayOutChat(net.minecraft.network.protocol.game.PacketPlayOutChat) IChatBaseComponent(net.minecraft.network.chat.IChatBaseComponent)

Aggregations

ChatMessageType (net.minecraft.network.chat.ChatMessageType)1 IChatBaseComponent (net.minecraft.network.chat.IChatBaseComponent)1 PacketPlayOutChat (net.minecraft.network.protocol.game.PacketPlayOutChat)1