Class Inventory
java.lang.Object
com.hypixel.hytale.server.core.inventory.Inventory
- All Implemented Interfaces:
NetworkSerializable<UpdatePlayerInventory>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate byteprivate byteprivate byteprivate ItemContainerstatic final intprivate EventRegistrationprivate ItemContainerstatic final intprivate EventRegistrationstatic final BuilderCodec<Inventory> private CombinedItemContainerprivate CombinedItemContainerprivate CombinedItemContainerprivate CombinedItemContainerprivate CombinedItemContainerprivate CombinedItemContainerprivate CombinedItemContainerprivate CombinedItemContainerstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortprivate LivingEntityprivate ItemContainerstatic final intprivate EventRegistrationstatic final byteprivate final AtomicBooleanprivate final AtomicBooleanprivate SortTypeDeprecated.private ItemContainerstatic final intprivate EventRegistrationprivate EventRegistrationprivate ItemContainerDeprecated.static final intprivate ItemContainerstatic final intprivate EventRegistrationstatic final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionInventory(short storageCapacity, short armorCapacity, short hotbarCapacity, short utilityCapacity, short toolCapacity) Inventory(ItemContainer storage, ItemContainer armor, ItemContainer hotbar, ItemContainer utility, ItemContainer tools, ItemContainer backpack) private -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidclear()booleanbooleanbooleanvoiddoMigration(Function<String, String> blockMigration) static InventoryensureCapacity(Inventory inventory, List<ItemStack> remainder) booleanbytebytegetActiveSlot(int inventorySectionId) bytebytegetArmor()getContainerForItemPickup(Item item, PlayerSettings playerSettings) getSectionById(int id) getTools()inthashCode()voidvoidmoveItem(int fromSectionId, int fromSlotId, int quantity, int toSectionId, int toSlotId) private voidputAll(int inventorySectionId) quickStack(int inventorySectionId) private voidprotected voidvoidresizeBackpack(short capacity, List<ItemStack> remainder) voidsetActiveHotbarSlot(byte slot) voidsetActiveSlot(int inventorySectionId, byte slot) voidsetActiveToolsSlot(byte slot) voidsetActiveUtilitySlot(byte slot) voidsetEntity(LivingEntity entity) voidsetSortType(SortType type) voidsetUsingToolsItem(boolean value) voidsmartMoveItem(int fromSectionId, int fromSlotId, int quantity, SmartMoveType moveType) voidsortStorage(SortType type) takeAll(int inventorySectionId) toPacket()toString()voidprivate voidboolean
-
Field Details
-
DEFAULT_HOTBAR_CAPACITY
public static final short DEFAULT_HOTBAR_CAPACITY- See Also:
-
DEFAULT_UTILITY_CAPACITY
public static final short DEFAULT_UTILITY_CAPACITY- See Also:
-
DEFAULT_TOOLS_CAPACITY
public static final short DEFAULT_TOOLS_CAPACITY- See Also:
-
DEFAULT_ARMOR_CAPACITY
public static final short DEFAULT_ARMOR_CAPACITY -
DEFAULT_STORAGE_ROWS
public static final short DEFAULT_STORAGE_ROWS- See Also:
-
DEFAULT_STORAGE_COLUMNS
public static final short DEFAULT_STORAGE_COLUMNS- See Also:
-
DEFAULT_STORAGE_CAPACITY
public static final short DEFAULT_STORAGE_CAPACITY- See Also:
-
HOTBAR_SECTION_ID
public static final int HOTBAR_SECTION_ID- See Also:
-
STORAGE_SECTION_ID
public static final int STORAGE_SECTION_ID- See Also:
-
ARMOR_SECTION_ID
public static final int ARMOR_SECTION_ID- See Also:
-
UTILITY_SECTION_ID
public static final int UTILITY_SECTION_ID- See Also:
-
TOOLS_SECTION_ID
public static final int TOOLS_SECTION_ID- See Also:
-
BACKPACK_SECTION_ID
public static final int BACKPACK_SECTION_ID- See Also:
-
INACTIVE_SLOT_INDEX
public static final byte INACTIVE_SLOT_INDEX- See Also:
-
VERSION
public static final int VERSION- See Also:
-
CODEC
-
isDirty
-
needsSaving
-
storage
-
armor
-
hotbar
-
utility
-
tools
Deprecated. -
backpack
-
combinedHotbarFirst
-
combinedStorageFirst
-
combinedBackpackStorageHotbar
-
combinedStorageHotbarBackpack
-
combinedArmorHotbarStorage
-
combinedArmorHotbarUtilityStorage
-
combinedHotbarUtilityConsumableStorage
-
combinedEverything
-
activeHotbarSlot
private byte activeHotbarSlot -
activeUtilitySlot
private byte activeUtilitySlot -
activeToolsSlot
private byte activeToolsSlot -
entity
-
sortType
Deprecated. -
armorChange
-
storageChange
-
hotbarChange
-
utilityChange
-
toolChange
-
backpackChange
-
_usingToolsItem
private boolean _usingToolsItem
-
-
Constructor Details
-
Inventory
-
Inventory
public Inventory() -
Inventory
public Inventory(short storageCapacity, short armorCapacity, short hotbarCapacity, short utilityCapacity, short toolCapacity) -
Inventory
public Inventory(ItemContainer storage, ItemContainer armor, ItemContainer hotbar, ItemContainer utility, ItemContainer tools, ItemContainer backpack)
-
-
Method Details
-
registerChangeEvents
protected void registerChangeEvents() -
registerBackpackListener
private void registerBackpackListener() -
unregister
public void unregister() -
unregisterBackpackChange
private void unregisterBackpackChange() -
markChanged
public void markChanged() -
moveItem
public void moveItem(int fromSectionId, int fromSlotId, int quantity, int toSectionId, int toSlotId) -
smartMoveItem
public void smartMoveItem(int fromSectionId, int fromSlotId, int quantity, @Nonnull SmartMoveType moveType) -
takeAll
@Nullable public ListTransaction<MoveTransaction<ItemStackTransaction>> takeAll(int inventorySectionId) -
putAll
@Nullable public ListTransaction<MoveTransaction<ItemStackTransaction>> putAll(int inventorySectionId) -
quickStack
@Nullable public ListTransaction<MoveTransaction<ItemStackTransaction>> quickStack(int inventorySectionId) -
dropAllItemStacks
-
clear
public void clear() -
getStorage
-
getArmor
-
getHotbar
-
getUtility
-
getTools
-
getBackpack
-
resizeBackpack
-
getCombinedHotbarFirst
-
getCombinedStorageFirst
-
getCombinedBackpackStorageHotbar
-
getCombinedArmorHotbarStorage
-
getCombinedArmorHotbarUtilityStorage
-
getCombinedHotbarUtilityConsumableStorage
-
getCombinedEverything
-
getContainerForItemPickup
@Nonnull public ItemContainer getContainerForItemPickup(@Nonnull Item item, PlayerSettings playerSettings) -
setActiveSlot
public void setActiveSlot(int inventorySectionId, byte slot) -
getActiveSlot
public byte getActiveSlot(int inventorySectionId) -
getActiveHotbarSlot
public byte getActiveHotbarSlot() -
setActiveHotbarSlot
public void setActiveHotbarSlot(byte slot) -
getActiveHotbarItem
-
getActiveToolItem
-
getItemInHand
-
getActiveUtilitySlot
public byte getActiveUtilitySlot() -
setActiveUtilitySlot
public void setActiveUtilitySlot(byte slot) -
getUtilityItem
-
getActiveToolsSlot
public byte getActiveToolsSlot() -
setActiveToolsSlot
public void setActiveToolsSlot(byte slot) -
getToolsItem
-
getSectionById
-
consumeIsDirty
public boolean consumeIsDirty() -
consumeNeedsSaving
public boolean consumeNeedsSaving() -
setEntity
-
sortStorage
-
setSortType
-
containsBrokenItem
public boolean containsBrokenItem() -
toPacket
- Specified by:
toPacketin interfaceNetworkSerializable<UpdatePlayerInventory>
-
doMigration
-
postDecode
private void postDecode() -
buildCombinedContains
private void buildCombinedContains() -
equals
-
hashCode
public int hashCode() -
toString
-
ensureCapacity
-
setUsingToolsItem
public void setUsingToolsItem(boolean value) -
usingToolsItem
public boolean usingToolsItem()
-