Add FurnaceExtractEvent. Addresses BUKKIT-2114

Added a "BlockExpEvent" to hold experience and the handlers for the events
This commit is contained in:
feildmaster
2012-12-07 19:12:32 -06:00
parent 0700565d8b
commit 8df7caf91f
3 changed files with 96 additions and 32 deletions

View File

@@ -0,0 +1,44 @@
package org.bukkit.event.block;
import org.bukkit.block.Block;
import org.bukkit.event.HandlerList;
/**
* An event that's called when a block yields experience.
*/
public class BlockExpEvent extends BlockEvent {
private static final HandlerList handlers = new HandlerList();
private int exp;
public BlockExpEvent(Block block, int exp) {
super(block);
this.exp = exp;
}
/**
* Get the experience dropped by the block after the event has processed
*
* @return The experience to drop
*/
public int getExpToDrop() {
return exp;
}
/**
* Set the amount of experience dropped by the block after the event has processed
*
* @param exp 1 or higher to drop experience, else nothing will drop
*/
public void setExpToDrop(int exp) {
this.exp = exp;
}
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}