public class BreakBlockEvent extends DelegateEvent
Thrown when a block is broken.
| Constructor and Description |
|---|
BreakBlockEvent(org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.block.Block block) |
BreakBlockEvent(org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.Location target,
org.bukkit.Material effectiveMaterial) |
BreakBlockEvent(org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.World world,
List<org.bukkit.block.Block> blocks,
org.bukkit.Material effectiveMaterial) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
filter(com.google.common.base.Predicate<org.bukkit.Location> predicate)
Filter the list of affected blocks with the given predicate.
|
boolean |
filter(com.google.common.base.Predicate<org.bukkit.Location> predicate,
boolean cancelEventOnFalse)
Filter the list of affected blocks with the given predicate.
|
List<org.bukkit.block.Block> |
getBlocks()
Get the affected blocks.
|
org.bukkit.Material |
getEffectiveMaterial()
Get the effective material of the block, regardless of what the block
currently is.
|
org.bukkit.event.Event.Result |
getExplicitResult()
Get the actual result.
|
static org.bukkit.event.HandlerList |
getHandlerList() |
org.bukkit.event.HandlerList |
getHandlers() |
org.bukkit.event.Event.Result |
getResult() |
org.bukkit.World |
getWorld()
Get the world.
|
getCause, getOriginalEvent, getRelevantFlags, isCancelled, isSilent, setAllowed, setCancelled, setResult, setSilentpublic BreakBlockEvent(@Nullable org.bukkit.event.Event originalEvent, Cause cause, org.bukkit.World world, List<org.bukkit.block.Block> blocks, org.bukkit.Material effectiveMaterial)
public BreakBlockEvent(@Nullable org.bukkit.event.Event originalEvent, Cause cause, org.bukkit.block.Block block)
public org.bukkit.event.HandlerList getHandlers()
getHandlers in class org.bukkit.event.Eventpublic static org.bukkit.event.HandlerList getHandlerList()
public org.bukkit.World getWorld()
public List<org.bukkit.block.Block> getBlocks()
public boolean filter(com.google.common.base.Predicate<org.bukkit.Location> predicate,
boolean cancelEventOnFalse)
false, then the block is removed.predicate - the predicatecancelEventOnFalse - true to cancel the event and clear the block
list once the predicate returns falsepublic boolean filter(com.google.common.base.Predicate<org.bukkit.Location> predicate)
false, then the block is removed.
This method will not fail fast and
cancel the event the first instance that the predicate returns
false. See filter(Predicate, boolean) to adjust
this behavior.
predicate - the predicatepublic org.bukkit.Material getEffectiveMaterial()
public org.bukkit.event.Event.Result getResult()
getResult in interface HandleablegetResult in class DelegateEventpublic org.bukkit.event.Event.Result getExplicitResult()
BulkEventBy default, bulk events will set the result to DENY if the number of affected objects drops to zero. This method returns the true result.
getExplicitResult in interface BulkEventCopyright © 2015. All Rights Reserved.