public interface ChangeBlockEvent extends Event, Cancellable
BlockStates at Locations are being
changed.| Modifier and Type | Interface and Description |
|---|---|
static interface |
ChangeBlockEvent.Break
Called when
BlockStates at Locations are
being broke. |
static interface |
ChangeBlockEvent.Decay
Called when specific
BlockTypes 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
BlockTypes are modified in the world. |
static interface |
ChangeBlockEvent.Place
Called when one or more
BlockTypes 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
Transactions 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
Transactions are
marked as "invalid" and will not apply post event. |
List<Transaction<BlockSnapshot>> |
getTransactions()
Gets a list of the
Transactions for this event. |
getCause, getContext, getSourceisCancelled, setCancelledList<Transaction<BlockSnapshot>> getTransactions()
Transactions 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
Transactions 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 filteringfalsedefault void filterAll()
Transactions are
marked as "invalid" and will not apply post event.