Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
BlockFadeEvent.java
1 package org.bukkit.event.block;
2 
3 import org.bukkit.block.Block;
7 
8 /**
9  * Called when a block fades, melts or disappears based on world conditions
10  * <p>
11  * Examples:
12  * <ul>
13  * <li>Snow melting due to being near a light source.
14  * <li>Ice melting due to being near a light source.
15  * <li>Fire burning out after time, without destroying fuel block.
16  * </ul>
17  * <p>
18  * If a Block Fade event is cancelled, the block will not fade, melt or
19  * disappear.
20  */
21 public class BlockFadeEvent extends BlockEvent implements Cancellable {
22  private static final HandlerList handlers = new HandlerList();
23  private boolean cancelled;
24  private final BlockState newState;
25 
26  public BlockFadeEvent(final Block block, final BlockState newState) {
27  super(block);
28  this.newState = newState;
29  this.cancelled = false;
30  }
31 
32  /**
33  * Gets the state of the block that will be fading, melting or
34  * disappearing.
35  *
36  * @return The block state of the block that will be fading, melting or
37  * disappearing
38  */
40  return newState;
41  }
42 
43  public boolean isCancelled() {
44  return cancelled;
45  }
46 
47  public void setCancelled(boolean cancel) {
48  this.cancelled = cancel;
49  }
50 
51  @Override
52  public HandlerList getHandlers() {
53  return handlers;
54  }
55 
56  public static HandlerList getHandlerList() {
57  return handlers;
58  }
59 }