Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerAnimationEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Player;
6 
7 /**
8  * Represents a player animation event
9  */
10 public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
11  private static final HandlerList handlers = new HandlerList();
12  private final PlayerAnimationType animationType;
13  private boolean isCancelled = false;
14 
15  /**
16  * Construct a new PlayerAnimation event
17  *
18  * @param player The player instance
19  */
20  public PlayerAnimationEvent(final Player player) {
21  super(player);
22 
23  // Only supported animation type for now:
24  animationType = PlayerAnimationType.ARM_SWING;
25  }
26 
27  /**
28  * Get the type of this animation event
29  *
30  * @return the animation type
31  */
33  return animationType;
34  }
35 
36  public boolean isCancelled() {
37  return this.isCancelled;
38  }
39 
40  public void setCancelled(boolean cancel) {
41  this.isCancelled = cancel;
42  }
43 
44  @Override
45  public HandlerList getHandlers() {
46  return handlers;
47  }
48 
49  public static HandlerList getHandlerList() {
50  return handlers;
51  }
52 }