Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 44 lines 1.2 kB view raw
1package org.bukkit.event.block; 2 3import org.bukkit.block.Block; 4import org.bukkit.block.BlockState; 5import org.bukkit.event.Cancellable; 6 7/** 8 * Called when a block fades, melts or disappears based on world conditions 9 * <p/> 10 * Examples: 11 * <ul> 12 * <li>Snow melting due to being near a light source.</li> 13 * <li>Ice melting due to being near a light source.</li> 14 * </ul> 15 * <p/> 16 * If a Block Fade event is cancelled, the block will not fade, melt or disappear. 17 */ 18public class BlockFadeEvent extends BlockEvent implements Cancellable { 19 private boolean cancelled; 20 private BlockState newState; 21 22 public BlockFadeEvent(Block block, BlockState newState) { 23 super(Type.BLOCK_FADE, block); 24 this.newState = newState; 25 this.cancelled = false; 26 } 27 28 /** 29 * Gets the state of the block that will be fading, melting or disappearing. 30 * 31 * @return The block state of the block that will be fading, melting or disappearing 32 */ 33 public BlockState getNewState() { 34 return newState; 35 } 36 37 public boolean isCancelled() { 38 return cancelled; 39 } 40 41 public void setCancelled(boolean cancel) { 42 this.cancelled = cancel; 43 } 44}