Search in sources :

Example 36 with CraftPlayer

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

the class Title_1_8_R3 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_R3.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 37 with CraftPlayer

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

the class Title_1_8_R3 method sendSubTitle.

@Override
public void sendSubTitle(World world, String text) {
    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);
    }
}
Also used : PacketPlayOutTitle(net.minecraft.server.v1_8_R3.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 38 with CraftPlayer

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

the class Title_1_11_R1 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_11_R1.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)

Example 39 with CraftPlayer

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

the class Title_1_11_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_11_R1.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)

Example 40 with CraftPlayer

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

the class Title_1_11_R1 method sendSubTitle.

@Override
public void sendSubTitle(World world, String text) {
    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);
    }
}
Also used : PacketPlayOutTitle(net.minecraft.server.v1_11_R1.PacketPlayOutTitle) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)250 ServerPlayer (net.minecraft.server.level.ServerPlayer)140 CraftPlayer (org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer)113 CraftPlayer (org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer)90 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)81 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)81 ItemStack (org.bukkit.inventory.ItemStack)80 Location (org.bukkit.Location)75 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)70 CraftPlayer (org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer)66 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)57 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)52 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)51 GameProfile (com.mojang.authlib.GameProfile)48 EntityPlayer (net.minecraft.server.level.EntityPlayer)47 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)45 CraftPlayer (org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer)45 Property (com.mojang.authlib.properties.Property)44 CraftPlayer (org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer)42 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)41