Search in sources :

Example 1 with MCFirework

use of com.laytonsmith.abstraction.entities.MCFirework in project CommandHelper by EngineHub.

the class BukkitMCWorld method launchFirework.

@Override
public MCFirework launchFirework(MCLocation l, int strength, List<MCFireworkEffect> effects) {
    Firework firework = (Firework) w.spawnEntity(((BukkitMCLocation) l).asLocation(), EntityType.FIREWORK);
    FireworkMeta meta = firework.getFireworkMeta();
    meta.setPower(strength);
    for (MCFireworkEffect effect : effects) {
        meta.addEffect((FireworkEffect) effect.getHandle());
    }
    firework.setFireworkMeta(meta);
    return new BukkitMCFirework(firework);
}
Also used : BukkitMCFirework(com.laytonsmith.abstraction.bukkit.entities.BukkitMCFirework) MCFirework(com.laytonsmith.abstraction.entities.MCFirework) FireworkMeta(org.bukkit.inventory.meta.FireworkMeta) BukkitMCFirework(com.laytonsmith.abstraction.bukkit.entities.BukkitMCFirework) MCFireworkEffect(com.laytonsmith.abstraction.MCFireworkEffect)

Aggregations

MCFireworkEffect (com.laytonsmith.abstraction.MCFireworkEffect)1 BukkitMCFirework (com.laytonsmith.abstraction.bukkit.entities.BukkitMCFirework)1 MCFirework (com.laytonsmith.abstraction.entities.MCFirework)1 FireworkMeta (org.bukkit.inventory.meta.FireworkMeta)1