public interface ChangeBlockEvent extends Event, Cancellable
BlockState
s at Location
s are being
changed.Modifier and Type | Interface and Description |
---|---|
static interface |
ChangeBlockEvent.Break
Called when
BlockState s at Location s are
being broke. |
static interface |
ChangeBlockEvent.Decay
Called when specific
BlockType s have a notion of "decaying"
for various reasons such that the changes are always caused by
themselves. |
static interface |
ChangeBlockEvent.Grow
Called when a
BlockType decides to "grow" either other
blocks or itself or both. |
static interface |
ChangeBlockEvent.Modify
Called when one or more
BlockType s are modified in the world. |
static interface |
ChangeBlockEvent.Place
Called when one or more
BlockType s are added to the world. |
static interface |
ChangeBlockEvent.Post
Called when there are multiple block changes due to a
BlockType having "ticked", in which the Cause will
have a BlockSnapshot , or, in the case that an Entity
has "ticked", in which the Cause will have an Entity ,
or, in the case that a TileEntity "ticked", the Cause
will have the TileEntity . |
static interface |
ChangeBlockEvent.Pre
Called before running specific block logic at one or more
Location 's such as BlockTypes.FLOWING_WATER . |
Modifier and Type | Method and Description |
---|---|
default List<Transaction<BlockSnapshot>> |
filter(Predicate<Location<World>> predicate)
Applies the provided
Predicate to the List of
Transaction s from getTransactions() such that
any time that Predicate.test(Object) returns false
on the location of the Transaction , the Transaction is
marked as "invalid" and will not apply post event. |
default void |
filterAll()
Invalidates the list as such that all
Transaction s are
marked as "invalid" and will not apply post event. |
List<Transaction<BlockSnapshot>> |
getTransactions()
Gets a list of the
Transaction s for this event. |
getCause, getContext, getSource
isCancelled, setCancelled
List<Transaction<BlockSnapshot>> getTransactions()
Transaction
s for this event. If a
transaction is requested to be marked as "invalid",
Transaction.setValid(boolean)
can be used.default List<Transaction<BlockSnapshot>> filter(Predicate<Location<World>> predicate)
Predicate
to the List
of
Transaction
s from getTransactions()
such that
any time that Predicate.test(Object)
returns false
on the location of the Transaction
, the Transaction
is
marked as "invalid" and will not apply post event.
Transaction.getOriginal()
is used to get the Location
predicate
- The predicate to use for filteringfalse
default void filterAll()
Transaction
s are
marked as "invalid" and will not apply post event.