2021-02-07 03:37:25 +01:00
|
|
|
package net.knarcraft.stargate.event;
|
|
|
|
|
2021-02-22 17:01:47 +01:00
|
|
|
import net.knarcraft.stargate.portal.Portal;
|
2021-02-07 03:37:25 +01:00
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An abstract event describing any stargate event
|
|
|
|
*/
|
|
|
|
@SuppressWarnings("unused")
|
|
|
|
public abstract class StargateEvent extends Event implements Cancellable {
|
|
|
|
|
2021-02-19 12:06:23 +01:00
|
|
|
private final Portal portal;
|
|
|
|
private boolean cancelled;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiates a new stargate event
|
2021-02-20 13:57:04 +01:00
|
|
|
*
|
|
|
|
* @param event <p>UNUSED</p>
|
2021-02-19 12:06:23 +01:00
|
|
|
* @param portal <p>The portal involved in this stargate event</p>
|
|
|
|
*/
|
|
|
|
StargateEvent(String event, Portal portal) {
|
2021-02-07 03:37:25 +01:00
|
|
|
this.portal = portal;
|
|
|
|
this.cancelled = false;
|
|
|
|
}
|
|
|
|
|
2021-02-19 12:06:23 +01:00
|
|
|
/**
|
|
|
|
* Gets the portal involved in this stargate event
|
2021-02-20 13:57:04 +01:00
|
|
|
*
|
2021-02-19 12:06:23 +01:00
|
|
|
* @return <p>The portal involved in this stargate event</p>
|
|
|
|
*/
|
2021-02-07 03:37:25 +01:00
|
|
|
public Portal getPortal() {
|
|
|
|
return portal;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return this.cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean cancelled) {
|
|
|
|
this.cancelled = cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|