Package com.plotsquared.core.events
Class PlayerTeleportToPlotEvent
java.lang.Object
com.plotsquared.core.events.PlotEvent
com.plotsquared.core.events.PlotPlayerEvent
com.plotsquared.core.events.PlayerTeleportToPlotEvent
- All Implemented Interfaces:
CancellablePlotEvent
Called when a player teleports to a plot
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerTeleportToPlotEvent(PlotPlayer<?> player, Location from, Plot plot, TeleportCause cause) PlayerTeleportToPlotEvent: Called when a player teleports to a plot -
Method Summary
Modifier and TypeMethodDescriptiongetCause()Get the teleport causegetFrom()Get the location, from where the teleport was triggered (the players current location when executing the home command for example)@Nullable UnaryOperator<Location>Gets the currently appliedtransformeror null, if none was setvoidvoidsetLocationTransformer(@Nullable UnaryOperator<Location> locationTransformer) Sets thetransformerto mutate the location where the player will be teleported to.Methods inherited from class com.plotsquared.core.events.PlotPlayerEvent
getPlotPlayerMethods inherited from class com.plotsquared.core.events.PlotEvent
getEventName, getPlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.plotsquared.core.events.CancellablePlotEvent
getEventResultRaw
-
Constructor Details
-
PlayerTeleportToPlotEvent
public PlayerTeleportToPlotEvent(PlotPlayer<?> player, Location from, Plot plot, TeleportCause cause) PlayerTeleportToPlotEvent: Called when a player teleports to a plot- Parameters:
player- That was teleportedfrom- The origin location, from where the teleport was triggered (players location most likely)plot- Plot to which the player was teleportedcause- Why the teleport is being completed- Since:
- 6.1.0
-
-
Method Details
-
getCause
Get the teleport cause- Returns:
- TeleportCause
- Since:
- 6.1.0
-
getFrom
Get the location, from where the teleport was triggered (the players current location when executing the home command for example)- Returns:
- Location
-
getLocationTransformer
Gets the currently appliedtransformeror null, if none was set- Returns:
- LocationTransformer
- Since:
- 7.2.1
-
setLocationTransformer
Sets thetransformerto mutate the location where the player will be teleported to. May benull, if any previous set transformations should be discarded.- Parameters:
locationTransformer- The new transformer- Since:
- 7.2.1
-
getEventResult
- Specified by:
getEventResultin interfaceCancellablePlotEvent
-
setEventResult
- Specified by:
setEventResultin interfaceCancellablePlotEvent
-