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
46 lines
1021 B
Java
46 lines
1021 B
Java
package net.knarcraft.stargate.event;
|
|
|
|
import net.knarcraft.stargate.portal.Portal;
|
|
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 {
|
|
|
|
private final Portal portal;
|
|
private boolean cancelled;
|
|
|
|
/**
|
|
* Instantiates a new stargate event
|
|
*
|
|
* @param portal <p>The portal involved in this stargate event</p>
|
|
*/
|
|
StargateEvent(Portal portal) {
|
|
this.portal = portal;
|
|
this.cancelled = false;
|
|
}
|
|
|
|
/**
|
|
* Gets the portal involved in this stargate event
|
|
*
|
|
* @return <p>The portal involved in this stargate event</p>
|
|
*/
|
|
public Portal getPortal() {
|
|
return portal;
|
|
}
|
|
|
|
@Override
|
|
public boolean isCancelled() {
|
|
return this.cancelled;
|
|
}
|
|
|
|
@Override
|
|
public void setCancelled(boolean cancelled) {
|
|
this.cancelled = cancelled;
|
|
}
|
|
|
|
}
|