001    package org.bukkit.event.block;
002    
003    import org.bukkit.block.Block;
004    import org.bukkit.event.HandlerList;
005    
006    /**
007     * An event that's called when a block yields experience.
008     */
009    public class BlockExpEvent extends BlockEvent {
010        private static final HandlerList handlers = new HandlerList();
011        private int exp;
012    
013        public BlockExpEvent(Block block, int exp) {
014            super(block);
015    
016            this.exp = exp;
017        }
018    
019        /**
020         * Get the experience dropped by the block after the event has processed
021         *
022         * @return The experience to drop
023         */
024        public int getExpToDrop() {
025            return exp;
026        }
027    
028        /**
029         * Set the amount of experience dropped by the block after the event has
030         * processed
031         *
032         * @param exp 1 or higher to drop experience, else nothing will drop
033         */
034        public void setExpToDrop(int exp) {
035            this.exp = exp;
036        }
037    
038        public HandlerList getHandlers() {
039            return handlers;
040        }
041    
042        public static HandlerList getHandlerList() {
043            return handlers;
044        }
045    }