use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project SpaciousLib by anhcraft.
the class ActionBar_1_11_R1 method send.
@Override
public void send(Player player, String text) {
PacketPlayOutChat title = new PacketPlayOutChat(IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"), (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
}
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(World world, String text) {
for (Player player : world.getPlayers()) {
PacketPlayOutChat title = new PacketPlayOutChat(ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"), (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
}
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project SpaciousLib by anhcraft.
the class ActionBar_1_8_R3 method send.
@Override
public void send(Player player, String text) {
PacketPlayOutChat title = new PacketPlayOutChat(IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"), (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project SpaciousLib by anhcraft.
the class ActionBar_1_9_R1 method send.
@Override
public void send(Player player, String text) {
PacketPlayOutChat title = new PacketPlayOutChat(IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"), (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutChat in project Ublisk by Derkades.
the class V1_14_R1 method sendActionBarMessage.
@Deprecated
@Override
public void sendActionBarMessage(final Player player, final String message) {
final IChatBaseComponent dummyComponent = ChatSerializer.a("{\"text\":\"herobrine1337\"}");
final PacketPlayOutChat packet = new PacketPlayOutChat(dummyComponent, ChatMessageType.GAME_INFO);
packet.components = new BaseComponent[] { new TextComponent(message) };
final CraftPlayer craftPlayer = (CraftPlayer) player;
craftPlayer.getHandle().playerConnection.sendPacket(packet);
}
Aggregations