Search in sources :

Example 61 with CraftPlayer

use of org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer in project PyrCore by PYRRH4.

the class ParticleManager_1_9_4 method send.

public void send(ParticleManager.Type type, Location loc, float speed, int count, ArrayList<Player> players) {
    float x = (float) loc.getX();
    float y = (float) loc.getY();
    float z = (float) loc.getZ();
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.valueOf(type.getName()), true, x, y, z, 0.0F, 0.0F, 0.0F, speed, count, null);
    for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)

Example 62 with CraftPlayer

use of org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer in project PyrCore by PYRRH4.

the class ParticleManager_1_9_4 method sendColor.

public void sendColor(ParticleManager.Type type, Location loc, float speed, int count, Color color, ArrayList<Player> players) {
    float x = (float) loc.getX();
    float y = (float) loc.getY();
    float z = (float) loc.getZ();
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.valueOf(type.getName()), true, x, y, z, color.getRed(), color.getGreen(), color.getBlue(), speed, count, null);
    for (Player pl : players) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)

Example 63 with CraftPlayer

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

the class FireInjector method addPlayer.

public void addPlayer(Player p) {
    try {
        EntityPlayer ep = ((CraftPlayer) p).getHandle();
        Channel ch = getChannel(getNetworkManager(ep));
        if (ch.pipeline().get("PacketInjector") == null) {
            FireHandler h = new FireHandler(p);
            ch.pipeline().addBefore("packet_handler", "PacketInjector", h);
        }
    } 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 64 with CraftPlayer

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

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

Aggregations

Player (org.bukkit.entity.Player)85 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 ServerPlayer (net.minecraft.server.level.ServerPlayer)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_16_R3.entity.CraftPlayer)11 PacketPlayOutTitle (net.minecraft.server.v1_12_R1.PacketPlayOutTitle)10 MyPetFeedEvent (de.Keyle.MyPet.api.event.MyPetFeedEvent)8