public interface AffectItemStackEvent extends TargetInventoryEvent, Cancellable, CauseTracked
Modifier and Type | Method and Description |
---|---|
default List<Transaction<ItemStackSnapshot>> |
filter(java.util.function.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<Transaction<ItemStackSnapshot>> |
getTransactions()
Gets a list of the
Transaction s for this event. |
getTargetInventory
isCancelled, setCancelled
getCause
List<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<Transaction<ItemStackSnapshot>> filter(java.util.function.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