public interface AffectSlotEvent extends AffectItemStackEvent
Modifier and Type | Method and Description |
---|---|
default List<SlotTransaction> |
filter(Predicate<ItemStack> predicate)
Applies the provided
Predicate to the List of
Transaction s from AffectItemStackEvent.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<SlotTransaction> |
getTransactions()
Gets a list of the
Transaction s for this event. |
getCause, getContext, getSource
isCancelled, setCancelled
List<SlotTransaction> getTransactions()
AffectItemStackEvent
Transaction
s for this event. If a
transaction is requested to be marked as "invalid",
Transaction.setValid(boolean)
can be used.getTransactions
in interface AffectItemStackEvent
default List<SlotTransaction> filter(Predicate<ItemStack> predicate)
AffectItemStackEvent
Predicate
to the List
of
Transaction
s from AffectItemStackEvent.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
filter
in interface AffectItemStackEvent
predicate
- The predicate to use for filteringfalse