Search in sources :

Example 31 with CraftPlayer

use of org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer in project SpaciousLib by anhcraft.

the class Title_1_8_R1 method sendSubTitle.

@Override
public void sendSubTitle(Player player, String text, int fadeIn, int stay, int fadeOut) {
    PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, 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_8_R1.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)

Example 32 with CraftPlayer

use of org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer in project SpaciousLib by anhcraft.

the class Title_1_8_R1 method sendSubTitle.

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

Example 33 with CraftPlayer

use of org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer in project SpaciousLib by anhcraft.

the class Title_1_8_R2 method sendTitle.

//-----------------------------------------------------------
@Override
public void sendTitle(World world, String text) {
    for (Player player : world.getPlayers()) {
        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_8_R2.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)

Example 34 with CraftPlayer

use of org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer in project SpaciousLib by anhcraft.

the class Title_1_8_R2 method sendTitle.

@Override
public void sendTitle(World world, String text, int fadeIn, int stay, int fadeOut) {
    for (Player player : world.getPlayers()) {
        PacketPlayOutTitle title = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TITLE, 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_8_R2.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)

Example 35 with CraftPlayer

use of org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer in project SpaciousLib by anhcraft.

the class Title_1_8_R2 method sendTitle.

@Override
public void sendTitle(Player player, String text, int fadeIn, int stay, int fadeOut) {
    PacketPlayOutTitle title = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TITLE, 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_8_R2.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)83 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)36 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)27 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)26 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)26 MyPetPlayer (de.Keyle.MyPet.api.player.MyPetPlayer)24 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)23 Behavior (de.Keyle.MyPet.api.skill.skills.Behavior)21 CraftPlayer (org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer)18 CraftPlayer (org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer)18 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)18 UUID (java.util.UUID)15 CraftPlayer (org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer)15 GameProfile (com.mojang.authlib.GameProfile)14 CraftPlayer (org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)14 CraftPlayer (org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer)14 ServerPlayer (net.minecraft.server.level.ServerPlayer)12 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)11 PacketPlayOutTitle (net.minecraft.server.v1_12_R1.PacketPlayOutTitle)10 MyPetFeedEvent (de.Keyle.MyPet.api.event.MyPetFeedEvent)8