Cancellable
public class PlayerPortalEvent extends PlayerTeleportEvent
For other entities see EntityPortalEvent
Event.Result
PlayerTeleportEvent.TeleportCause
player
Constructor | Description |
---|---|
PlayerPortalEvent(@NotNull Player player,
@NotNull Location from,
@Nullable Location to) |
|
PlayerPortalEvent(@NotNull Player player,
@NotNull Location from,
@Nullable Location to,
@NotNull PlayerTeleportEvent.TeleportCause cause) |
|
PlayerPortalEvent(@NotNull Player player,
@NotNull Location from,
@Nullable Location to,
@NotNull PlayerTeleportEvent.TeleportCause cause,
int getSearchRadius,
boolean canCreatePortal,
int creationRadius) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
getCanCreatePortal() |
Returns whether the server will attempt to create a destination portal or
not.
|
int |
getCreationRadius() |
Gets the maximum radius the world is searched for a free space from the
given location.
|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
int |
getSearchRadius() |
Gets the search radius value for finding an available portal.
|
void |
setCanCreatePortal(boolean canCreatePortal) |
Sets whether the server should attempt to create a destination portal or
not.
|
void |
setCreationRadius(int creationRadius) |
Sets the maximum radius the world is searched for a free space from the
given location.
|
void |
setSearchRadius(int searchRadius) |
Set the Block radius to search in for available portals.
|
callEvent, getEventName, isAsynchronous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPlayer
getFrom, getTo, isCancelled, setCancelled, setFrom, setTo
getCause
public PlayerPortalEvent(@NotNull @NotNull Player player, @NotNull @NotNull Location from, @Nullable @Nullable Location to)
public PlayerPortalEvent(@NotNull @NotNull Player player, @NotNull @NotNull Location from, @Nullable @Nullable Location to, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause)
public PlayerPortalEvent(@NotNull @NotNull Player player, @NotNull @NotNull Location from, @Nullable @Nullable Location to, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause, int getSearchRadius, boolean canCreatePortal, int creationRadius)
public void setSearchRadius(int searchRadius)
searchRadius
- the radius in which to search for a portal from the
locationpublic int getSearchRadius()
public boolean getCanCreatePortal()
public void setCanCreatePortal(boolean canCreatePortal)
canCreatePortal
- Sets whether there should be a destination portal
createdpublic void setCreationRadius(int creationRadius)
creationRadius
- the radius in which to create a portal from the
locationpublic int getCreationRadius()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class PlayerTeleportEvent
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2020. All rights reserved.