Improves comments for Stargate events, and adds a new event for teleporting entities

Adds information about what events can be used for
Tries to clarify event comments where possible
Renames The StargatePortalEvent to StargatePlayerPortalEvent
Adds StargateEntityPortalEvent
Makes the StargateEntityPortalEvent trigger whenever a vehicle is teleported
Removes the unused event name for all events
This commit is contained in:
2021-10-13 15:45:15 +02:00
parent 0ab6cb52c0
commit bf7a10636e
14 changed files with 223 additions and 104 deletions

View File

@ -7,6 +7,8 @@ import org.jetbrains.annotations.NotNull;
/**
* This event should be called whenever a player opens a stargate
*
* <p>This event can be used to overwrite whether the stargate should be forced to open, even if it's already open.</p>
*/
@SuppressWarnings({"unused"})
public class StargateOpenEvent extends StargatePlayerEvent {
@ -18,24 +20,15 @@ public class StargateOpenEvent extends StargatePlayerEvent {
* Instantiates a new stargate open event
*
* @param player <p>The player opening the stargate</p>
* @param portal <p>The portal opened</p>
* @param portal <p>The opened portal</p>
* @param force <p>Whether to force the portal open</p>
*/
public StargateOpenEvent(Player player, Portal portal, boolean force) {
super("StargateOpenEvent", portal, player);
super(portal, player);
this.force = force;
}
/**
* Gets a handler-list containing all event handlers
*
* @return <p>A handler-list with all event handlers</p>
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Gets whether the portal should be forced open
*
@ -54,6 +47,15 @@ public class StargateOpenEvent extends StargatePlayerEvent {
this.force = force;
}
/**
* Gets a handler-list containing all event handlers
*
* @return <p>A handler-list with all event handlers</p>
*/
public static HandlerList getHandlerList() {
return handlers;
}
@Override
@NotNull
public HandlerList getHandlers() {