public interface AffectItemStackEvent extends Event, Cancellable
Modifier and Type | Method and Description |
---|---|
default List<? extends Transaction<ItemStackSnapshot>> |
filter(Predicate<ItemStack> predicate)
Applies the provided
Predicate to the List of
Transaction s from getTransactions() such that
any time that Predicate.test(Object) returns false
on a Transaction , the Transaction is
marked as "invalid" and will not apply post event. |
List<? extends Transaction<ItemStackSnapshot>> |
getTransactions()
Gets a list of the
Transaction s for this event. |
getCause, getContext, getSource
isCancelled, setCancelled
List<? extends Transaction<ItemStackSnapshot>> getTransactions()
Transaction
s for this event. If a
transaction is requested to be marked as "invalid",
Transaction.setValid(boolean)
can be used.default List<? extends Transaction<ItemStackSnapshot>> filter(Predicate<ItemStack> predicate)
Predicate
to the List
of
Transaction
s from getTransactions()
such that
any time that Predicate.test(Object)
returns false
on a Transaction
, the Transaction
is
marked as "invalid" and will not apply post event.
Transaction.getFinal()
is used to construct
the ItemStack
to pass to the predicate
predicate
- The predicate to use for filteringfalse