Class InventoryHelper

java.lang.Object
com.hypixel.hytale.server.npc.util.InventoryHelper

public class InventoryHelper extends Object
  • Field Details

    • DEFAULT_NPC_HOTBAR_SLOTS

      public static final short DEFAULT_NPC_HOTBAR_SLOTS
      See Also:
    • MAX_NPC_HOTBAR_SLOTS

      public static final short MAX_NPC_HOTBAR_SLOTS
      See Also:
    • DEFAULT_NPC_INVENTORY_SLOTS

      public static final short DEFAULT_NPC_INVENTORY_SLOTS
      See Also:
    • DEFAULT_NPC_UTILITY_SLOTS

      public static final short DEFAULT_NPC_UTILITY_SLOTS
      See Also:
    • MAX_NPC_UTILITY_SLOTS

      public static final short MAX_NPC_UTILITY_SLOTS
      See Also:
    • DEFAULT_NPC_TOOL_SLOTS

      public static final short DEFAULT_NPC_TOOL_SLOTS
      See Also:
    • MAX_NPC_INVENTORY_SLOTS

      public static final short MAX_NPC_INVENTORY_SLOTS
      See Also:
  • Constructor Details

    • InventoryHelper

      private InventoryHelper()
  • Method Details

    • matchesItem

      public static boolean matchesItem(@Nullable String pattern, @Nonnull ItemStack itemStack)
    • matchesItem

      public static boolean matchesItem(@Nullable List<String> patterns, @Nonnull ItemStack itemStack)
    • matchesPatterns

      protected static boolean matchesPatterns(@Nonnull List<String> patterns, @Nullable String name)
    • itemKeyExists

      public static boolean itemKeyExists(@Nullable String name)
    • itemKeyIsBlockType

      public static boolean itemKeyIsBlockType(@Nullable String name)
    • itemDropListKeyExists

      public static boolean itemDropListKeyExists(@Nullable String name)
    • findHotbarSlotWithItem

      public static byte findHotbarSlotWithItem(@Nonnull Inventory inventory, String name)
    • findHotbarSlotWithItem

      public static short findHotbarSlotWithItem(@Nonnull Inventory inventory, List<String> name)
    • findHotbarEmptySlot

      public static byte findHotbarEmptySlot(@Nonnull Inventory inventory)
    • findInventorySlotWithItem

      public static short findInventorySlotWithItem(@Nonnull Inventory inventory, String name)
    • findInventorySlotWithItem

      public static short findInventorySlotWithItem(@Nonnull Inventory inventory, List<String> name)
    • countItems

      public static int countItems(@Nonnull ItemContainer container, List<String> name)
    • countFreeSlots

      public static int countFreeSlots(@Nonnull ItemContainer container)
    • hotbarContainsItem

      public static boolean hotbarContainsItem(@Nonnull Inventory inventory, String name)
    • hotbarContainsItem

      public static boolean hotbarContainsItem(@Nonnull Inventory inventory, List<String> name)
    • holdsItem

      public static boolean holdsItem(@Nonnull Inventory inventory, String name)
    • containsItem

      public static boolean containsItem(@Nonnull Inventory inventory, String name)
    • containsItem

      public static boolean containsItem(@Nonnull Inventory inventory, List<String> name)
    • clearItemInHand

      public static boolean clearItemInHand(@Nonnull Inventory inventory, byte slotHint)
    • removeItemInHand

      public static void removeItemInHand(@Nonnull Inventory inventory)
    • checkHotbarSlot

      public static boolean checkHotbarSlot(@Nonnull Inventory inventory, byte slot)
    • checkOffHandSlot

      public static boolean checkOffHandSlot(@Nonnull Inventory inventory, byte slot)
    • setHotbarSlot

      public static void setHotbarSlot(@Nonnull Inventory inventory, byte slot)
    • setOffHandSlot

      public static void setOffHandSlot(@Nonnull Inventory inventory, byte slot)
    • setHotbarItem

      public static boolean setHotbarItem(@Nonnull Inventory inventory, @Nullable String name, byte slot)
    • setOffHandItem

      public static boolean setOffHandItem(@Nonnull Inventory inventory, @Nullable String name, byte slot)
    • useItem

      public static boolean useItem(@Nonnull Inventory inventory, @Nullable String name, byte slotHint)
    • createItem

      @Nullable public static ItemStack createItem(@Nullable String name)
    • useItem

      public static boolean useItem(@Nonnull Inventory inventory, @Nullable String name)
    • useArmor

      public static boolean useArmor(@Nonnull ItemContainer armorInventory, @Nullable String armorItem)
    • useArmor

      public static boolean useArmor(@Nonnull ItemContainer armorInventory, @Nullable ItemStack itemStack)