Adds comments and simplifies some of the code

Adds a PortalOption enum to simplify portal options
Adds a BungeeHelper class to collect the bungee-related code
This commit is contained in:
2021-02-20 13:57:04 +01:00
parent 2ae4fc9645
commit 1721750aa1
29 changed files with 1499 additions and 1206 deletions

View File

@ -11,46 +11,49 @@ import org.jetbrains.annotations.NotNull;
@SuppressWarnings("unused")
public class StargateAccessEvent extends StargatePlayerEvent {
private boolean deny;
private static final HandlerList handlers = new HandlerList();
private static final HandlerList handlers = new HandlerList();
private boolean deny;
/**
* Instantiates a new stargate access event
*
* @param player <p>The player involved in the vent</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 event should be denied</p>
*/
public StargateAccessEvent(Player player, Portal portal, boolean deny) {
super("StargateAccessEvent", portal, player);
public StargateAccessEvent(Player player, Portal portal, boolean deny) {
super("StargateAccessEvent", portal, player);
this.deny = deny;
}
/**
* Gets whether the player should be denied access
* @return <p>Whether the player should be denied access</p>
*/
public boolean getDeny() {
return this.deny;
}
/**
* Sets whether to deny the player
* @param deny <p>Whether to deny the player</p>
*/
public void setDeny(boolean deny) {
this.deny = 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;
}
/**
* Gets whether the player should be denied access
*
* @return <p>Whether the player should be denied access</p>
*/
public boolean getDeny() {
return this.deny;
}
/**
* Sets whether to deny the player
*
* @param deny <p>Whether to deny the player</p>
*/
public void setDeny(boolean deny) {
this.deny = deny;
}
@Override
@NotNull
public HandlerList getHandlers() {