Add FurnaceExtractEvent. Addresses BUKKIT-2114
Added a "BlockExpEvent" to hold experience and the handlers for the events
This commit is contained in:
44
src/main/java/org/bukkit/event/block/BlockExpEvent.java
Normal file
44
src/main/java/org/bukkit/event/block/BlockExpEvent.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user