package net.knarcraft.stargate.event; import net.knarcraft.stargate.portal.Portal; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; import java.util.List; /** * 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.

*/ @SuppressWarnings("unused") public class StargateActivateEvent extends StargatePlayerEvent { private static final HandlerList handlers = new HandlerList(); private List destinations; private String destination; /** * Instantiates a new stargate activate event * * @param portal

The activated portal

* @param player

The player activating the portal

* @param destinations

The destinations available to the player using the portal

* @param destination

The currently selected destination

*/ public StargateActivateEvent(Portal portal, Player player, List destinations, String destination) { super(portal, player); this.destinations = destinations; this.destination = destination; } /** * Gets the destinations available for the portal * * @return

The destinations available for the portal

*/ public List getDestinations() { return destinations; } /** * Sets the destinations available to the player using the portal * * @param destinations

The new list of available destinations

*/ public void setDestinations(List destinations) { this.destinations = destinations; } /** * Gets the selected destination * * @return

The selected destination

*/ public String getDestination() { return destination; } /** * Sets (changes) the selected destination * * @param destination

The new selected destination

*/ public void setDestination(String destination) { this.destination = destination; } /** * Gets a handler-list containing all event handlers * * @return

A handler-list with all event handlers

*/ public static HandlerList getHandlerList() { return handlers; } @Override @NotNull public HandlerList getHandlers() { return handlers; } }