Class StargateOpenPortalEvent
java.lang.Object
org.bukkit.event.Event
org.sgrewritten.stargate.api.event.portal.StargatePortalEvent
org.sgrewritten.stargate.api.event.portal.StargateEntityPortalEvent
org.sgrewritten.stargate.api.event.portal.StargateOpenPortalEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class StargateOpenPortalEvent
extends StargateEntityPortalEvent
implements org.bukkit.event.Cancellable
This event should be called whenever a player opens a stargate
This event can be used to overwrite whether the stargate should be forced to open, even if it's already open.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionStargateOpenPortalEvent
(org.bukkit.entity.Player player, @NotNull Portal portal, @Nullable Portal destination, boolean cancelled, boolean force) Instantiates a new stargate open event -
Method Summary
Modifier and TypeMethodDescription@Nullable Portal
boolean
getForce()
Gets whether the portal should be forced openstatic org.bukkit.event.HandlerList
Gets a handler-list containing all event handlers@NotNull org.bukkit.event.HandlerList
boolean
void
setCancelled
(boolean cancelled) void
setDestination
(Portal destination) void
setForce
(boolean force) Sets whether the portal should be forced openMethods inherited from class org.sgrewritten.stargate.api.event.portal.StargateEntityPortalEvent
getEntity
Methods inherited from class org.sgrewritten.stargate.api.event.portal.StargatePortalEvent
getPortal
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
StargateOpenPortalEvent
public StargateOpenPortalEvent(org.bukkit.entity.Player player, @NotNull @NotNull Portal portal, @Nullable @Nullable Portal destination, boolean cancelled, boolean force) Instantiates a new stargate open event- Parameters:
player
-The player opening the stargate
portal
-The opened portal
force
-Whether to force the portal open
-
-
Method Details
-
getForce
public boolean getForce()Gets whether the portal should be forced open- Returns:
Whether the portal should be forced open
-
setForce
public void setForce(boolean force) Sets whether the portal should be forced open- Parameters:
force
-Whether the portal should be forced open
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets a handler-list containing all event handlers- Returns:
A handler-list with all event handlers
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getDestination
-
setDestination
-