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 java.util.List<SlotTransaction>
filter(java.util.function.Predicate<ItemStack> predicate)
Applies the providedPredicate
to theList
ofTransaction
s fromAffectItemStackEvent.transactions()
such that any time thatPredicate.test(Object)
returnsfalse
on aTransaction
, theTransaction
is marked as "invalid" and will not apply post event.java.util.List<SlotTransaction>
transactions()
Gets a list of theTransaction
s for this event.-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
-
-
-
Method Detail
-
transactions
java.util.List<SlotTransaction> transactions()
Description copied from interface:AffectItemStackEvent
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.- Specified by:
transactions
in interfaceAffectItemStackEvent
- Returns:
- The unmodifiable list of transactions
-
filter
default java.util.List<SlotTransaction> filter(java.util.function.Predicate<ItemStack> predicate)
Description copied from interface:AffectItemStackEvent
Applies the providedPredicate
to theList
ofTransaction
s fromAffectItemStackEvent.transactions()
such that any time thatPredicate.test(Object)
returnsfalse
on aTransaction
, theTransaction
is marked as "invalid" and will not apply post event.Transaction.finalReplacement()
is used to construct theItemStack
to pass to the predicate- Specified by:
filter
in interfaceAffectItemStackEvent
- Parameters:
predicate
- The predicate to use for filtering- Returns:
- The transactions for which the predicate returned
false
-
-