Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
BlockSpreadEvent.java
1 package org.bukkit.event.block;
2 
3 import org.bukkit.block.Block;
6 
7 /**
8  * Called when a block spreads based on world conditions.
9  * <p>
10  * Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of
11  * actually spread.
12  * <p>
13  * Examples:
14  * <ul>
15  * <li>Mushrooms spreading.
16  * <li>Fire spreading.
17  * </ul>
18  * <p>
19  * If a Block Spread event is cancelled, the block will not spread.
20  *
21  * @see BlockFormEvent
22  */
23 public class BlockSpreadEvent extends BlockFormEvent {
24  private static final HandlerList handlers = new HandlerList();
25  private final Block source;
26 
27  public BlockSpreadEvent(final Block block, final Block source, final BlockState newState) {
28  super(block, newState);
29  this.source = source;
30  }
31 
32  /**
33  * Gets the source block involved in this event.
34  *
35  * @return the Block for the source block involved in this event.
36  */
37  public Block getSource() {
38  return source;
39  }
40 
41  @Override
42  public HandlerList getHandlers() {
43  return handlers;
44  }
45 
46  public static HandlerList getHandlerList() {
47  return handlers;
48  }
49 }