Class ItemStackItemContainer
java.lang.Object
com.hypixel.hytale.server.core.inventory.container.ItemContainer
com.hypixel.hytale.server.core.inventory.container.ItemStackItemContainer
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hypixel.hytale.server.core.inventory.container.ItemContainer
ItemContainer.ItemContainerChangeEvent, ItemContainer.TempItemData -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final shortstatic KeyedCodec<Short> static KeyedCodec<org.bson.BsonDocument> private FilterTypeprotected ItemStack[]static KeyedCodec<ItemStack[]> protected final shortprotected final ReadWriteLockprotected final ItemStackprotected final ItemContainerprivate final Map<FilterActionType, com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap<SlotFilter>> Fields inherited from class com.hypixel.hytale.server.core.inventory.container.ItemContainer
CODEC, DEFAULT_ADD_ALL_OR_NOTHING, DEFAULT_EXACT_AMOUNT, DEFAULT_FILTER, DEFAULT_FULL_STACKS, DEFAULT_REMOVE_ALL_OR_NOTHING, externalChangeEventRegistry, internalChangeEventRegistry, LOGGER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateItemStackItemContainer(ItemContainer parentContainer, short itemStackSlot, ItemStack originalItemStack, short capacity, ItemStack[] items) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancantAddToSlot(short slot, ItemStack itemStack, ItemStack slotItemStack) protected booleancantDropFromSlot(short slot) protected booleancantMoveToSlot(ItemContainer fromContainer, short slotFrom) protected booleancantRemoveFromSlot(short slot) clone()static ItemStackItemContainerensureConfiguredContainer(ItemContainer itemContainer, short slot, ItemStackContainerConfig config) static ItemStackItemContainerensureContainer(ItemContainer itemContainer, short slot, short capacity) shortstatic ItemStackItemContainergetContainer(ItemContainer itemContainer, short slot) getItemStack(short slot) shortprotected ClearTransactionprotected ItemStackinternal_getSlot(short slot) protected ItemStackinternal_removeSlot(short slot) protected ItemStackinternal_setSlot(short slot, ItemStack itemStack) booleanisEmpty()booleanstatic ItemStackItemContainermakeContainerWithCapacity(ItemContainer itemContainer, short slot, short capacity) protected <X,V> V readAction(Function<X, V> action, X x) protected <V> VreadAction(Supplier<V> action) voidsetGlobalFilter(FilterType globalFilter) voidsetSlotFilter(FilterActionType actionType, short slot, SlotFilter filter) private booleantestFilter(FilterActionType actionType, short slot, ItemStack itemStack) protected <X,V> V writeAction(Function<X, V> action, X x) protected <V> VwriteAction(Supplier<V> action) static voidwriteToItemStack(ItemContainer itemContainer, short slot, ItemStack originalItemStack, ItemStack[] items) Methods inherited from class com.hypixel.hytale.server.core.inventory.container.ItemContainer
addItemStack, addItemStack, addItemStacks, addItemStacks, addItemStacksOrdered, addItemStacksOrdered, addItemStacksOrdered, addItemStacksOrdered, addItemStackToSlot, addItemStackToSlot, canAddItemStack, canAddItemStack, canAddItemStacks, canAddItemStacks, canAddItemStackToSlot, canRemoveItemStack, canRemoveItemStack, canRemoveItemStacks, canRemoveItemStacks, canRemoveMaterial, canRemoveMaterial, canRemoveMaterials, canRemoveMaterials, canRemoveResource, canRemoveResource, canRemoveResources, canRemoveResources, canRemoveTag, canRemoveTag, clear, combineItemStacksIntoSlot, containsContainer, containsItemStacksStackableWith, copy, countItemStacks, doMigration, dropAllItemStacks, dropAllItemStacks, ensureContainerCapacity, forEach, forEachWithMeta, getMatchingResourceType, getNewContainer, getSlotMaterialsToRemove, internal_combineItemStacksIntoSlot, internal_moveAllItemStacksTo, internal_moveItemStackFromSlot, internal_moveItemStackFromSlot, internal_moveItemStackFromSlot, internal_removeItemStack, internal_replaceItemStack, internal_sortItems, internal_swapItems, internal_swapItems, moveAllItemStacksTo, moveAllItemStacksTo, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlot, moveItemStackFromSlotToSlot, moveItemStackFromSlotToSlot, quickStackTo, registerChangeEvent, registerChangeEvent, registerChangeEvent, removeAllItemStacks, removeItemStack, removeItemStack, removeItemStackFromSlot, removeItemStackFromSlot, removeItemStackFromSlot, removeItemStackFromSlot, removeItemStackFromSlot, removeItemStackFromSlot, removeItemStacks, removeItemStacks, removeMaterial, removeMaterial, removeMaterialFromSlot, removeMaterialFromSlot, removeMaterials, removeMaterials, removeMaterialsOrdered, removeMaterialsOrdered, removeMaterialsOrdered, removeResource, removeResource, removeResourceFromSlot, removeResourceFromSlot, removeResources, removeResources, removeTag, removeTag, removeTagFromSlot, removeTagFromSlot, replaceAll, replaceItemStackInSlot, sendUpdate, setItemStackForSlot, setItemStackForSlot, sortItems, swapItems, toPacket, toProtocolMap, validateQuantity, validateSlotIndex
-
Field Details
-
CONTAINER_CODEC
-
CAPACITY_CODEC
-
ITEMS_CODEC
-
lock
-
parentContainer
-
itemStackSlot
protected final short itemStackSlot -
originalItemStack
-
capacity
protected final short capacity -
items
-
slotFilters
private final Map<FilterActionType,com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap<SlotFilter>> slotFilters -
globalFilter
-
-
Constructor Details
-
ItemStackItemContainer
private ItemStackItemContainer(ItemContainer parentContainer, short itemStackSlot, ItemStack originalItemStack, short capacity, ItemStack[] items)
-
-
Method Details
-
getParentContainer
-
getItemStackSlot
public short getItemStackSlot() -
getOriginalItemStack
-
isItemStackValid
public boolean isItemStackValid() -
getCapacity
public short getCapacity()- Specified by:
getCapacityin classItemContainer
-
setGlobalFilter
- Specified by:
setGlobalFilterin classItemContainer
-
setSlotFilter
- Specified by:
setSlotFilterin classItemContainer
-
clone
- Specified by:
clonein classItemContainer
-
readAction
- Specified by:
readActionin classItemContainer
-
readAction
- Specified by:
readActionin classItemContainer
-
writeAction
- Specified by:
writeActionin classItemContainer
-
writeAction
- Specified by:
writeActionin classItemContainer
-
isEmpty
public boolean isEmpty()- Overrides:
isEmptyin classItemContainer
-
internal_clear
- Specified by:
internal_clearin classItemContainer
-
internal_getSlot
- Specified by:
internal_getSlotin classItemContainer
-
internal_setSlot
- Specified by:
internal_setSlotin classItemContainer
-
internal_removeSlot
- Specified by:
internal_removeSlotin classItemContainer
-
cantAddToSlot
- Specified by:
cantAddToSlotin classItemContainer
-
cantRemoveFromSlot
protected boolean cantRemoveFromSlot(short slot) - Specified by:
cantRemoveFromSlotin classItemContainer
-
cantDropFromSlot
protected boolean cantDropFromSlot(short slot) - Specified by:
cantDropFromSlotin classItemContainer
-
cantMoveToSlot
- Specified by:
cantMoveToSlotin classItemContainer
-
testFilter
-
getItemStack
- Overrides:
getItemStackin classItemContainer
-
writeToItemStack
public static void writeToItemStack(@Nonnull ItemContainer itemContainer, short slot, ItemStack originalItemStack, ItemStack[] items) -
getContainer
@Nullable public static ItemStackItemContainer getContainer(@Nonnull ItemContainer itemContainer, short slot) -
makeContainerWithCapacity
@Nonnull public static ItemStackItemContainer makeContainerWithCapacity(@Nonnull ItemContainer itemContainer, short slot, short capacity) -
ensureContainer
@Nullable public static ItemStackItemContainer ensureContainer(@Nonnull ItemContainer itemContainer, short slot, short capacity) -
ensureConfiguredContainer
@Nullable public static ItemStackItemContainer ensureConfiguredContainer(@Nonnull ItemContainer itemContainer, short slot, @Nonnull ItemStackContainerConfig config)
-