Search in sources :

Example 1 with MCParticle

use of com.laytonsmith.abstraction.enums.MCParticle in project CommandHelper by EngineHub.

the class BukkitMCPlayer method spawnParticle.

@Override
public void spawnParticle(MCLocation l, MCParticle pa, int count, double offsetX, double offsetY, double offsetZ, double velocity, Object data) {
    try {
        Particle type = Particle.valueOf(pa.name());
        Location loc = ((BukkitMCLocation) l).asLocation();
        if (data != null && type.getDataType().equals(ItemStack.class) && data instanceof MCItemStack) {
            p.spawnParticle(type, loc, count, offsetX, offsetY, offsetZ, velocity, ((MCItemStack) data).getHandle());
        } else {
            p.spawnParticle(type, loc, count, offsetX, offsetY, offsetZ, velocity);
        }
    } catch (NoClassDefFoundError ex) {
    // probably prior to 1.9
    }
}
Also used : MCParticle(com.laytonsmith.abstraction.enums.MCParticle) Particle(org.bukkit.Particle) BukkitMCItemStack(com.laytonsmith.abstraction.bukkit.BukkitMCItemStack) MCItemStack(com.laytonsmith.abstraction.MCItemStack) BukkitMCLocation(com.laytonsmith.abstraction.bukkit.BukkitMCLocation) Location(org.bukkit.Location) MCLocation(com.laytonsmith.abstraction.MCLocation) BukkitMCLocation(com.laytonsmith.abstraction.bukkit.BukkitMCLocation)

Aggregations

MCItemStack (com.laytonsmith.abstraction.MCItemStack)1 MCLocation (com.laytonsmith.abstraction.MCLocation)1 BukkitMCItemStack (com.laytonsmith.abstraction.bukkit.BukkitMCItemStack)1 BukkitMCLocation (com.laytonsmith.abstraction.bukkit.BukkitMCLocation)1 MCParticle (com.laytonsmith.abstraction.enums.MCParticle)1 Location (org.bukkit.Location)1 Particle (org.bukkit.Particle)1