Search in sources :

Example 66 with PacketPlayOutTitle

use of net.minecraft.server.v1_8_R3.PacketPlayOutTitle in project SpaciousLib by anhcraft.

the class ActionBar_1_12_R1 method send.

@Override
public void send(World world, String text) {
    for (Player player : world.getPlayers()) {
        PacketPlayOutTitle title = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"));
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
    }
}
Also used : PacketPlayOutTitle(net.minecraft.server.v1_12_R1.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)

Example 67 with PacketPlayOutTitle

use of net.minecraft.server.v1_8_R3.PacketPlayOutTitle 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();
}
Also used : PacketPlayOutTitle(net.minecraft.server.v1_8_R3.PacketPlayOutTitle) IChatBaseComponent(net.minecraft.server.v1_8_R3.IChatBaseComponent) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 68 with PacketPlayOutTitle

use of net.minecraft.server.v1_8_R3.PacketPlayOutTitle in project FireAPI by FireBlade-Serv.

the class FireTitle method sendTime.

private void sendTime() {
    PacketPlayOutTitle time = new PacketPlayOutTitle(EnumTitleAction.TIMES, null, this.FadeIn, this.Stay, this.FadeOut);
    ((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(time);
}
Also used : PacketPlayOutTitle(net.minecraft.server.v1_8_R3.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)33 PacketPlayOutTitle (net.minecraft.server.v1_12_R1.PacketPlayOutTitle)10 PacketPlayOutTitle (net.minecraft.server.v1_8_R3.PacketPlayOutTitle)10 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)10 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)10 PacketPlayOutTitle (net.minecraft.server.v1_10_R1.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_11_R1.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_8_R1.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_8_R2.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_9_R1.PacketPlayOutTitle)8 PacketPlayOutTitle (net.minecraft.server.v1_9_R2.PacketPlayOutTitle)8 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)8 IChatBaseComponent (net.minecraft.server.v1_8_R3.IChatBaseComponent)1