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 portalThe portal opened
* @param forceWhether 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 * * @returnA handler-list with all event handlers
*/ public static HandlerList getHandlerList() { return handlers; } /** * Gets whether the portal should be forced open * * @returnWhether the portal should be forced open
*/ public boolean getForce() { return force; } /** * Sets whether the portal should be forced open * * @param forceWhether the portal should be forced open
*/ public void setForce(boolean force) { this.force = force; } @Override @NotNull public HandlerList getHandlers() { return handlers; } }