Adds nullability annotations for all methods Fixes some nullability problems and inconsistencies Gets rid of RelativeBlockVector's inner class Changes RelativeBlockVector to a record Simplifies FromTheEndTeleportation's storage, and makes it into a minimal record Removes the putStringInList method Gets rid of some primitive list usage Fixes some incorrect method accessibility Removes some redundancy in PortalOption
37 lines
898 B
Java
37 lines
898 B
Java
package net.knarcraft.stargate.event;
|
|
|
|
import net.knarcraft.stargate.portal.Portal;
|
|
import org.bukkit.entity.Player;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/**
|
|
* An abstract event describing any stargate event where a player is involved
|
|
*/
|
|
@SuppressWarnings("unused")
|
|
public abstract class StargatePlayerEvent extends StargateEvent {
|
|
|
|
private final Player player;
|
|
|
|
/**
|
|
* Instantiates a new stargate player event
|
|
*
|
|
* @param portal <p>The portal involved in this stargate event</p>
|
|
*/
|
|
StargatePlayerEvent(@NotNull Portal portal, @Nullable Player player) {
|
|
super(portal);
|
|
this.player = player;
|
|
}
|
|
|
|
/**
|
|
* Gets the player creating the star gate
|
|
*
|
|
* @return <p>The player creating the star gate</p>
|
|
*/
|
|
@Nullable
|
|
public Player getPlayer() {
|
|
return player;
|
|
}
|
|
|
|
}
|