@ThreadSafe public class TridentInventory extends Object implements Inventory
Constructor and Description |
---|
TridentInventory(int length)
Builds a new inventory inventory
|
TridentInventory(int length,
int id) |
Modifier and Type | Method and Description |
---|---|
void |
close(Player player,
boolean force) |
static TridentInventory |
create(String name,
int length,
InventoryType type) |
int |
id()
Obtains the ID of the inventory
|
Item |
itemAt(int slot)
Finds the item at the specified slot in the inventory
|
int |
itemLength() |
Item[] |
items()
Obtains the contents of the inventory represented by this inventory
|
int |
length()
The available slots (not the slots taken up) in this inventory
|
String |
name()
The title of the inventory
|
boolean |
putItem(Item item)
Places an item into the player's inventory, where there is room
|
void |
sendTo(TridentPlayer player) |
void |
setSlot(int index,
Item value)
Sets the item at the slot.
|
public TridentInventory(int length)
length
- the amount of slots in the inventory (should be multiple of 9)public TridentInventory(int length, int id)
public static TridentInventory create(String name, int length, InventoryType type)
public Item[] items()
Inventory
public int length()
Inventory
public int itemLength()
public Item itemAt(int slot)
Inventory
public void setSlot(int index, Item value)
Inventory
public boolean putItem(Item item)
Inventory
public void sendTo(TridentPlayer player)
Copyright © 2016. All rights reserved.