public class NukkitInventory extends Object implements Inventory
| Modifier and Type | Field and Description |
|---|---|
protected NukkitInventoryType |
type |
| Constructor and Description |
|---|
NukkitInventory(NukkitInventoryType type) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addItem(ItemInstance item) |
boolean |
addItem(ItemInstance item,
PlayerSession session) |
void |
clearAll() |
void |
clearItem(int slot) |
ItemInstance[] |
getAllContents() |
int |
getEmptySlots() |
int |
getInventorySize() |
InventoryType |
getInventoryType() |
Optional<ItemInstance> |
getItem(int slot) |
Collection<InventoryObserver> |
getObservers() |
void |
setAllContents(ItemInstance[] contents) |
void |
setItem(int slot,
ItemInstance item) |
void |
setItem(int slot,
ItemInstance item,
PlayerSession session) |
protected final NukkitInventoryType type
public NukkitInventory(NukkitInventoryType type)
public Optional<ItemInstance> getItem(int slot)
public void setItem(int slot,
@Nullable
ItemInstance item)
public void setItem(int slot,
@Nullable
ItemInstance item,
PlayerSession session)
public boolean addItem(@Nonnull ItemInstance item)
public boolean addItem(ItemInstance item, PlayerSession session)
public int getEmptySlots()
getEmptySlots in interface Inventorypublic ItemInstance[] getAllContents()
getAllContents in interface Inventorypublic void setAllContents(@Nonnull ItemInstance[] contents)
setAllContents in interface Inventorypublic int getInventorySize()
getInventorySize in interface Inventorypublic InventoryType getInventoryType()
getInventoryType in interface Inventorypublic Collection<InventoryObserver> getObservers()
Copyright © 2017–2018 NukkitX. All rights reserved.