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 level changes 008 */ 009 public class PlayerLevelChangeEvent extends PlayerEvent { 010 private static final HandlerList handlers = new HandlerList(); 011 private final int oldLevel; 012 private final int newLevel; 013 014 public PlayerLevelChangeEvent(final Player player, final int oldLevel, final int newLevel) { 015 super(player); 016 this.oldLevel = oldLevel; 017 this.newLevel = newLevel; 018 } 019 020 /** 021 * Gets the old level of the player 022 * 023 * @return The old level of the player 024 */ 025 public int getOldLevel() { 026 return oldLevel; 027 } 028 029 /** 030 * Gets the new level of the player 031 * 032 * @return The new (current) level of the player 033 */ 034 public int getNewLevel() { 035 return newLevel; 036 } 037 038 @Override 039 public HandlerList getHandlers() { 040 return handlers; 041 } 042 043 public static HandlerList getHandlerList() { 044 return handlers; 045 } 046 }