Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.event.block;
2
3import org.bukkit.block.Block;
4import org.bukkit.entity.Player;
5import org.bukkit.event.Cancellable;
6import org.bukkit.event.Event;
7
8/**
9 * Called when a block is ignited. If you want to catch when a Player places fire, you need to use {@link BlockPlaceEvent}.
10 * <p/>
11 * If a Block Ignite event is cancelled, the block will not be ignited.
12 */
13public class BlockIgniteEvent extends BlockEvent implements Cancellable {
14 private IgniteCause cause;
15 private boolean cancel;
16 private Player thePlayer;
17
18 public BlockIgniteEvent(Block theBlock, IgniteCause cause, Player thePlayer) {
19 super(Event.Type.BLOCK_IGNITE, theBlock);
20 this.cause = cause;
21 this.thePlayer = thePlayer;
22 this.cancel = false;
23 }
24
25 public boolean isCancelled() {
26 return cancel;
27 }
28
29 public void setCancelled(boolean cancel) {
30 this.cancel = cancel;
31 }
32
33 /**
34 * Gets the cause of block ignite.
35 *
36 * @return An IgniteCause value detailing the cause of block ignition
37 */
38 public IgniteCause getCause() {
39 return cause;
40 }
41
42 /**
43 * Gets the player who ignited this block
44 *
45 * @return The Player who placed the fire block, if not ignited by a player returns null
46 */
47 public Player getPlayer() {
48 return thePlayer;
49 }
50
51 /**
52 * An enum to specify the cause of the ignite
53 */
54 public enum IgniteCause {
55
56 /**
57 * Block ignition caused by lava.
58 */
59 LAVA,
60 /**
61 * Block ignition caused by a player using flint-and-steel.
62 */
63 FLINT_AND_STEEL,
64 /**
65 * Block ignition caused by dynamic spreading of fire.
66 */
67 SPREAD,
68 /**
69 * Block ignition caused by lightning.
70 */
71 LIGHTNING,
72 }
73}