Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerVelocityEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Player;
6 import org.bukkit.util.Vector;
7 
8 /**
9  * Called when the velocity of a player changes.
10  */
11 public class PlayerVelocityEvent extends PlayerEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancel = false;
14  private Vector velocity;
15 
16  public PlayerVelocityEvent(final Player player, final Vector velocity) {
17  super(player);
18  this.velocity = velocity;
19  }
20 
21  public boolean isCancelled() {
22  return cancel;
23  }
24 
25  public void setCancelled(boolean cancel) {
26  this.cancel = cancel;
27  }
28 
29  /**
30  * Gets the velocity vector that will be sent to the player
31  *
32  * @return Vector the player will get
33  */
34  public Vector getVelocity() {
35  return velocity;
36  }
37 
38  /**
39  * Sets the velocity vector that will be sent to the player
40  *
41  * @param velocity The velocity vector that will be sent to the player
42  */
43  public void setVelocity(Vector velocity) {
44  this.velocity = velocity;
45  }
46 
47  @Override
48  public HandlerList getHandlers() {
49  return handlers;
50  }
51 
52  public static HandlerList getHandlerList() {
53  return handlers;
54  }
55 }