package net.knarcraft.stargate.event; import net.knarcraft.stargate.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 */ public class StargateOpenEvent extends StargatePlayerEvent { private boolean force; private static final HandlerList handlers = new HandlerList(); /** * 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 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; } /** * 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; } }