Interface AffectSlotEvent
-
- All Superinterfaces:
AffectItemStackEvent,Cancellable,Event
- All Known Subinterfaces:
ChangeInventoryEvent,ChangeInventoryEvent.Drop,ChangeInventoryEvent.Drop.Full,ChangeInventoryEvent.Drop.Single,ChangeInventoryEvent.Held,ChangeInventoryEvent.Pickup,ChangeInventoryEvent.SwapHand,ClickContainerEvent,ClickContainerEvent.Creative,ClickContainerEvent.Creative.Drop,ClickContainerEvent.Creative.Set,ClickContainerEvent.Double,ClickContainerEvent.Drag,ClickContainerEvent.Drag.Middle,ClickContainerEvent.Drag.Primary,ClickContainerEvent.Drag.Secondary,ClickContainerEvent.Drop,ClickContainerEvent.Drop.Full,ClickContainerEvent.Drop.Outside,ClickContainerEvent.Drop.Outside.Primary,ClickContainerEvent.Drop.Outside.Secondary,ClickContainerEvent.Drop.Single,ClickContainerEvent.Middle,ClickContainerEvent.NumberPress,ClickContainerEvent.Primary,ClickContainerEvent.Recipe,ClickContainerEvent.Recipe.All,ClickContainerEvent.Recipe.Single,ClickContainerEvent.Secondary,ClickContainerEvent.SelectTrade,ClickContainerEvent.Shift,ClickContainerEvent.Shift.Primary,ClickContainerEvent.Shift.Secondary,CraftItemEvent,CraftItemEvent.Craft,CraftItemEvent.Preview,EnchantItemEvent.Post,InteractContainerEvent.Close
public interface AffectSlotEvent extends AffectItemStackEvent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default List<SlotTransaction>filter(Predicate<ItemStack> predicate)Applies the providedPredicateto theListofTransactions fromAffectItemStackEvent.transactions()such that any time thatPredicate.test(Object)returnsfalseon aTransaction, theTransactionis marked as "invalid" and will not apply post event.List<SlotTransaction>transactions()Gets a list of theTransactions for this event.-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
-
-
-
Method Detail
-
transactions
List<SlotTransaction> transactions()
Description copied from interface:AffectItemStackEventGets a list of theTransactions for this event. If a transaction is requested to be marked as "invalid",Transaction.setValid(boolean)can be used.- Specified by:
transactionsin interfaceAffectItemStackEvent- Returns:
- The unmodifiable list of transactions
-
filter
default List<SlotTransaction> filter(Predicate<ItemStack> predicate)
Description copied from interface:AffectItemStackEventApplies the providedPredicateto theListofTransactions fromAffectItemStackEvent.transactions()such that any time thatPredicate.test(Object)returnsfalseon aTransaction, theTransactionis marked as "invalid" and will not apply post event.Transaction.finalReplacement()is used to construct theItemStackto pass to the predicate- Specified by:
filterin interfaceAffectItemStackEvent- Parameters:
predicate- The predicate to use for filtering- Returns:
- The transactions for which the predicate returned
false
-
-