public class PlayerPortalEvent extends PlayerTeleportEvent
For other entities see EntityPortalEvent
PlayerTeleportEvent.TeleportCause
Event.Result
Modifier and Type | Field and Description |
---|---|
protected TravelAgent |
travelAgent |
protected boolean |
useTravelAgent |
player
Constructor and Description |
---|
PlayerPortalEvent(Player player,
Location from,
Location to,
TravelAgent pta) |
PlayerPortalEvent(Player player,
Location from,
Location to,
TravelAgent pta,
PlayerTeleportEvent.TeleportCause cause) |
Modifier and Type | Method and Description |
---|---|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
TravelAgent |
getPortalTravelAgent()
Gets the Travel Agent used (or not) in this event.
|
void |
setPortalTravelAgent(TravelAgent travelAgent)
Sets the Travel Agent used (or not) in this event.
|
boolean |
useTravelAgent()
Gets whether or not the Travel Agent will be used.
|
void |
useTravelAgent(boolean useTravelAgent)
Sets whether or not the Travel Agent will be used.
|
getCause
getFrom, getTo, isCancelled, setCancelled, setFrom, setTo
getPlayer
getEventName, isAsynchronous
protected boolean useTravelAgent
protected TravelAgent travelAgent
public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta)
public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta, PlayerTeleportEvent.TeleportCause cause)
public void useTravelAgent(boolean useTravelAgent)
If this is set to true, the TravelAgent will try to find a Portal at
the PlayerMoveEvent.getTo()
Location, and will try to create one if there is
none.
If this is set to false, the PlayerEvent.getPlayer()
will only be
teleported to the PlayerMoveEvent.getTo()
Location.
useTravelAgent
- whether to use the Travel Agentpublic boolean useTravelAgent()
If this is set to true, the TravelAgent will try to find a Portal at
the PlayerMoveEvent.getTo()
Location, and will try to create one if there is
none.
If this is set to false, the PlayerEvent.getPlayer()
} will only be
teleported to the PlayerMoveEvent.getTo()
Location.
public TravelAgent getPortalTravelAgent()
public void setPortalTravelAgent(TravelAgent travelAgent)
travelAgent
- the Travel Agent used (or not) in this eventpublic HandlerList getHandlers()
getHandlers
in class PlayerTeleportEvent
public static HandlerList getHandlerList()
Copyright © 2014. All rights reserved.