Adds comments to all custom events

Adds full comments to every class implementing StarGateEvent
Adds another abstract event StargatePlayerEvent which reduces code duplication
This commit is contained in:
2021-02-19 12:06:23 +01:00
parent 5b7f5649b1
commit c912624df1
10 changed files with 344 additions and 173 deletions

View File

@ -4,33 +4,59 @@ import net.knarcraft.stargate.Portal;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* This event should be called whenever a stargate is closed
*/
@SuppressWarnings("unused")
public class StargateCloseEvent extends StargateEvent {
private boolean force;
private static final HandlerList handlers = new HandlerList();
@NotNull
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Instantiates a new stargate closing event
*
* @param portal <p>The portal to close</p>
* @param force <p>Whether to force the gate to close, even if set as always-on</p>
*/
public StargateCloseEvent(Portal portal, boolean force) {
super("StargateCloseEvent", portal);
this.force = force;
}
/**
* Gets whether to force the stargate to close
*
* @return <p>Whether to force the stargate to close</p>
*/
public boolean getForce() {
return force;
}
/**
* Sets whether the stargate should be forced to close
*
* @param force <p>Whether the stargate should be forced to close</p>
*/
public void setForce(boolean force) {
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;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
}