public static interface DropItemStackEvent.Pre extends DropItemStackEvent, Cancellable
DropItemStackEvent.Drop, DropItemStackEvent.Post, DropItemStackEvent.Pre
Modifier and Type | Method and Description |
---|---|
void |
addItem(ItemStackSnapshot itemStackSnapshot)
Adds the provided
ItemStackSnapshot to the list of dropped
ItemStackTransaction s in getDroppedItems() . |
List<ItemStackSnapshot> |
filter(Predicate<ItemStackSnapshot> predicate)
Applies a
Predicate on the ItemStackSnapshot s such that
any ItemStackSnapshot that when Predicate.apply(Object)
returns false , the owning ItemStackTransaction is
marked as "invalid". |
List<ItemStackSnapshot> |
getDefaultDroppedItems()
Gets the list of
ItemStackSnapshot s to be dropped. |
List<ItemStackTransaction> |
getDroppedItems()
Gets the list of
ItemStackTransaction s of the ItemStack s
that will be dropped, if ItemStackTransaction.isValid() returns
true . |
getCallbacks
getCause
isCancelled, setCancelled
List<ItemStackSnapshot> getDefaultDroppedItems()
ItemStackSnapshot
s to be dropped.List<ItemStackTransaction> getDroppedItems()
ItemStackTransaction
s of the ItemStack
s
that will be dropped, if ItemStackTransaction.isValid()
returns
true
. If the transaction returns false
, the
ItemStackTransaction.getFinalSnapshot()
will not be dropped as
an Item
after this event.void addItem(ItemStackSnapshot itemStackSnapshot)
ItemStackSnapshot
to the list of dropped
ItemStackTransaction
s in getDroppedItems()
.itemStackSnapshot
- The item stack snapshot to addList<ItemStackSnapshot> filter(Predicate<ItemStackSnapshot> predicate)
Predicate
on the ItemStackSnapshot
s such that
any ItemStackSnapshot
that when Predicate.apply(Object)
returns false
, the owning ItemStackTransaction
is
marked as "invalid".predicate
- The predicate to apply to the list