Class SimpleItemContainer
java.lang.Object
com.hypixel.hytale.server.core.inventory.container.ItemContainer
com.hypixel.hytale.server.core.inventory.container.SimpleItemContainer
-
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 shortstatic final BuilderCodec<SimpleItemContainer> private FilterTypeprotected it.unimi.dsi.fastutil.shorts.Short2ObjectMap<ItemStack> protected final ReadWriteLockprivate final Map<FilterActionType, com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap<SlotFilter>> Fields inherited from class com.hypixel.hytale.server.core.inventory.container.ItemContainer
DEFAULT_ADD_ALL_OR_NOTHING, DEFAULT_EXACT_AMOUNT, DEFAULT_FILTER, DEFAULT_FULL_STACKS, DEFAULT_REMOVE_ALL_OR_NOTHING, externalChangeEventRegistry, internalChangeEventRegistry, LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddOrDropItemStack(ComponentAccessor<EntityStore> store, Ref<EntityStore> ref, ItemContainer itemContainer, short slot, ItemStack itemStack) static booleanaddOrDropItemStack(ComponentAccessor<EntityStore> store, Ref<EntityStore> ref, ItemContainer itemContainer, ItemStack itemStack) static booleanaddOrDropItemStacks(ComponentAccessor<EntityStore> store, Ref<EntityStore> ref, ItemContainer itemContainer, List<ItemStack> itemStacks) protected booleancantAddToSlot(short slot, ItemStack itemStack, ItemStack slotItemStack) protected booleancantDropFromSlot(short slot) protected booleancantMoveToSlot(ItemContainer fromContainer, short slotFrom) protected booleancantRemoveFromSlot(short slot) clone()booleanshortgetItemStack(short slot) static ItemContainergetNewContainer(short capacity) inthashCode()protected ClearTransactionprotected ItemStackinternal_getSlot(short slot) protected ItemStackinternal_removeSlot(short slot) protected ItemStackinternal_setSlot(short slot, ItemStack itemStack) booleanisEmpty()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) static booleantryAddOrderedOrDropItemStacks(ComponentAccessor<EntityStore> store, Ref<EntityStore> ref, ItemContainer itemContainer, List<ItemStack> itemStacks) protected <X,V> V writeAction(Function<X, V> action, X x) protected <V> VwriteAction(Supplier<V> action) 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
-
CODEC
-
capacity
protected short capacity -
lock
-
items
-
slotFilters
private final Map<FilterActionType,com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap<SlotFilter>> slotFilters -
globalFilter
-
-
Constructor Details
-
SimpleItemContainer
protected SimpleItemContainer() -
SimpleItemContainer
public SimpleItemContainer(short capacity) -
SimpleItemContainer
-
-
Method Details
-
readAction
- Specified by:
readActionin classItemContainer
-
readAction
- Specified by:
readActionin classItemContainer
-
writeAction
- Specified by:
writeActionin classItemContainer
-
writeAction
- Specified by:
writeActionin 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
-
getCapacity
public short getCapacity()- Specified by:
getCapacityin classItemContainer
-
internal_clear
- Specified by:
internal_clearin classItemContainer
-
clone
- Specified by:
clonein classItemContainer
-
isEmpty
public boolean isEmpty()- Overrides:
isEmptyin classItemContainer
-
setGlobalFilter
- Specified by:
setGlobalFilterin classItemContainer
-
setSlotFilter
- Specified by:
setSlotFilterin classItemContainer
-
getItemStack
- Overrides:
getItemStackin classItemContainer
-
equals
-
hashCode
public int hashCode() -
getNewContainer
-
addOrDropItemStack
public static boolean addOrDropItemStack(@Nonnull ComponentAccessor<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull ItemContainer itemContainer, @Nonnull ItemStack itemStack) -
addOrDropItemStack
public static boolean addOrDropItemStack(@Nonnull ComponentAccessor<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull ItemContainer itemContainer, short slot, @Nonnull ItemStack itemStack) -
addOrDropItemStacks
public static boolean addOrDropItemStacks(@Nonnull ComponentAccessor<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull ItemContainer itemContainer, List<ItemStack> itemStacks) -
tryAddOrderedOrDropItemStacks
public static boolean tryAddOrderedOrDropItemStacks(@Nonnull ComponentAccessor<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull ItemContainer itemContainer, List<ItemStack> itemStacks)
-