Package fr.fuzeblocks.homeplugin.event
Class OnEventAction
java.lang.Object
org.bukkit.event.Event
fr.fuzeblocks.homeplugin.event.OnEventAction
- All Implemented Interfaces:
- org.bukkit.event.Cancellable
- Direct Known Subclasses:
- OnHomeCreatedEvent,- OnHomeDeletedEvent,- OnHomeTeleportEvent,- OnRtpEvent,- OnSpawnCreatedEvent,- OnSpawnDeletedEvent,- OnSpawnTeleportEvent,- OnTeleportTaskCancelledEvent,- OnTpaAcceptedEvent,- OnTpaCreatedEvent,- OnTpaDeniedEvent
public class OnEventAction
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Base custom event for teleport-like actions.
 Provides explicit origin (from) and destination (to).
 getLocation() is retained for backward compatibility and returns the destination (to).
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.Eventorg.bukkit.event.Event.Result
- 
Constructor SummaryConstructorsConstructorDescriptionOnEventAction(TpaRequest tpaRequest) Convenience constructor for TPA events.OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location) Backward-compatible: 'location' is treated as the destination ("to").OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location, SyncMethod type) Backward-compatible: 'location' is treated as the destination ("to").OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location, SyncMethod type, String homeName) Backward-compatible: 'location' is treated as the destination ("to").OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location, String homeName) Backward-compatible: 'location' is treated as the destination ("to").OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to) Preferred constructor with explicit origin and destination (no type).OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, SyncMethod type) Preferred constructor with explicit origin and destination and optional type.OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, SyncMethod type, String homeName) Preferred constructor with explicit origin and destination, optional type, and home name.OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, String homeName) Preferred constructor with explicit origin and destination and home name (no type).
- 
Method SummaryModifier and TypeMethodDescriptionorg.bukkit.LocationgetFrom()Origin location (where the player came FROM).static org.bukkit.event.HandlerListGets handler list.org.bukkit.event.HandlerListGets home name.org.bukkit.LocationDeprecated.org.bukkit.entity.PlayerGets player.org.bukkit.LocationgetTo()Destination location (where the player is going TO).getType()Gets type.booleanvoidsetCancelled(boolean b) voidsetHomeName(String homeName) Sets home name.Methods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, SyncMethod type) Preferred constructor with explicit origin and destination and optional type.- Parameters:
- player- the player
- from- the from
- to- the to
- type- the type
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, SyncMethod type, String homeName) Preferred constructor with explicit origin and destination, optional type, and home name.- Parameters:
- player- the player
- from- the from
- to- the to
- type- the type
- homeName- the home name
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to) Preferred constructor with explicit origin and destination (no type).- Parameters:
- player- the player
- from- the from
- to- the to
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, String homeName) Preferred constructor with explicit origin and destination and home name (no type).- Parameters:
- player- the player
- from- the from
- to- the to
- homeName- the home name
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location, SyncMethod type) Backward-compatible: 'location' is treated as the destination ("to"). 'from' defaults to the player's current location at event creation time.- Parameters:
- player- the player
- location- the location
- type- the type
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location) Backward-compatible: 'location' is treated as the destination ("to"). 'from' defaults to the player's current location at event creation time.- Parameters:
- player- the player
- location- the location
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location, SyncMethod type, String homeName) Backward-compatible: 'location' is treated as the destination ("to"). 'from' defaults to the player's current location at event creation time.- Parameters:
- player- the player
- location- the location
- type- the type
- homeName- the home name
 
- 
OnEventActionpublic OnEventAction(org.bukkit.entity.Player player, org.bukkit.Location location, String homeName) Backward-compatible: 'location' is treated as the destination ("to"). 'from' defaults to the player's current location at event creation time.- Parameters:
- player- the player
- location- the location
- homeName- the home name
 
- 
OnEventActionConvenience constructor for TPA events. Sets 'from' to the sender's current location and 'to' to the target's current location.- Parameters:
- tpaRequest- the tpa request
 
 
- 
- 
Method Details- 
getHandlerListpublic static org.bukkit.event.HandlerList getHandlerList()Gets handler list.- Returns:
- the handler list
 
- 
getHandlerspublic org.bukkit.event.HandlerList getHandlers()- Specified by:
- getHandlersin class- org.bukkit.event.Event
 
- 
getPlayerpublic org.bukkit.entity.Player getPlayer()Gets player.- Returns:
- the player
 
- 
getFrompublic org.bukkit.Location getFrom()Origin location (where the player came FROM).- Returns:
- the from
 
- 
getTopublic org.bukkit.Location getTo()Destination location (where the player is going TO).- Returns:
- the to
 
- 
getLocationDeprecated.Backward-compatible getter for the destination. Prefer getTo() in new code.- Returns:
- the location
 
- 
getTypeGets type.- Returns:
- the type
 
- 
isCancelledpublic boolean isCancelled()- Specified by:
- isCancelledin interface- org.bukkit.event.Cancellable
 
- 
setCancelledpublic void setCancelled(boolean b) - Specified by:
- setCancelledin interface- org.bukkit.event.Cancellable
 
- 
getHomeNameGets home name.- Returns:
- the home name
 
- 
setHomeNameSets home name.- Parameters:
- homeName- the home name
 
 
-