InventoryHelper

public class InventoryHelper

Class InventoryHelper. Provides inventoryhelper functionality for the Hytale server.

java.lang.Object > InventoryHelper

Field Summary

pattern

final String pattern

Field pattern.

item

final Item item

Field item.

dropList

final ItemDropList dropList

Field dropList.

hotbar

final ItemContainer hotbar

Field hotbar.

container

final CombinedItemContainer container

Field container.

activeHotbarSlot

final byte activeHotbarSlot

Field activeHotbarSlot.

utility

final ItemContainer utility

Field utility.

slot

final byte slot

Field slot.

itemStack

final ItemStack itemStack

Field itemStack.

armor

final ItemArmor armor

Field armor.

Method Detail

InventoryHelper

public private InventoryHelper ()

Method InventoryHelper.

matchesItem

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

Method matchesItem.

Parameters:
@Nullable final String pattern
@Nonnull final ItemStack itemStack

matchesPatterns

static boolean matchesPatterns (@Nonnull final List patterns, @Nullable final String name)

Method matchesPatterns.

Parameters:
@Nonnull final List patterns
@Nullable final String name

itemKeyExists

static boolean itemKeyExists (@Nullable final String name)

Method itemKeyExists.

Parameters:
@Nullable final String name

itemKeyIsBlockType

static boolean itemKeyIsBlockType (@Nullable final String name)

Method itemKeyIsBlockType.

Parameters:
@Nullable final String name

itemDropListKeyExists

static boolean itemDropListKeyExists (@Nullable final String name)

Method itemDropListKeyExists.

Parameters:
@Nullable final String name

findHotbarSlotWithItem

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

Method findHotbarSlotWithItem.

Parameters:
@Nonnull final Inventory inventory
final String name

findHotbarEmptySlot

static byte findHotbarEmptySlot (@Nonnull final Inventory inventory)

Method findHotbarEmptySlot.

Parameters:
@Nonnull final Inventory inventory

findInventorySlotWithItem

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

Method findInventorySlotWithItem.

Parameters:
@Nonnull final Inventory inventory
final String name

countItems

static int countItems (@Nonnull final ItemContainer container, final List name)

Method countItems.

Parameters:
@Nonnull final ItemContainer container
final List name

countFreeSlots

static int countFreeSlots (@Nonnull final ItemContainer container)

Method countFreeSlots.

Parameters:
@Nonnull final ItemContainer container

hotbarContainsItem

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

Method hotbarContainsItem.

Parameters:
@Nonnull final Inventory inventory
final String name

holdsItem

static boolean holdsItem (@Nonnull final Inventory inventory, final String name)

Method holdsItem.

Parameters:
@Nonnull final Inventory inventory
final String name

containsItem

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

Method containsItem.

Parameters:
@Nonnull final Inventory inventory
final String name

clearItemInHand

static boolean clearItemInHand (@Nonnull final Inventory inventory, final byte slotHint)

Method clearItemInHand.

Parameters:
@Nonnull final Inventory inventory
final byte slotHint

removeItemInHand

static void removeItemInHand (@Nonnull final Inventory inventory)

Method removeItemInHand.

Parameters:
@Nonnull final Inventory inventory

checkHotbarSlot

static boolean checkHotbarSlot (@Nonnull final Inventory inventory, final byte slot)

Method checkHotbarSlot.

Parameters:
@Nonnull final Inventory inventory
final byte slot

checkOffHandSlot

static boolean checkOffHandSlot (@Nonnull final Inventory inventory, final byte slot)

Method checkOffHandSlot.

Parameters:
@Nonnull final Inventory inventory
final byte slot

setHotbarSlot

static void setHotbarSlot (@Nonnull final Inventory inventory, final byte slot)

Method setHotbarSlot.

Parameters:
@Nonnull final Inventory inventory
final byte slot

setOffHandSlot

static void setOffHandSlot (@Nonnull final Inventory inventory, final byte slot)

Method setOffHandSlot.

Parameters:
@Nonnull final Inventory inventory
final byte slot

setHotbarItem

static boolean setHotbarItem (@Nonnull final Inventory inventory, @Nullable final String name, final byte slot)

Method setHotbarItem.

Parameters:
@Nonnull final Inventory inventory
@Nullable final String name
final byte slot

setOffHandItem

static boolean setOffHandItem (@Nonnull final Inventory inventory, @Nullable final String name, final byte slot)

Method setOffHandItem.

Parameters:
@Nonnull final Inventory inventory
@Nullable final String name
final byte slot

useItem

static boolean useItem (@Nonnull final Inventory inventory, @Nullable final String name, byte slotHint)

Method useItem.

Parameters:
@Nonnull final Inventory inventory
@Nullable final String name
byte slotHint

createItem

static ItemStack createItem (@Nullable final String name)

Method createItem.

Parameters:
@Nullable final String name

useArmor

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

Method useArmor.

Parameters:
@Nonnull final ItemContainer armorInventory
@Nullable final String armorItem