Class InventoryUtilsKt
-
- All Implemented Interfaces:
public final class InventoryUtilsKt
-
-
Method Summary
Modifier and Type Method Description final static DropResult
addOrDrop(ItemStack $self, Inventory inventory, Boolean dropOverflow, Location location, Boolean naturally, Function1<Item, Unit> consumer)
Attempts to add all items to the inventory and drops the remaining items to the world. final static DropResult
addOrDrop(Inventory $self, ItemStack itemStack, Boolean dropOverflow, Location location, Boolean naturally, Function1<Item, Unit> consumer)
Attempts to add all items to the inventory and drops the remaining items to the world. final static Item
dropItem(World $self, Location location, ItemStack itemStack, Boolean naturally, Function1<Item, Unit> consumer)
final static Location
findLocation(Inventory $self)
-
-
Method Detail
-
addOrDrop
final static DropResult addOrDrop(ItemStack $self, Inventory inventory, Boolean dropOverflow, Location location, Boolean naturally, Function1<Item, Unit> consumer)
Attempts to add all items to the inventory and drops the remaining items to the world.
- Parameters:
inventory
- Inventory to add the items tolocation
- Location where the items should be dropped.naturally
- Whether the items should be dropped naturally or notconsumer
- Consumer for the spawned items- Returns:
The result of the operation
-
addOrDrop
final static DropResult addOrDrop(Inventory $self, ItemStack itemStack, Boolean dropOverflow, Location location, Boolean naturally, Function1<Item, Unit> consumer)
Attempts to add all items to the inventory and drops the remaining items to the world.
- Parameters:
itemStack
- Items to add to the inventorylocation
- Location where the items should be dropped.naturally
- Whether the items should be dropped naturally or notconsumer
- Consumer for the spawned items- Returns:
The result of the operation
-
dropItem
final static Item dropItem(World $self, Location location, ItemStack itemStack, Boolean naturally, Function1<Item, Unit> consumer)
-
findLocation
final static Location findLocation(Inventory $self)
-
-
-
-