Search in sources :

Example 16 with PacketPlayOutChat

use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project SpaciousLib by anhcraft.

the class ActionBar_1_8_R1 method send.

@Override
public void send(Player player, String text) {
    PacketPlayOutChat title = new PacketPlayOutChat(ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"), (byte) 2);
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
}
Also used : PacketPlayOutChat(net.minecraft.server.v1_8_R1.PacketPlayOutChat) CraftPlayer(org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)

Example 17 with PacketPlayOutChat

use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project Ublisk by Derkades.

the class V1_12_R1 method sendActionBarMessage.

@Override
public void sendActionBarMessage(Player player, String message) {
    IChatBaseComponent dummyComponent = ChatSerializer.a("{\"text\":\"herobrine1337\"}");
    PacketPlayOutChat packet = new PacketPlayOutChat(dummyComponent, ChatMessageType.GAME_INFO);
    packet.components = new BaseComponent[] { new TextComponent(message) };
    CraftPlayer craftPlayer = (CraftPlayer) player;
    craftPlayer.getHandle().playerConnection.sendPacket(packet);
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) PacketPlayOutChat(net.minecraft.server.v1_12_R1.PacketPlayOutChat) IChatBaseComponent(net.minecraft.server.v1_12_R1.IChatBaseComponent) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)

Example 18 with PacketPlayOutChat

use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project SSB-OneBlock by BG-Software-LLC.

the class NMSAdapter_v1_8_R3 method sendActionBar.

@Override
public void sendActionBar(Player player, String message) {
    PacketPlayOutChat packet = new PacketPlayOutChat(null, (byte) 2);
    packet.components = new BaseComponent[] { new TextComponent(message) };
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) PacketPlayOutChat(net.minecraft.server.v1_8_R3.PacketPlayOutChat) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 19 with PacketPlayOutChat

use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project UltraCosmetics by iSach.

the class AncientUtil method sendActionBarMessage.

@Override
public void sendActionBarMessage(Player player, String message) {
    CraftPlayer p = (CraftPlayer) player;
    IChatBaseComponent cbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + message + "\"}");
    PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
    p.getHandle().playerConnection.sendPacket(ppoc);
}
Also used : PacketPlayOutChat(net.minecraft.server.v1_8_R3.PacketPlayOutChat) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) IChatBaseComponent(net.minecraft.server.v1_8_R3.IChatBaseComponent)

Aggregations

Player (org.bukkit.entity.Player)7 PacketPlayOutChat (net.minecraft.server.v1_8_R3.PacketPlayOutChat)5 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)5 TextComponent (net.md_5.bungee.api.chat.TextComponent)3 PacketPlayOutChat (net.minecraft.server.v1_10_R1.PacketPlayOutChat)2 PacketPlayOutChat (net.minecraft.server.v1_11_R1.PacketPlayOutChat)2 PacketPlayOutChat (net.minecraft.server.v1_8_R1.PacketPlayOutChat)2 PacketPlayOutChat (net.minecraft.server.v1_8_R2.PacketPlayOutChat)2 IChatBaseComponent (net.minecraft.server.v1_8_R3.IChatBaseComponent)2 PacketPlayOutChat (net.minecraft.server.v1_9_R1.PacketPlayOutChat)2 PacketPlayOutChat (net.minecraft.server.v1_9_R2.PacketPlayOutChat)2 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)2 IChatBaseComponent (net.minecraft.server.v1_12_R1.IChatBaseComponent)1 PacketPlayOutChat (net.minecraft.server.v1_12_R1.PacketPlayOutChat)1 IChatBaseComponent (net.minecraft.server.v1_14_R1.IChatBaseComponent)1