Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
PlayerMoveEvent.java
Go to the documentation of this file.
1 package org.bukkit.event.player;
2 
3 import org.bukkit.Location;
4 import org.bukkit.entity.Player;
5 import org.bukkit.event.Cancellable;
6 import org.bukkit.event.HandlerList;
7 
11 public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancel = false;
14  private Location from;
15  private Location to;
16 
17  public PlayerMoveEvent(final Player player, final Location from, final Location to) {
18  super(player);
19  this.from = from;
20  this.to = to;
21  }
22 
33  public boolean isCancelled() {
34  return cancel;
35  }
36 
47  public void setCancelled(boolean cancel) {
48  this.cancel = cancel;
49  }
50 
56  public Location getFrom() {
57  return from;
58  }
59 
65  public void setFrom(Location from) {
66  this.from = from;
67  }
68 
74  public Location getTo() {
75  return to;
76  }
77 
83  public void setTo(Location to) {
84  this.to = to;
85  }
86 
87  @Override
89  return handlers;
90  }
91 
92  public static HandlerList getHandlerList() {
93  return handlers;
94  }
95 }