Class TownyActionEvent
java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.actions.TownyActionEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
- Direct Known Subclasses:
TownyBuildEvent
,TownyDestroyEvent
,TownyItemuseEvent
,TownySwitchEvent
Used by the TownyBuildEvent, TownyDestroyEvent, TownySwitchEvent
and TownyItemuseEvent. Part of the API which lets Towny's war and
other plugins modify Towny's plot-permission-decision outcomes.
- Author:
- LlmDl
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTownyActionEvent
(org.bukkit.entity.Player player, org.bukkit.Location loc, org.bukkit.Material mat, TownBlock townblock, boolean cancelled) -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Location
org.bukkit.Material
org.bukkit.entity.Player
@Nullable TownBlock
TheTownBlock
this action occured in, or null if in the wilderness.boolean
Did this action occur inside of a town's townblock?boolean
Did this action occur in the wilderness?boolean
void
Methods inherited from class com.palmergames.bukkit.towny.event.CancellableTownyEvent
getCancelMessage, isCancelled, setCancelled, setCancelMessage
Methods inherited from class org.bukkit.event.Event
getEventName, getHandlers, isAsynchronous
-
Field Details
-
player
protected final org.bukkit.entity.Player player -
loc
protected final org.bukkit.Location loc -
mat
protected final org.bukkit.Material mat -
townblock
-
-
Constructor Details
-
TownyActionEvent
public TownyActionEvent(org.bukkit.entity.Player player, org.bukkit.Location loc, org.bukkit.Material mat, TownBlock townblock, boolean cancelled)
-
-
Method Details
-
isMessageSuppressed
public boolean isMessageSuppressed() -
suppressMessage
public void suppressMessage() -
getMaterial
public org.bukkit.Material getMaterial()- Returns:
- Material of the block being built.
-
getLocation
public org.bukkit.Location getLocation()- Returns:
- Location of the block being built.
-
getPlayer
public org.bukkit.entity.Player getPlayer()- Returns:
- player involved in the build event.
-
getTownBlock
TheTownBlock
this action occured in, or null if in the wilderness.- Returns:
- TownBlock or null.
-
isInWilderness
public boolean isInWilderness()Did this action occur in the wilderness?- Returns:
- return true if this was in the wilderness.
-
hasTownBlock
public boolean hasTownBlock()Did this action occur inside of a town's townblock?- Returns:
- true if this has a townblock.
-