Search in sources :

Example 66 with CraftPlayer

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

the class FireInjector method removePlayer.

public void removePlayer(Player p) {
    try {
        EntityPlayer ep = ((CraftPlayer) p).getHandle();
        Channel ch = getChannel(getNetworkManager(ep));
        if (ch.pipeline().get("PacketInjector") != null) {
            ch.pipeline().remove("PacketInjector");
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_8_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 67 with CraftPlayer

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

the class FireBossBar method gen.

public void gen(String title) {
    EntityEnderDragon ew = new EntityEnderDragon(((CraftWorld) this.p.getWorld()).getHandle());
    Location loc = this.p.getLocation();
    ew.setInvisible(true);
    ew.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw());
    ew.setCustomName(title);
    PacketPlayOutSpawnEntityLiving pel = new PacketPlayOutSpawnEntityLiving(ew);
    ((CraftPlayer) this.p).getHandle().playerConnection.sendPacket(pel);
}
Also used : EntityEnderDragon(net.minecraft.server.v1_8_R3.EntityEnderDragon) PacketPlayOutSpawnEntityLiving(net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) Location(org.bukkit.Location)

Example 68 with CraftPlayer

use of org.bukkit.craftbukkit.v1_6_R2.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 69 with CraftPlayer

use of org.bukkit.craftbukkit.v1_6_R2.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 70 with CraftPlayer

use of org.bukkit.craftbukkit.v1_6_R2.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)

Aggregations

Player (org.bukkit.entity.Player)79 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)32 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)26 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)26 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)23 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)19 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)16 MyPetPlayer (de.Keyle.MyPet.api.player.MyPetPlayer)15 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 CraftPlayer (org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer)12 CraftPlayer (org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer)12 ServerPlayer (net.minecraft.server.level.ServerPlayer)10 PacketPlayOutTitle (net.minecraft.server.v1_12_R1.PacketPlayOutTitle)10 PacketPlayOutTitle (net.minecraft.server.v1_8_R3.PacketPlayOutTitle)10 HashSet (java.util.HashSet)8 Set (java.util.Set)8