Class NationSpawnEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.SpawnEvent
com.palmergames.bukkit.towny.event.NationSpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
An event called when nation spawns occur.
- Author:
- Suneet Tipirneni (Siris)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionNationSpawnEvent
(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, boolean cancelled, String cancelMessage) Called when a player is teleported to a nation. -
Method Summary
Modifier and TypeMethodDescription@Nullable Nation
Gets the nation the player is spawning from.static org.bukkit.event.HandlerList
@NotNull org.bukkit.event.HandlerList
Gets the nation that the player to spawning to.Methods inherited from class com.palmergames.bukkit.towny.event.SpawnEvent
getFrom, getPlayer, getTo
Methods inherited from class com.palmergames.bukkit.towny.event.CancellableTownyEvent
getCancelMessage, isCancelled, setCancelled, setCancelMessage
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
NationSpawnEvent
public NationSpawnEvent(org.bukkit.entity.Player player, org.bukkit.Location from, org.bukkit.Location to, boolean cancelled, String cancelMessage) Called when a player is teleported to a nation.- Parameters:
player
- The player being teleported.from
- The location the player is teleporting from.to
- The location the player is going to.
-
-
Method Details
-
getToNation
Gets the nation that the player to spawning to.- Returns:
- The nation being spawned to.
-
getFromNation
Gets the nation the player is spawning from.- Returns:
- null if the player is not standing in a nation owned townblock, the nation otherwise.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Overrides:
getHandlers
in classSpawnEvent
-