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; /** * This event should be called whenever a player opens a stargate */ @SuppressWarnings({"unused"}) public class StargateOpenEvent extends StargatePlayerEvent { private static final HandlerList handlers = new HandlerList(); private boolean force; /** * Instantiates a new stargate open event * * @param player

The player opening the stargate

* @param portal

The portal opened

* @param force

Whether to force the portal open

*/ public StargateOpenEvent(Player player, Portal portal, boolean force) { super("StargateOpenEvent", portal, player); this.force = force; } /** * Gets a handler-list containing all event handlers * * @return

A handler-list with all event handlers

*/ public static HandlerList getHandlerList() { return handlers; } /** * Gets whether the portal should be forced open * * @return

Whether the portal should be forced open

*/ public boolean getForce() { return force; } /** * Sets whether the portal should be forced open * * @param force

Whether the portal should be forced open

*/ public void setForce(boolean force) { this.force = force; } @Override @NotNull public HandlerList getHandlers() { return handlers; } }