Class VirtualInventory

java.lang.Object
io.github.toberocat.guiengine.utils.VirtualInventory
All Implemented Interfaces:
Iterable<org.bukkit.inventory.ItemStack>, org.bukkit.inventory.Inventory

public class VirtualInventory extends Object implements org.bukkit.inventory.Inventory
Created: 29.04.2023
Author:
Tobias Madlberger (Tobias)
  • Constructor Details

    • VirtualInventory

      public VirtualInventory(int height, Runnable reload)
  • Method Details

    • getSize

      public int getSize()
      Specified by:
      getSize in interface org.bukkit.inventory.Inventory
    • getMaxStackSize

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface org.bukkit.inventory.Inventory
    • setMaxStackSize

      public void setMaxStackSize(int size)
      Specified by:
      setMaxStackSize in interface org.bukkit.inventory.Inventory
    • getItem

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getItem(int index)
      Specified by:
      getItem in interface org.bukkit.inventory.Inventory
    • setItem

      public void setItem(int index, @Nullable @Nullable org.bukkit.inventory.ItemStack item)
      Specified by:
      setItem in interface org.bukkit.inventory.Inventory
    • addItem

      @NotNull public @NotNull HashMap<Integer,org.bukkit.inventory.ItemStack> addItem(@NotNull @NotNull org.bukkit.inventory.ItemStack... items) throws IllegalArgumentException
      Specified by:
      addItem in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • removeItem

      @NotNull public @NotNull HashMap<Integer,org.bukkit.inventory.ItemStack> removeItem(@NotNull @NotNull org.bukkit.inventory.ItemStack... items) throws IllegalArgumentException
      Specified by:
      removeItem in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • getContents

      @NotNull public @NotNull org.bukkit.inventory.ItemStack[] getContents()
      Specified by:
      getContents in interface org.bukkit.inventory.Inventory
    • setContents

      public void setContents(@NotNull @NotNull org.bukkit.inventory.ItemStack[] items) throws IllegalArgumentException
      Specified by:
      setContents in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • getStorageContents

      @NotNull public @NotNull org.bukkit.inventory.ItemStack[] getStorageContents()
      Specified by:
      getStorageContents in interface org.bukkit.inventory.Inventory
    • setStorageContents

      public void setStorageContents(@NotNull @NotNull org.bukkit.inventory.ItemStack[] items) throws IllegalArgumentException
      Specified by:
      setStorageContents in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • contains

      public boolean contains(@NotNull @NotNull org.bukkit.Material material) throws IllegalArgumentException
      Specified by:
      contains in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • contains

      public boolean contains(@Nullable @Nullable org.bukkit.inventory.ItemStack item)
      Specified by:
      contains in interface org.bukkit.inventory.Inventory
    • contains

      public boolean contains(@NotNull @NotNull org.bukkit.Material material, int amount) throws IllegalArgumentException
      Specified by:
      contains in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • contains

      public boolean contains(@Nullable @Nullable org.bukkit.inventory.ItemStack item, int amount)
      Specified by:
      contains in interface org.bukkit.inventory.Inventory
    • containsAtLeast

      public boolean containsAtLeast(@Nullable @Nullable org.bukkit.inventory.ItemStack item, int amount)
      Specified by:
      containsAtLeast in interface org.bukkit.inventory.Inventory
    • all

      @NotNull public @NotNull HashMap<Integer,? extends org.bukkit.inventory.ItemStack> all(@NotNull @NotNull org.bukkit.Material material) throws IllegalArgumentException
      Specified by:
      all in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • all

      @NotNull public @NotNull HashMap<Integer,? extends org.bukkit.inventory.ItemStack> all(@Nullable @Nullable org.bukkit.inventory.ItemStack item)
      Specified by:
      all in interface org.bukkit.inventory.Inventory
    • first

      public int first(@NotNull @NotNull org.bukkit.Material material) throws IllegalArgumentException
      Specified by:
      first in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • first

      public int first(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Specified by:
      first in interface org.bukkit.inventory.Inventory
    • firstEmpty

      public int firstEmpty()
      Specified by:
      firstEmpty in interface org.bukkit.inventory.Inventory
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.bukkit.inventory.Inventory
    • remove

      public void remove(@NotNull @NotNull org.bukkit.Material material) throws IllegalArgumentException
      Specified by:
      remove in interface org.bukkit.inventory.Inventory
      Throws:
      IllegalArgumentException
    • remove

      public void remove(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Specified by:
      remove in interface org.bukkit.inventory.Inventory
    • clear

      public void clear(int index)
      Specified by:
      clear in interface org.bukkit.inventory.Inventory
    • clear

      public void clear()
      Specified by:
      clear in interface org.bukkit.inventory.Inventory
    • getViewers

      @NotNull public @NotNull List<org.bukkit.entity.HumanEntity> getViewers()
      Specified by:
      getViewers in interface org.bukkit.inventory.Inventory
    • getType

      @NotNull public @NotNull org.bukkit.event.inventory.InventoryType getType()
      Specified by:
      getType in interface org.bukkit.inventory.Inventory
    • getHolder

      @Nullable public @Nullable org.bukkit.inventory.InventoryHolder getHolder()
      Specified by:
      getHolder in interface org.bukkit.inventory.Inventory
    • iterator

      @NotNull public @NotNull ListIterator<org.bukkit.inventory.ItemStack> iterator()
      Specified by:
      iterator in interface org.bukkit.inventory.Inventory
      Specified by:
      iterator in interface Iterable<org.bukkit.inventory.ItemStack>
    • iterator

      @NotNull public @NotNull ListIterator<org.bukkit.inventory.ItemStack> iterator(int index)
      Specified by:
      iterator in interface org.bukkit.inventory.Inventory
    • getLocation

      @Nullable public @Nullable org.bukkit.Location getLocation()
      Specified by:
      getLocation in interface org.bukkit.inventory.Inventory