HyCodeYourTale
classpublicPriority 1

Inventory

com.hypixel.hytale.server.core.inventory.Inventory

implements NetworkSerializable

51

Methods

51

Public Methods

26

Fields

4

Constructors

Constants

intARMOR_SECTION_ID= -3
intBACKPACK_SECTION_ID= -9
BuilderCodec<Inventory>CODEC= BuilderCodec.builder(Inventory.class, () -> new Inventory(null)) .versioned() .codecV...
shortDEFAULT_ARMOR_CAPACITY= (short)ItemArmorSlot.VALUES.length
shortDEFAULT_HOTBAR_CAPACITY= 9
shortDEFAULT_STORAGE_CAPACITY= 36
shortDEFAULT_STORAGE_COLUMNS= 9
shortDEFAULT_STORAGE_ROWS= 4
shortDEFAULT_TOOLS_CAPACITY= 23
shortDEFAULT_UTILITY_CAPACITY= 4
intHOTBAR_SECTION_ID= -1
byteINACTIVE_SLOT_INDEX= -1
intSTORAGE_SECTION_ID= -2
intTOOLS_SECTION_ID= -8
intUTILITY_SECTION_ID= -5
intVERSION= 4

Constructors

private
Inventory(Void dummy)
public
Inventory()
public
Inventory(short storageCapacity, short armorCapacity, short hotbarCapacity, short utilityCapacity, short toolCapacity)
public
Inventory(ItemContainer storage, ItemContainer armor, ItemContainer hotbar, ItemContainer utility, ItemContainer tools, ItemContainer backpack)

Methods

Public Methods (51)

public
void clear()
public
boolean consumeIsDirty()
public
boolean consumeNeedsSaving()
public
boolean containsBrokenItem()
public
void doMigration(Function<String, String> blockMigration)
public
List<ItemStack> dropAllItemStacks()
@Nonnull
public
boolean equals(Object o)
@Override
public
ItemStack getActiveHotbarItem()
@Nullable
public
byte getActiveHotbarSlot()
public
byte getActiveSlot(int inventorySectionId)
public
ItemStack getActiveToolItem()
@Nullable
public
byte getActiveToolsSlot()
public
byte getActiveUtilitySlot()
public
ItemContainer getArmor()
public
ItemContainer getBackpack()
public
CombinedItemContainer getCombinedArmorHotbarStorage()
public
CombinedItemContainer getCombinedArmorHotbarUtilityStorage()
public
CombinedItemContainer getCombinedBackpackStorageHotbar()
public
CombinedItemContainer getCombinedEverything()
public
CombinedItemContainer getCombinedHotbarFirst()
public
CombinedItemContainer getCombinedHotbarUtilityConsumableStorage()
public
CombinedItemContainer getCombinedStorageFirst()
public
ItemContainer getContainerForItemPickup(Item item, PlayerSettings playerSettings)
@Nonnull
public
ItemContainer getHotbar()
public
ItemStack getItemInHand()
@Nullable
public
ItemContainer getSectionById(int id)
@Nullable
public
ItemContainer getStorage()
public
ItemContainer getTools()
public
ItemStack getToolsItem()
@Nullable
public
ItemContainer getUtility()
public
ItemStack getUtilityItem()
@Nullable
public
int hashCode()
@Override
public
void markChanged()
public
void moveItem(int fromSectionId, int fromSlotId, int quantity, int toSectionId, int toSlotId)
public
ListTransaction<MoveTransaction<ItemStackTransaction>> putAll(int inventorySectionId)
@Nullable
public
ListTransaction<MoveTransaction<ItemStackTransaction>> quickStack(int inventorySectionId)
@Nullable
public
void resizeBackpack(short capacity, List<ItemStack> remainder)
public
void setActiveHotbarSlot(byte slot)
public
void setActiveSlot(int inventorySectionId, byte slot)
public
void setActiveToolsSlot(byte slot)
public
void setActiveUtilitySlot(byte slot)
public
void setEntity(LivingEntity entity)
public
void setSortType(SortType type)
public
void setUsingToolsItem(boolean value)
public
void smartMoveItem(int fromSectionId, int fromSlotId, int quantity, SmartMoveType moveType)
public
void sortStorage(SortType type)
public
ListTransaction<MoveTransaction<ItemStackTransaction>> takeAll(int inventorySectionId)
@Nullable
public
UpdatePlayerInventory toPacket()
@Nonnull
public
String toString()
@Nonnull@Override
public
void unregister()
public
boolean usingToolsItem()

Fields

Private/Package Fields (26)

privateboolean _usingToolsItem
privatebyte activeHotbarSlot
privatebyte activeToolsSlot
privatebyte activeUtilitySlot
privateItemContainer armor
privateEventRegistration armorChange
privateItemContainer backpack
privateEventRegistration backpackChange
privateCombinedItemContainer combinedArmorHotbarStorage
privateCombinedItemContainer combinedArmorHotbarUtilityStorage
privateCombinedItemContainer combinedBackpackStorageHotbar
privateCombinedItemContainer combinedEverything
privateCombinedItemContainer combinedHotbarFirst
privateCombinedItemContainer combinedHotbarUtilityConsumableStorage
privateCombinedItemContainer combinedStorageFirst
privateCombinedItemContainer combinedStorageHotbarBackpack
privateLivingEntity entity
privateItemContainer hotbar
privateEventRegistration hotbarChange
privateSortType sortType
privateItemContainer storage
privateEventRegistration storageChange
privateEventRegistration toolChange
privateItemContainer tools
privateItemContainer utility
privateEventRegistration utilityChange

Related Classes