Class KonquestTownCaptureEvent
java.lang.Object
org.bukkit.event.Event
com.github.rumsfield.konquest.api.event.KonquestEvent
com.github.rumsfield.konquest.api.event.town.KonquestTownEvent
com.github.rumsfield.konquest.api.event.town.KonquestTownCaptureEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class KonquestTownCaptureEvent
extends KonquestTownEvent
implements org.bukkit.event.Cancellable
Called before an enemy player captures a town for their own kingdom.
Players capture towns for their kingdoms when they destroy the final critical block in the town monument. When a town is captured, it transfers ownership to the attacking player's kingdom. If the town is a capital, then the old kingdom will be removed, and the capital will be converted into a town for the new kingdom. Canceling this event will prevent the town from being captured, but the final critical block will still be broken.
After this event is cancelled, the town will remain un-captured, but all critical blocks will be broken. The monument will regenerate as normal after enemy players break the most recent monument block.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionKonquestTownCaptureEvent
(KonquestAPI konquest, KonquestTown town, KonquestPlayer player, KonquestKingdom newKingdom, boolean isCapital) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionGets the new kingdom that will control the town when it is captured.Gets the player that captured this town, and is now the town lord.boolean
boolean
Checks whether the town is a capital of the old kingdom.void
setCancelled
(boolean val) Methods inherited from class com.github.rumsfield.konquest.api.event.town.KonquestTownEvent
getTown
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
-
KonquestTownCaptureEvent
public KonquestTownCaptureEvent(KonquestAPI konquest, KonquestTown town, KonquestPlayer player, KonquestKingdom newKingdom, boolean isCapital) Default constructor- Parameters:
konquest
- The API instancetown
- The townplayer
- The playernewKingdom
- The town's new kingdomisCapital
- Whether the town was a capital
-
-
Method Details
-
getPlayer
Gets the player that captured this town, and is now the town lord.- Returns:
- The player
-
getNewKingdom
Gets the new kingdom that will control the town when it is captured.- Returns:
- The old kingdom
-
isCapital
public boolean isCapital()Checks whether the town is a capital of the old kingdom.- Returns:
- Whether the town is a capital
-
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
-