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 ListThe activated portal
* @param playerThe player activating the portal
* @param destinationsThe destinations available to the player using the portal
* @param destinationThe currently selected destination
*/ public StargateActivateEvent(Portal portal, Player player, ListThe destinations available for the portal
*/ public ListThe new list of available destinations
*/ public void setDestinations(ListThe selected destination
*/ public String getDestination() { return destination; } /** * Sets (changes) the selected destination * * @param destinationThe new selected destination
*/ public void setDestination(String destination) { this.destination = destination; } /** * Gets a handler-list containing all event handlers * * @returnA handler-list with all event handlers
*/ public static HandlerList getHandlerList() { return handlers; } @Override @NotNull public HandlerList getHandlers() { return handlers; } }