Added BlockSpread, BlockForm and BlockFade events.

This commit is contained in:
EvilSeph
2011-06-17 14:46:01 -04:00
parent 99d9e5f66b
commit 7f333192cf
6 changed files with 193 additions and 1 deletions

View File

@@ -0,0 +1,48 @@
package org.bukkit.event.block;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.event.Cancellable;
/**
*Called when a block fades, melts or disappears based on world conditions
*/
public class BlockFadeEvent extends BlockEvent implements Cancellable {
private boolean cancelled;
private BlockState newState;
public BlockFadeEvent(Block block, BlockState newState) {
super(Type.BLOCK_FADE, block);
this.newState = newState;
this.cancelled = false;
}
/**
* Gets the state of the block that will be fading
*
* @return the block state
*/
public BlockState getNewState() {
return newState;
}
/**
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* @return true if this event is cancelled
*/
public boolean isCancelled() {
return cancelled;
}
/**
* Sets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* @param cancel true if you wish to cancel snow from forming during a ice formation
*/
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
}