public class PlaceBlockEvent extends DelegateEvent
Thrown when a block is placed.
| Constructor and Description |
|---|
PlaceBlockEvent(org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.block.Block block) |
PlaceBlockEvent(org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.Location target,
org.bukkit.Material effectiveMaterial) |
PlaceBlockEvent(org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.World world,
java.util.List<org.bukkit.block.Block> blocks,
org.bukkit.Material effectiveMaterial) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
filter(java.util.function.Predicate<org.bukkit.Location> predicate)
Filter the list of affected blocks with the given predicate.
|
boolean |
filter(java.util.function.Predicate<org.bukkit.Location> predicate,
boolean cancelEventOnFalse)
Filter the list of affected blocks with the given predicate.
|
java.util.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 PlaceBlockEvent(@Nullable
org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.World world,
java.util.List<org.bukkit.block.Block> blocks,
org.bukkit.Material effectiveMaterial)
public PlaceBlockEvent(@Nullable
org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.block.Block block)
public PlaceBlockEvent(@Nullable
org.bukkit.event.Event originalEvent,
Cause cause,
org.bukkit.Location target,
org.bukkit.Material effectiveMaterial)
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 java.util.List<org.bukkit.block.Block> getBlocks()
public boolean filter(java.util.function.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(java.util.function.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 BulkEvent