001 package org.bukkit.event.entity; 002 003 import org.bukkit.entity.Entity; 004 import org.bukkit.Location; 005 import org.bukkit.event.HandlerList; 006 007 /** 008 * Called when an entity comes into contact with a portal 009 */ 010 public class EntityPortalEnterEvent extends EntityEvent { 011 private static final HandlerList handlers = new HandlerList(); 012 private final Location location; 013 014 public EntityPortalEnterEvent(final Entity entity, final Location location) { 015 super(entity); 016 this.location = location; 017 } 018 019 /** 020 * Gets the portal block the entity is touching 021 * 022 * @return The portal block the entity is touching 023 */ 024 public Location getLocation() { 025 return location; 026 } 027 028 @Override 029 public HandlerList getHandlers() { 030 return handlers; 031 } 032 033 public static HandlerList getHandlerList() { 034 return handlers; 035 } 036 }