001 package org.bukkit.event.player;
002
003 import org.bukkit.entity.Player;
004 import org.bukkit.event.HandlerList;
005
006 /**
007 * Called when a players experience changes naturally
008 */
009 public class PlayerExpChangeEvent extends PlayerEvent {
010 private static final HandlerList handlers = new HandlerList();
011 private int exp;
012
013 public PlayerExpChangeEvent(final Player player, final int expAmount) {
014 super(player);
015 exp = expAmount;
016 }
017
018 /**
019 * Get the amount of experience the player will receive
020 *
021 * @return The amount of experience
022 */
023 public int getAmount() {
024 return exp;
025 }
026
027 /**
028 * Set the amount of experience the player will receive
029 *
030 * @param amount The amount of experience to set
031 */
032 public void setAmount(int amount) {
033 exp = amount;
034 }
035
036 @Override
037 public HandlerList getHandlers() {
038 return handlers;
039 }
040
041 public static HandlerList getHandlerList() {
042 return handlers;
043 }
044 }