Interface ChangeBlockEvent.All
- All Superinterfaces:
Cancellable
,ChangeBlockEvent
,Event
- Enclosing interface:
ChangeBlockEvent
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.event.block.ChangeBlockEvent
ChangeBlockEvent.All, ChangeBlockEvent.Post, ChangeBlockEvent.Pre
-
Method Summary
Modifier and TypeMethodDescriptiondefault List
<BlockTransaction> invalidate
(Predicate<ServerLocation> predicate) Applies the providedPredicate
to theList
ofTransaction
s fromtransactions()
such that any time thatPredicate.test(Object)
returnsfalse
on the location of theTransaction
, theTransaction
is marked as "invalid" and will not apply post event.default void
Invalidates the list as such that allTransaction
s are marked as "invalid" and will not apply post event.Gets a list of theTransaction
s for this event.default Stream
<BlockTransaction> transactions
(Operation operation) Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
Methods inherited from interface org.spongepowered.api.event.block.ChangeBlockEvent
world
-
Method Details
-
transactions
List<BlockTransaction> transactions()Gets a list of theTransaction
s for this event. If a transaction is requested to be marked as "invalid",Transaction.setValid(boolean)
can be used.- Returns:
- The unmodifiable list of transactions
-
transactions
Gets aStream
ofBlockTransactions
filtered by a particularblock operation
. The difference between this andtransactions()
is that while the general transactions is still an orderedList
, this is a filtered stream of that list, equally unmodifiable. Thetransactions
themselves are still modifiable withBlockTransaction#setCustom(BlockSnapshot)
, but altering the customized snapshot will NOT alter theOperation
being performed. As a logical perspective, there is no functional difference between any twooperations
, but it can be important to differentiate between the two in some contexts.- Parameters:
operation
- The operation being performed- Returns:
- The stream filtering on the given operation, may be empty
-
invalidate
Applies the providedPredicate
to theList
ofTransaction
s fromtransactions()
such that any time thatPredicate.test(Object)
returnsfalse
on the location of theTransaction
, theTransaction
is marked as "invalid" and will not apply post event.Transaction.original()
is used to get theServerLocation
- Parameters:
predicate
- The predicate to use for filtering- Returns:
- The transactions for which the predicate returned
false
-
invalidateAll
default void invalidateAll()Invalidates the list as such that allTransaction
s are marked as "invalid" and will not apply post event.
-