Contents
- Description
- Field Summary
- Method Summary
- Field Details
- Method Details
- matchesItem(String, ItemStack)
- matchesItem(List, ItemStack)
- itemKeyExists(String)
- itemKeyIsBlockType(String)
- itemDropListKeyExists(String)
- findHotbarSlotWithItem(Ref, ComponentAccessor, String)
- findHotbarSlotWithItem(Ref, ComponentAccessor, List)
- findHotbarEmptySlot(Ref, ComponentAccessor)
- findInventorySlotWithItem(Ref, String, ComponentAccessor)
- findInventorySlotWithItem(Ref, List, ComponentAccessor)
- countItems(ItemContainer, List)
- countFreeSlots(ItemContainer)
- hotbarContainsItem(Ref, ComponentAccessor, String)
- hotbarContainsItem(Ref, ComponentAccessor, List)
- holdsItem(Ref, ComponentAccessor, String)
- containsItem(Ref, String, ComponentAccessor)
- containsItem(Ref, List, ComponentAccessor)
- clearItemInHand(Ref, byte, ComponentAccessor)
- removeItemInHand(Ref, ComponentAccessor, int)
- checkHotbarSlot(Ref, byte, ComponentAccessor)
- checkOffHandSlot(Ref, byte, ComponentAccessor)
- setHotbarSlot(Ref, byte, ComponentAccessor)
- setOffHandSlot(Ref, byte, ComponentAccessor)
- setHotbarItem(Ref, String, byte, ComponentAccessor)
- setOffHandItem(Ref, String, byte, ComponentAccessor)
- useItem(Ref, String, byte, ComponentAccessor)
- createItem(String)
- useItem(Ref, String, ComponentAccessor)
- useArmor(ItemContainer, String)
- useArmor(ItemContainer, ItemStack)
Class InventoryHelper
java.lang.Object
com.hypixel.hytale.server.npc.util.InventoryHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final short -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckHotbarSlot(Ref<EntityStore> ref, byte slot, ComponentAccessor<EntityStore> componentAccessor) static booleancheckOffHandSlot(Ref<EntityStore> ref, byte slot, ComponentAccessor<EntityStore> componentAccessor) static booleanclearItemInHand(Ref<EntityStore> ref, byte slotHint, ComponentAccessor<EntityStore> componentAccessor) static booleancontainsItem(Ref<EntityStore> ref, String name, ComponentAccessor<EntityStore> componentAccessor) static booleancontainsItem(Ref<EntityStore> ref, List<String> name, ComponentAccessor<EntityStore> componentAccessor) static intcountFreeSlots(ItemContainer container) static intcountItems(ItemContainer container, List<String> name) static ItemStackcreateItem(String name) static bytefindHotbarEmptySlot(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) static bytefindHotbarSlotWithItem(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor, String name) static shortfindHotbarSlotWithItem(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor, List<String> name) static shortfindInventorySlotWithItem(Ref<EntityStore> ref, String name, ComponentAccessor<EntityStore> componentAccessor) static shortfindInventorySlotWithItem(Ref<EntityStore> ref, List<String> name, ComponentAccessor<EntityStore> componentAccessor) static booleanholdsItem(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor, String name) static booleanhotbarContainsItem(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor, String name) static booleanhotbarContainsItem(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor, List<String> name) static booleanitemDropListKeyExists(String name) static booleanitemKeyExists(String name) static booleanitemKeyIsBlockType(String name) static booleanmatchesItem(String pattern, ItemStack itemStack) static booleanmatchesItem(List<String> patterns, ItemStack itemStack) static voidremoveItemInHand(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor, int count) static booleansetHotbarItem(Ref<EntityStore> ref, String name, byte slot, ComponentAccessor<EntityStore> componentAccessor) static voidsetHotbarSlot(Ref<EntityStore> ref, byte slot, ComponentAccessor<EntityStore> componentAccessor) static booleansetOffHandItem(Ref<EntityStore> ref, String name, byte slot, ComponentAccessor<EntityStore> componentAccessor) static voidsetOffHandSlot(Ref<EntityStore> ref, byte slot, ComponentAccessor<EntityStore> componentAccessor) static booleanuseArmor(ItemContainer armorInventory, ItemStack itemStack) static booleanuseArmor(ItemContainer armorInventory, String armorItem) static booleanuseItem(Ref<EntityStore> ref, String name, byte slotHint, ComponentAccessor<EntityStore> componentAccessor) static booleanuseItem(Ref<EntityStore> ref, String name, ComponentAccessor<EntityStore> componentAccessor)
-
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:
-
-
Method Details
-
matchesItem
-
matchesItem
-
itemKeyExists
-
itemKeyIsBlockType
-
itemDropListKeyExists
-
findHotbarSlotWithItem
public static byte findHotbarSlotWithItem(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull String name) -
findHotbarSlotWithItem
public static short findHotbarSlotWithItem(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull List<String> name) -
findHotbarEmptySlot
public static byte findHotbarEmptySlot(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
findInventorySlotWithItem
public static short findInventorySlotWithItem(@Nonnull Ref<EntityStore> ref, @Nonnull String name, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
findInventorySlotWithItem
public static short findInventorySlotWithItem(@Nonnull Ref<EntityStore> ref, @Nonnull List<String> name, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
countItems
-
countFreeSlots
-
hotbarContainsItem
public static boolean hotbarContainsItem(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull String name) -
hotbarContainsItem
public static boolean hotbarContainsItem(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull List<String> name) -
holdsItem
public static boolean holdsItem(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull String name) -
containsItem
public static boolean containsItem(@Nonnull Ref<EntityStore> ref, @Nonnull String name, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
containsItem
public static boolean containsItem(@Nonnull Ref<EntityStore> ref, @Nonnull List<String> name, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
clearItemInHand
public static boolean clearItemInHand(@Nonnull Ref<EntityStore> ref, byte slotHint, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
removeItemInHand
public static void removeItemInHand(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, int count) -
checkHotbarSlot
public static boolean checkHotbarSlot(@Nonnull Ref<EntityStore> ref, byte slot, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
checkOffHandSlot
public static boolean checkOffHandSlot(@Nonnull Ref<EntityStore> ref, byte slot, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setHotbarSlot
public static void setHotbarSlot(@Nonnull Ref<EntityStore> ref, byte slot, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setOffHandSlot
public static void setOffHandSlot(@Nonnull Ref<EntityStore> ref, byte slot, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setHotbarItem
public static boolean setHotbarItem(@Nonnull Ref<EntityStore> ref, @Nullable String name, byte slot, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setOffHandItem
public static boolean setOffHandItem(@Nonnull Ref<EntityStore> ref, @Nullable String name, byte slot, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
useItem
public static boolean useItem(@Nonnull Ref<EntityStore> ref, @Nullable String name, byte slotHint, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
createItem
-
useItem
public static boolean useItem(@Nonnull Ref<EntityStore> ref, @Nullable String name, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
useArmor
-
useArmor
public static boolean useArmor(@Nonnull ItemContainer armorInventory, @Nullable ItemStack itemStack)
-