Search in sources :

Example 66 with CraftPlayer

use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project FireAPI by FireBlade-Serv.

the class PingCommand method onCommand.

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (sender instanceof Player) {
        Player p = (Player) sender;
        int ping = ((CraftPlayer) p).getHandle().ping;
        p.sendMessage("§6[§ePing§6]§r Ton ping §eserveur§r est de §e" + ping + " ms§r !");
        try {
            c.sendPacket(new PacketPlayerPing(p.getName(), PingState.INIT_SERVER));
        } catch (IOException e) {
            e.printStackTrace();
        }
    } else {
        sender.sendMessage("§6[§ePing§6]§r §cErreur, vous devez être en jeu pour pouvoir executer cette commande !");
    }
    return false;
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) Player(org.bukkit.entity.Player) IOException(java.io.IOException) PacketPlayerPing(fr.glowstoner.fireapi.bigbrother.console.packets.ping.PacketPlayerPing)

Example 67 with CraftPlayer

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

Example 68 with CraftPlayer

use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project Citizens2 by CitizensDev.

the class NMSImpl method sendTabListAdd.

@Override
public void sendTabListAdd(Player recipient, Player listPlayer) {
    Preconditions.checkNotNull(recipient);
    Preconditions.checkNotNull(listPlayer);
    EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
    NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity));
}
Also used : EntityPlayer(net.minecraft.server.v1_10_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) PacketPlayOutPlayerInfo(net.minecraft.server.v1_10_R1.PacketPlayOutPlayerInfo)

Example 69 with CraftPlayer

use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project Citizens2 by CitizensDev.

the class NMSImpl method sendTabListRemove.

@Override
public void sendTabListRemove(Player recipient, Player listPlayer) {
    Preconditions.checkNotNull(recipient);
    Preconditions.checkNotNull(listPlayer);
    EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
    NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, entity));
}
Also used : EntityPlayer(net.minecraft.server.v1_12_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) PacketPlayOutPlayerInfo(net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo)

Example 70 with CraftPlayer

use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project Citizens2 by CitizensDev.

the class NMSImpl method sendTabListAdd.

@Override
public void sendTabListAdd(Player recipient, Player listPlayer) {
    Preconditions.checkNotNull(recipient);
    Preconditions.checkNotNull(listPlayer);
    EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
    NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity));
}
Also used : EntityPlayer(net.minecraft.server.v1_12_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) PacketPlayOutPlayerInfo(net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo)

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