Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerAchievementAwardedEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.Achievement;
4 import org.bukkit.entity.Player;
7 
8 /**
9  * Called when a player earns an achievement.
10  */
11 public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private final Achievement achievement;
14  private boolean isCancelled = false;
15 
16  public PlayerAchievementAwardedEvent(Player player, Achievement achievement) {
17  super(player);
18  this.achievement = achievement;
19  }
20 
21  /**
22  * Gets the Achievement being awarded.
23  *
24  * @return the achievement being awarded
25  */
27  return achievement;
28  }
29 
30  public boolean isCancelled() {
31  return isCancelled;
32  }
33 
34  public void setCancelled(boolean cancel) {
35  this.isCancelled = cancel;
36  }
37 
38  @Override
39  public HandlerList getHandlers() {
40  return handlers;
41  }
42 
43  public static HandlerList getHandlerList() {
44  return handlers;
45  }
46 }