Search in sources :

Example 1 with PacketPlayOutWorldParticles

use of net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles in project Denizen-For-Bukkit by DenizenScript.

the class Particle_v1_8_R3 method playFor.

@Override
public <T> void playFor(Player player, Location location, int count, Vector offset, double extra, T data) {
    int[] dataArray;
    if (data instanceof ItemStack) {
        dataArray = new int[] { ((ItemStack) data).getType().getId(), ((ItemStack) data).getDurability() };
    } else if (data instanceof MaterialData) {
        dataArray = new int[] { ((MaterialData) data).getItemTypeId() + (((MaterialData) data).getData() << 12) };
    }
    PacketHelper_v1_8_R3.sendPacket(player, new PacketPlayOutWorldParticles(particle, true, (float) location.getX(), (float) location.getY(), (float) location.getZ(), (float) offset.getX(), (float) offset.getY(), (float) offset.getZ(), (float) extra, count));
}
Also used : PacketPlayOutWorldParticles(net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles) MaterialData(org.bukkit.material.MaterialData) ItemStack(org.bukkit.inventory.ItemStack)

Example 2 with PacketPlayOutWorldParticles

use of net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles in project PyrCore by PYRRH4.

the class ParticleManager_1_10_2 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 : Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) PacketPlayOutWorldParticles(net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)

Example 3 with PacketPlayOutWorldParticles

use of net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles in project PyrCore by PYRRH4.

the class ParticleManager_1_11 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_11_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)

Example 4 with PacketPlayOutWorldParticles

use of net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles in project PyrCore by PYRRH4.

the class ParticleManager_1_12 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_12_R1.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)

Example 5 with PacketPlayOutWorldParticles

use of net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles in project PyrCore by PYRRH4.

the class ParticleManager_1_7_10 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(type.getName(), x, y, z, 0.0F, 0.0F, 0.0F, speed, count);
    for (Player pl : players) {
        ((CraftPlayer) pl).getHandle().playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer) Player(org.bukkit.entity.Player) PacketPlayOutWorldParticles(net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles) CraftPlayer(org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)16 PacketPlayOutWorldParticles (net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles)3 PacketPlayOutWorldParticles (net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles)2 PacketPlayOutWorldParticles (net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles)2 PacketPlayOutWorldParticles (net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles)2 PacketPlayOutWorldParticles (net.minecraft.server.v1_7_R1.PacketPlayOutWorldParticles)2 PacketPlayOutWorldParticles (net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles)2 PacketPlayOutWorldParticles (net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles)2 PacketPlayOutWorldParticles (net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles)2 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer)2 ItemStack (org.bukkit.inventory.ItemStack)1 MaterialData (org.bukkit.material.MaterialData)1