Class TownySwitchEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.actions.TownyActionEvent
com.palmergames.bukkit.towny.event.actions.TownySwitchEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Part of the API which lets Towny's war and other plugins modify Towny's
plot-permission-decision outcomes.
Switch event thrown when a player attempts to use a block that is in the
Towny config's switch_use_ids list. These are typically inventory blocks, or
toggle-able blocks like levers, doors, buttons.
- Author:
- LlmDl
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Field Summary
Fields inherited from class com.palmergames.bukkit.towny.event.actions.TownyActionEvent
loc, mat, player, townblock
-
Constructor Summary
ConstructorDescriptionTownySwitchEvent
(org.bukkit.entity.Player player, org.bukkit.Location loc, org.bukkit.Material mat, org.bukkit.block.Block block, TownBlock townblock, boolean cancelled) Switch event thrown when a player attempts to use a block that is in the Towny config's switch_use_ids list. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.Block
getBlock()
static org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
Methods inherited from class com.palmergames.bukkit.towny.event.actions.TownyActionEvent
getLocation, getMaterial, getPlayer, getTownBlock, hasTownBlock, isInWilderness, isMessageSuppressed, suppressMessage
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
-
TownySwitchEvent
public TownySwitchEvent(org.bukkit.entity.Player player, org.bukkit.Location loc, org.bukkit.Material mat, org.bukkit.block.Block block, TownBlock townblock, boolean cancelled) Switch event thrown when a player attempts to use a block that is in the Towny config's switch_use_ids list. These are typically inventory blocks, or toggle-able blocks like levers, doors, buttons. This will be thrown even if Towny has already decided to cancel the event, giving other plugins (and Towny's internal war system) the chance to modify the outcome. If you do not intend to un-cancel something already cancelled by Towny, use ignorecancelled=true in order to get only events which Towny will otherwise allow.- Parameters:
player
- involved in the switch event.loc
- location of the block which is being used.mat
- material of the block being used.block
- block being used.townblock
- - TownBlock or null if in the wilderness.cancelled
- true if Towny has already determined this will be cancelled.
-
-
Method Details
-
getBlock
public org.bukkit.block.Block getBlock() -
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-