Class StargateActivatePortalEvent
java.lang.Object
org.bukkit.event.Event
org.sgrewritten.stargate.api.event.portal.StargatePortalEvent
org.sgrewritten.stargate.api.event.portal.StargateEntityPortalEvent
org.sgrewritten.stargate.api.event.portal.StargateActivatePortalEvent
This event should be called whenever a player activates a stargate
Activation of a stargate happens when a player right-clicks the sign of a stargate. This event can be used to overwrite the selected destination, and all destinations the player can see.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionStargateActivatePortalEvent(@NotNull Portal portal, @NotNull org.bukkit.entity.Entity entity, @NotNull List<String> destinations, String destination) Instantiates a new stargate activate event -
Method Summary
Modifier and TypeMethodDescriptionGets the selected destinationGets the destinations available for the portalstatic org.bukkit.event.HandlerListGets a handler-list containing all event handlers@NotNull org.bukkit.event.HandlerListvoidsetDestination(String destination) Sets (changes) the selected destinationvoidsetDestinations(@NotNull List<String> destinations) Sets the destinations available to the player using the portalMethods inherited from class org.sgrewritten.stargate.api.event.portal.StargateEntityPortalEvent
getEntityMethods inherited from class org.sgrewritten.stargate.api.event.portal.StargatePortalEvent
getPortalMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
StargateActivatePortalEvent
public StargateActivatePortalEvent(@NotNull @NotNull Portal portal, @NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull List<String> destinations, String destination) Instantiates a new stargate activate event- Parameters:
portal-The activated portal
entity-The entity activating the portal
destinations-The destinations available to the player using the portal
destination-The currently selected destination
-
-
Method Details
-
getDestinations
Gets the destinations available for the portal- Returns:
The destinations available for the portal
-
setDestinations
Sets the destinations available to the player using the portal- Parameters:
destinations-The new list of available destinations
-
getDestination
Gets the selected destination- Returns:
The selected destination
-
setDestination
Sets (changes) the selected destination- Parameters:
destination-The new selected destination
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets a handler-list containing all event handlers- Returns:
A handler-list with all event handlers
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-