Class 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 Details

  • Constructor Details

    • CloudPlayerInventory

      public CloudPlayerInventory(CloudPlayer player)
  • 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:
      setHotbarSlot in interface org.cloudburstmc.api.inventory.PlayerInventory
    • getHotbarSlot

      public CloudItemStack getHotbarSlot(int slot)
      Specified by:
      getHotbarSlot in interface org.cloudburstmc.api.inventory.PlayerInventory
    • getHotbar

      public List<CloudItemStack> getHotbar()
      Specified by:
      getHotbar in interface org.cloudburstmc.api.inventory.PlayerInventory
    • getCursorItem

      @Nonnull public org.cloudburstmc.api.item.ItemStack getCursorItem()
      Specified by:
      getCursorItem in interface org.cloudburstmc.api.inventory.PlayerInventory
    • setCursorItem

      public boolean setCursorItem(@Nonnull org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      setCursorItem in interface org.cloudburstmc.api.inventory.PlayerInventory
    • clearCursor

      public void clearCursor()
      Specified by:
      clearCursor in interface org.cloudburstmc.api.inventory.PlayerInventory
    • setHeldItemIndex

      public void setHeldItemIndex(int index)
      Specified by:
      setHeldItemIndex in interface org.cloudburstmc.api.inventory.CreatureInventory
      Overrides:
      setHeldItemIndex in class CloudCreatureInventory
    • setHeldItemIndex

      public void setHeldItemIndex(int index, boolean send)
      Specified by:
      setHeldItemIndex in interface org.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:
      onSlotChange in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      onSlotChange in class BaseInventory
    • getHotbarSize

      public int getHotbarSize()
    • setItem

      public boolean setItem(int index, org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      setItem in interface org.cloudburstmc.api.inventory.Inventory
    • clear

      public boolean clear(int index, boolean send)
      Specified by:
      clear in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      clear in class BaseInventory
    • clearAll

      public void clearAll()
      Specified by:
      clearAll in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      clearAll in class BaseInventory
    • sendContents

      public void sendContents(org.cloudburstmc.api.player.Player[] players)
      Specified by:
      sendContents in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      sendContents in class BaseInventory
    • sendSlot

      public void sendSlot(int index, org.cloudburstmc.api.player.Player... players)
      Specified by:
      sendSlot in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      sendSlot in class BaseInventory
    • sendCreativeContents

      public void sendCreativeContents()
      Specified by:
      sendCreativeContents in interface org.cloudburstmc.api.inventory.PlayerInventory
    • getHolder

      public CloudPlayer getHolder()
      Specified by:
      getHolder in interface org.cloudburstmc.api.inventory.CreatureInventory
      Specified by:
      getHolder in interface org.cloudburstmc.api.inventory.Inventory
      Specified by:
      getHolder in interface org.cloudburstmc.api.inventory.PlayerInventory
      Overrides:
      getHolder in class CloudCreatureInventory
    • onOpen

      public void onOpen(org.cloudburstmc.api.player.Player who)
      Specified by:
      onOpen in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      onOpen in class BaseInventory
    • onClose

      public void onClose(org.cloudburstmc.api.player.Player who)
      Specified by:
      onClose in interface org.cloudburstmc.api.inventory.Inventory
      Overrides:
      onClose in class BaseInventory
    • getCraftingGrid

      public CloudCraftingGrid getCraftingGrid()
      Specified by:
      getCraftingGrid in interface org.cloudburstmc.api.inventory.PlayerInventory