public class PlayerInventory extends BaseInventory
| Modifier and Type | Field and Description |
|---|---|
protected int |
itemInHandIndex |
static int |
SURVIVAL_SLOTS |
holder, maxStackSize, name, size, slots, title, type, viewers| Constructor and Description |
|---|
PlayerInventory(Human player) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
clear(int index,
boolean send) |
void |
clearAll() |
boolean |
equipItem(int slot)
Called when a client equips a hotbar inventorySlot.
|
Item[] |
getArmorContents() |
Item |
getArmorItem(int index) |
Item |
getBoots() |
Item |
getChestplate() |
int |
getHeldItemIndex() |
int |
getHeldItemSlot()
Deprecated.
|
Item |
getHelmet() |
Human |
getHolder() |
int |
getHotbarSize() |
int |
getHotbarSlotIndex(int index)
Deprecated.
|
Item |
getItemInHand() |
Item |
getLeggings() |
Item |
getOffHand() |
int |
getSize() |
void |
onClose(Player who) |
void |
onOpen(Player who) |
void |
onSlotChange(int index,
Item before,
boolean send) |
void |
sendArmorContents(Collection<Player> players) |
void |
sendArmorContents(Player player) |
void |
sendArmorContents(Player[] players) |
void |
sendArmorSlot(int index,
Collection<Player> players) |
void |
sendArmorSlot(int index,
Player player) |
void |
sendArmorSlot(int index,
Player[] players) |
void |
sendContents(Collection<Player> players) |
void |
sendContents(Player player) |
void |
sendContents(Player[] players) |
void |
sendCreativeContents() |
void |
sendHeldItem(Collection<Player> players) |
void |
sendHeldItem(Player... players) |
void |
sendOffHandContents(Collection<Player> players) |
void |
sendOffHandContents(Player player) |
void |
sendOffHandContents(Player[] players) |
void |
sendOffHandSlot(Collection<Player> players) |
void |
sendOffHandSlot(Player player) |
void |
sendOffHandSlot(Player[] players) |
void |
sendSlot(int index,
Collection<Player> players) |
void |
sendSlot(int index,
Player... players) |
void |
sendSlot(int index,
Player player) |
void |
setArmorContents(Item[] items) |
boolean |
setArmorItem(int index,
Item item) |
boolean |
setArmorItem(int index,
Item item,
boolean ignoreArmorEvents) |
boolean |
setBoots(Item boots) |
boolean |
setChestplate(Item chestplate) |
void |
setHeldItemIndex(int index) |
void |
setHeldItemIndex(int index,
boolean send) |
void |
setHeldItemSlot(int slot) |
boolean |
setHelmet(Item helmet) |
void |
setHotbarSlotIndex(int index,
int slot)
Deprecated.
|
boolean |
setItem(int index,
Item item) |
boolean |
setItemInHand(Item item) |
boolean |
setLeggings(Item leggings) |
void |
setOffHandContents(Item offhand) |
void |
setSize(int size) |
addItem, all, canAddItem, close, contains, decreaseCount, first, firstEmpty, firstFit, firstNonEmpty, getContents, getFreeSpace, getItem, getMaxStackSize, getName, getTitle, getType, getViewers, increaseCount, isEmpty, isFull, open, remove, removeItem, setContents, setItem, setMaxStackSizepublic static final int SURVIVAL_SLOTS
protected int itemInHandIndex
public PlayerInventory(Human player)
public int getSize()
getSize in interface InventorygetSize in class BaseInventorypublic void setSize(int size)
setSize in class BaseInventorypublic boolean equipItem(int slot)
slot - hotbar slot Number of the hotbar slot to equip.@Deprecated public int getHotbarSlotIndex(int index)
@Deprecated public void setHotbarSlotIndex(int index, int slot)
public int getHeldItemIndex()
public void setHeldItemIndex(int index)
public void setHeldItemIndex(int index,
boolean send)
public Item getItemInHand()
public boolean setItemInHand(Item item)
@Deprecated public int getHeldItemSlot()
public void setHeldItemSlot(int slot)
public void sendHeldItem(Player... players)
public void sendHeldItem(Collection<Player> players)
public void onSlotChange(int index,
Item before,
boolean send)
onSlotChange in interface InventoryonSlotChange in class BaseInventorypublic int getHotbarSize()
public Item getArmorItem(int index)
public boolean setArmorItem(int index,
Item item)
public boolean setArmorItem(int index,
Item item,
boolean ignoreArmorEvents)
public Item getHelmet()
public Item getChestplate()
public Item getLeggings()
public Item getBoots()
public boolean setHelmet(Item helmet)
public boolean setChestplate(Item chestplate)
public boolean setLeggings(Item leggings)
public boolean setBoots(Item boots)
public boolean setItem(int index,
Item item)
public boolean clear(int index,
boolean send)
clear in interface Inventoryclear in class BaseInventorypublic Item[] getArmorContents()
public void clearAll()
clearAll in interface InventoryclearAll in class BaseInventorypublic Item getOffHand()
public void setOffHandContents(Item offhand)
public void sendOffHandContents(Collection<Player> players)
public void sendOffHandContents(Player player)
public void sendOffHandContents(Player[] players)
public void sendOffHandSlot(Player player)
public void sendOffHandSlot(Collection<Player> players)
public void sendOffHandSlot(Player[] players)
public void sendArmorContents(Player player)
public void sendArmorContents(Player[] players)
public void setArmorContents(Item[] items)
public void sendArmorContents(Collection<Player> players)
public void sendArmorSlot(int index,
Player player)
public void sendArmorSlot(int index,
Player[] players)
public void sendArmorSlot(int index,
Collection<Player> players)
public void sendContents(Player player)
sendContents in interface InventorysendContents in class BaseInventorypublic void sendContents(Collection<Player> players)
sendContents in interface InventorysendContents in class BaseInventorypublic void sendContents(Player[] players)
sendContents in interface InventorysendContents in class BaseInventorypublic void sendSlot(int index,
Player player)
sendSlot in interface InventorysendSlot in class BaseInventorypublic void sendSlot(int index,
Collection<Player> players)
sendSlot in interface InventorysendSlot in class BaseInventorypublic void sendSlot(int index,
Player... players)
sendSlot in interface InventorysendSlot in class BaseInventorypublic void sendCreativeContents()
public Human getHolder()
getHolder in interface InventorygetHolder in class BaseInventorypublic void onOpen(Player who)
onOpen in interface InventoryonOpen in class BaseInventorypublic void onClose(Player who)
onClose in interface InventoryonClose in class BaseInventoryCopyright © 2020. All rights reserved.