Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityPortalExitEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.Location;
4 import org.bukkit.entity.Entity;
6 import org.bukkit.util.Vector;
7 
8 /**
9  * Called before an entity exits a portal.
10  * <p>
11  * This event allows you to modify the velocity of the entity after they have
12  * successfully exited the portal.
13  */
15  private static final HandlerList handlers = new HandlerList();
16  private Vector before;
17  private Vector after;
18 
19  public EntityPortalExitEvent(final Entity entity, final Location from, final Location to, final Vector before, final Vector after) {
20  super(entity, from, to);
21  this.before = before;
22  this.after = after;
23  }
24 
25  /**
26  * Gets a copy of the velocity that the entity has before entering the
27  * portal.
28  *
29  * @return velocity of entity before entering portal
30  */
31  public Vector getBefore() {
32  return this.before.clone();
33  }
34 
35  /**
36  * Gets a copy of the velocity that the entity will have after exiting the
37  * portal.
38  *
39  * @return velocity of entity after exiting portal
40  */
41  public Vector getAfter() {
42  return this.after.clone();
43  }
44 
45  /**
46  * Sets the velocity that the entity will have after exiting the portal.
47  */
48  public void setAfter(Vector after) {
49  this.after = after.clone();
50  }
51 
52  @Override
53  public HandlerList getHandlers() {
54  return handlers;
55  }
56 
57  public static HandlerList getHandlerList() {
58  return handlers;
59  }
60 }