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 attempts to access a stargate
*
* <p>This event can be used to override whether the player should be allowed to access the stargate.</p>
*/
@SuppressWarnings("unused")
public class StargateAccessEvent extends StargatePlayerEvent {
@ -17,25 +19,16 @@ public class StargateAccessEvent extends StargatePlayerEvent {
/**
* Instantiates a new stargate access event
*
* @param player <p>The player involved in the vent</p>
* @param player <p>The player involved in the event</p>
* @param portal <p>The portal involved in the event</p>
* @param deny <p>Whether the event should be denied</p>
* @param deny <p>Whether the stargate access should be denied</p>
*/
public StargateAccessEvent(Player player, Portal portal, boolean deny) {
super("StargateAccessEvent", portal, player);
super(portal, player);
this.deny = deny;
}
/**
* 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 player should be denied access
*
@ -46,14 +39,23 @@ public class StargateAccessEvent extends StargatePlayerEvent {
}
/**
* Sets whether to deny the player
* Sets whether to deny access to the player
*
* @param deny <p>Whether to deny the player</p>
* @param deny <p>Whether to deny access to the player</p>
*/
public void setDeny(boolean deny) {
this.deny = deny;
}
/**
* 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() {