use of net.minecraft.server.v1_12_R1.IChatBaseComponent in project FireAPI by FireBlade-Serv.
the class FireBukkitActionBar method send.
public void send(String message) {
IChatBaseComponent cbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(ppoc);
}
use of net.minecraft.server.v1_12_R1.IChatBaseComponent in project FireAPI by FireBlade-Serv.
the class FireTitle method send.
public void send() {
IChatBaseComponent basetitle = ChatSerializer.a("{\"text\": \"" + this.title + "\"}");
IChatBaseComponent basesubtitle = ChatSerializer.a("{\"text\": \"" + this.subtitle + "\"}");
PacketPlayOutTitle titlepacket = new PacketPlayOutTitle(EnumTitleAction.TITLE, basetitle);
PacketPlayOutTitle subtitlepacket = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, basesubtitle);
((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(titlepacket);
((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(subtitlepacket);
sendTime();
}
use of net.minecraft.server.v1_12_R1.IChatBaseComponent 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);
}
Aggregations