Search in sources :

Example 1 with PacketPlayOutTitle

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

the class ActionBar_1_12_R1 method send.

@Override
public void send(Player player, String text) {
    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)

Example 2 with PacketPlayOutTitle

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

the class Title_1_10_R1 method sendSubTitle.

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

Example 3 with PacketPlayOutTitle

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

the class Title_1_10_R1 method sendSubTitle.

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

Example 4 with PacketPlayOutTitle

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

the class Title_1_10_R1 method sendTitle.

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

Example 5 with PacketPlayOutTitle

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

the class Title_1_8_R3 method sendSubTitle.

@Override
public void sendSubTitle(Player player, String text) {
    PacketPlayOutTitle title = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.SUBTITLE, IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', text) + "\"}"));
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
}
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 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.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_8_R3.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_8_R3.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer)8 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)8