Class KonquestTerritoryMoveEvent
java.lang.Object
org.bukkit.event.Event
com.github.rumsfield.konquest.api.event.KonquestEvent
com.github.rumsfield.konquest.api.event.territory.KonquestTerritoryMoveEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class KonquestTerritoryMoveEvent
extends KonquestEvent
implements org.bukkit.event.Cancellable
Called before a player enters or leaves a territory.
This only happens at chunk boundaries. The wild is not a territory, and is represented as a null territory field. When this event is cancelled, the player's movement will also be cancelled and they will be prevented from moving.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionKonquestTerritoryMoveEvent
(KonquestAPI konquest, KonquestTerritory territoryTo, KonquestTerritory territoryFrom, KonquestPlayer player) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionGet the player that moved between territories.Get the territory that the player is moving out of.Get the territory that the player is moving into.boolean
void
setCancelled
(boolean val) Methods inherited from class com.github.rumsfield.konquest.api.event.KonquestEvent
getHandlerList, getHandlers, getKonquest
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
KonquestTerritoryMoveEvent
public KonquestTerritoryMoveEvent(KonquestAPI konquest, KonquestTerritory territoryTo, KonquestTerritory territoryFrom, KonquestPlayer player) Default constructor- Parameters:
konquest
- The API instanceterritoryTo
- The territory moving toterritoryFrom
- The territory moving fromplayer
- The player
-
-
Method Details
-
getPlayer
Get the player that moved between territories.- Returns:
- The player
-
getTerritoryTo
Get the territory that the player is moving into. Returns null when moving into the wild.- Returns:
- The territory, or null when wild
-
getTerritoryFrom
Get the territory that the player is moving out of. Returns null when moving out of the wild.- Returns:
- The territory, or null when wild
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean val) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-