Java Code Examples for org.bukkit.event.block.BlockIgniteEvent.IgniteCause#FIREBALL

The following examples show how to use org.bukkit.event.block.BlockIgniteEvent.IgniteCause#FIREBALL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CraftEventFactory.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
public static BlockIgniteEvent callBlockIgniteEvent(World world, int x, int y, int z, Entity igniter) {
    org.bukkit.World bukkitWorld = world.getWorld();
    org.bukkit.entity.Entity bukkitIgniter = igniter.getBukkitEntity();
    IgniteCause cause;
    switch (bukkitIgniter.getType()) {
        case ENDER_CRYSTAL:
            cause = IgniteCause.ENDER_CRYSTAL;
            break;
        case LIGHTNING:
            cause = IgniteCause.LIGHTNING;
            break;
        case SMALL_FIREBALL:
        case FIREBALL:
            cause = IgniteCause.FIREBALL;
            break;
        default:
            cause = IgniteCause.FLINT_AND_STEEL;
    }

    BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, bukkitIgniter);
    world.getServer().getPluginManager().callEvent(event);
    return event;
}
 
Example 2
Source File: CraftEventFactory.java    From Thermos with GNU General Public License v3.0 6 votes vote down vote up
public static BlockIgniteEvent callBlockIgniteEvent(net.minecraft.world.World world, int x, int y, int z, net.minecraft.entity.Entity igniter) {
    org.bukkit.World bukkitWorld = world.getWorld();
    org.bukkit.entity.Entity bukkitIgniter = igniter.getBukkitEntity();
    IgniteCause cause;
    switch (bukkitIgniter.getType()) {
    case ENDER_CRYSTAL:
        cause = IgniteCause.ENDER_CRYSTAL;
        break;
    case LIGHTNING:
        cause = IgniteCause.LIGHTNING;
        break;
    case SMALL_FIREBALL:
    case FIREBALL:
        cause = IgniteCause.FIREBALL;
        break;
    default:
        cause = IgniteCause.FLINT_AND_STEEL;
    }

    BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, bukkitIgniter);
    world.getServer().getPluginManager().callEvent(event);
    return event;
}