PortalEvent additions
This re-adds some of the functionality that the TravelAgent API provided previously By: Phoenix616 <mail@moep.tv>
This commit is contained in:
@@ -14,11 +14,36 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class EntityPortalEvent extends EntityTeleportEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private int searchRadius = 128;
|
||||
|
||||
public EntityPortalEvent(@NotNull final Entity entity, @NotNull final Location from, @Nullable final Location to) {
|
||||
super(entity, from, to);
|
||||
}
|
||||
|
||||
public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius) {
|
||||
super(entity, from, to);
|
||||
this.searchRadius = searchRadius;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Block radius to search in for available portals.
|
||||
*
|
||||
* @param searchRadius the radius in which to search for a portal from the
|
||||
* location
|
||||
*/
|
||||
public void setSearchRadius(int searchRadius) {
|
||||
this.searchRadius = searchRadius;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the search radius value for finding an available portal.
|
||||
*
|
||||
* @return the currently set search radius
|
||||
*/
|
||||
public int getSearchRadius() {
|
||||
return searchRadius;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
|
||||
Reference in New Issue
Block a user