Class CloudPlayerInventory
java.lang.Object
org.cloudburstmc.server.inventory.BaseInventory
org.cloudburstmc.server.inventory.CloudCreatureInventory
org.cloudburstmc.server.inventory.CloudPlayerInventory
- All Implemented Interfaces:
org.cloudburstmc.api.inventory.CreatureInventory,org.cloudburstmc.api.inventory.Inventory,org.cloudburstmc.api.inventory.PlayerInventory
public class CloudPlayerInventory
extends CloudCreatureInventory
implements org.cloudburstmc.api.inventory.PlayerInventory
author: MagicDroidX
Nukkit Project
-
Field Summary
FieldsFields inherited from class org.cloudburstmc.server.inventory.BaseInventory
holder, maxStackSize, name, size, slots, title, type, viewersFields inherited from interface org.cloudburstmc.api.inventory.Inventory
MAX_STACK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclear(int index, boolean send)voidclearAll()voidbooleanequipItem(int slot)Called when a client equips a hotbar inventorySlot.org.cloudburstmc.api.item.ItemStackintgetHotbarSlot(int slot)voidonClose(org.cloudburstmc.api.player.Player who)voidonOpen(org.cloudburstmc.api.player.Player who)voidonSlotChange(int index, org.cloudburstmc.api.item.ItemStack before, boolean send)voidsendContents(org.cloudburstmc.api.player.Player[] players)voidvoidsendSlot(int index, org.cloudburstmc.api.player.Player... players)booleansetCursorItem(org.cloudburstmc.api.item.ItemStack item)voidsetHeldItemIndex(int index)voidsetHeldItemIndex(int index, boolean send)voidsetHeldItemSlot(int slot)booleansetHotbarSlot(int slot, org.cloudburstmc.api.item.ItemStack item)booleansetItem(int index, org.cloudburstmc.api.item.ItemStack item)Methods inherited from class org.cloudburstmc.server.inventory.CloudCreatureInventory
decrementHandCount, getArmorContents, getArmorItem, getHeldItemIndex, getItemInHand, getOffHand, getOffHandIndex, getSize, incrementHandCount, sendArmorContents, sendArmorContents, sendArmorContents, sendArmorSlot, sendArmorSlot, sendArmorSlot, sendHeldItem, sendHeldItem, sendOffHandContents, sendOffHandContents, sendOffHandContents, sendOffHandSlot, sendOffHandSlot, sendOffHandSlot, setArmorContents, setArmorItem, setItemInHand, setOffHandContents, setSizeMethods inherited from class org.cloudburstmc.server.inventory.BaseInventory
addItem, addItemToFirstEmptySlot, all, canAddItem, close, contains, decrementCount, first, firstEmpty, firstFit, firstNonEmpty, getContents, getEmptySlotsCount, getFreeSpace, getItem, getMaxStackSize, getName, getTitle, getType, getViewers, incrementCount, isEmpty, isFull, open, remove, removeItem, setContents, setItem, setMaxStackSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.api.inventory.CreatureInventory
decrementHandCount, getArmorContents, getArmorItem, getBoots, getChestplate, getHeldItemIndex, getHelmet, getItemInHand, getLeggings, getOffHand, incrementHandCount, setArmorItem, setArmorItem, setBoots, setChestplate, setHelmet, setItemInHand, setLeggings, setOffHandContentsMethods inherited from interface org.cloudburstmc.api.inventory.Inventory
addItem, all, canAddItem, clear, close, contains, decrementCount, first, first, firstEmpty, firstFit, firstFit, firstNonEmpty, getContents, getFreeSpace, getItem, getMaxStackSize, getName, getSize, getTitle, getType, getViewers, incrementCount, isEmpty, isFull, open, remove, removeItem, sendContents, sendContents, sendSlot, sendSlot, setContents, setItem, setMaxStackSize
-
Field Details
-
SURVIVAL_SLOTS
public static final int SURVIVAL_SLOTS- See Also:
- Constant Field Values
-
-
Constructor Details
-
CloudPlayerInventory
-
-
Method Details
-
equipItem
public boolean equipItem(int slot)Called when a client equips a hotbar inventorySlot. This method should not be used by plugins. This method will call PlayerItemHeldEvent.- Parameters:
slot- hotbar slot Number of the hotbar slot to equip.- Returns:
- boolean if the equipment change was successful, false if not.
-
setHotbarSlot
public boolean setHotbarSlot(int slot, org.cloudburstmc.api.item.ItemStack item)- Specified by:
setHotbarSlotin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
getHotbarSlot
- Specified by:
getHotbarSlotin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
getHotbar
- Specified by:
getHotbarin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
getCursorItem
@Nonnull public org.cloudburstmc.api.item.ItemStack getCursorItem()- Specified by:
getCursorItemin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
setCursorItem
public boolean setCursorItem(@Nonnull org.cloudburstmc.api.item.ItemStack item)- Specified by:
setCursorItemin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
clearCursor
public void clearCursor()- Specified by:
clearCursorin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
setHeldItemIndex
public void setHeldItemIndex(int index)- Specified by:
setHeldItemIndexin interfaceorg.cloudburstmc.api.inventory.CreatureInventory- Overrides:
setHeldItemIndexin classCloudCreatureInventory
-
setHeldItemIndex
public void setHeldItemIndex(int index, boolean send)- Specified by:
setHeldItemIndexin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
setHeldItemSlot
public void setHeldItemSlot(int slot) -
onSlotChange
public void onSlotChange(int index, org.cloudburstmc.api.item.ItemStack before, boolean send)- Specified by:
onSlotChangein interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
onSlotChangein classBaseInventory
-
getHotbarSize
public int getHotbarSize() -
setItem
public boolean setItem(int index, org.cloudburstmc.api.item.ItemStack item)- Specified by:
setItemin interfaceorg.cloudburstmc.api.inventory.Inventory
-
clear
public boolean clear(int index, boolean send)- Specified by:
clearin interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
clearin classBaseInventory
-
clearAll
public void clearAll()- Specified by:
clearAllin interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
clearAllin classBaseInventory
-
sendContents
public void sendContents(org.cloudburstmc.api.player.Player[] players)- Specified by:
sendContentsin interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
sendContentsin classBaseInventory
-
sendSlot
public void sendSlot(int index, org.cloudburstmc.api.player.Player... players)- Specified by:
sendSlotin interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
sendSlotin classBaseInventory
-
sendCreativeContents
public void sendCreativeContents()- Specified by:
sendCreativeContentsin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-
getHolder
- Specified by:
getHolderin interfaceorg.cloudburstmc.api.inventory.CreatureInventory- Specified by:
getHolderin interfaceorg.cloudburstmc.api.inventory.Inventory- Specified by:
getHolderin interfaceorg.cloudburstmc.api.inventory.PlayerInventory- Overrides:
getHolderin classCloudCreatureInventory
-
onOpen
public void onOpen(org.cloudburstmc.api.player.Player who)- Specified by:
onOpenin interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
onOpenin classBaseInventory
-
onClose
public void onClose(org.cloudburstmc.api.player.Player who)- Specified by:
onClosein interfaceorg.cloudburstmc.api.inventory.Inventory- Overrides:
onClosein classBaseInventory
-
getCraftingGrid
- Specified by:
getCraftingGridin interfaceorg.cloudburstmc.api.inventory.PlayerInventory
-