Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerLevelChangeEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Player;
5 
6 /**
7  * Called when a players level changes
8  */
9 public class PlayerLevelChangeEvent extends PlayerEvent {
10  private static final HandlerList handlers = new HandlerList();
11  private final int oldLevel;
12  private final int newLevel;
13 
14  public PlayerLevelChangeEvent(final Player player, final int oldLevel, final int newLevel) {
15  super(player);
16  this.oldLevel = oldLevel;
17  this.newLevel = newLevel;
18  }
19 
20  /**
21  * Gets the old level of the player
22  *
23  * @return The old level of the player
24  */
25  public int getOldLevel() {
26  return oldLevel;
27  }
28 
29  /**
30  * Gets the new level of the player
31  *
32  * @return The new (current) level of the player
33  */
34  public int getNewLevel() {
35  return newLevel;
36  }
37 
38  @Override
39  public HandlerList getHandlers() {
40  return handlers;
41  }
42 
43  public static HandlerList getHandlerList() {
44  return handlers;
45  }
46 }