Package appeng.api.behaviors
Interface GenericInternalInventory
@Experimental
public interface GenericInternalInventory
Abstraction layer over the "generic" (meaning that it can accept any AEKey in each slot) inventory used by various
AE2 devices. This is exposed to allow addons to adapt them for foreign capabilities/API lookups.
-
Method Summary
Modifier and TypeMethodDescriptionvoidStart a new change notifications batch, deferring change notifications.booleanbooleanvoidendBatch()Finish the current batch and send any pending notification.voidFinish the current batch and suppress any pending notification.longextract(int slot, AEKey what, long amount, Actionable mode) Try to extract something from a given slot.longgetAmount(int slot) longgetCapacity(AEKeyType keyType) @Nullable AEKeygetKey(int slot) longgetMaxAmount(AEKey key) @Nullable GenericStackgetStack(int slot) longinsert(int slot, AEKey what, long amount, Actionable mode) Try to insert something into a given slot.booleanisAllowedIn(int slot, AEKey what) Return true if the key isof a supported typeand would pass a potential filter configured for the given slot.default booleanisSupportedType(AEKey what) Return true if the key would generally be allowed, ignoring the current state of the inventory.booleanisSupportedType(AEKeyType type) Return true if the key would generally be allowed, ignoring the current state of the inventory.voidonChange()Send a change notification manually, for example because the automatic notification was suppressed.voidsetStack(int slot, @Nullable GenericStack newStack) intsize()
-
Method Details
-
size
int size()- Returns:
- The number of slots in this inventory. Never changes.
-
getStack
-
getKey
-
getAmount
long getAmount(int slot) -
getMaxAmount
- Returns:
- The key-specific max amount (for items this takes the max stack size into account).
-
getCapacity
- Returns:
- The type-specific max amount (or an estimate if it depends on the stored item).
-
canInsert
boolean canInsert() -
canExtract
boolean canExtract() -
setStack
-
isSupportedType
Return true if the key would generally be allowed, ignoring the current state of the inventory. -
isSupportedType
Return true if the key would generally be allowed, ignoring the current state of the inventory. -
isAllowedIn
Return true if the key isof a supported typeand would pass a potential filter configured for the given slot. -
insert
Try to insert something into a given slot. -
extract
Try to extract something from a given slot. -
beginBatch
void beginBatch()Start a new change notifications batch, deferring change notifications. -
endBatch
void endBatch()Finish the current batch and send any pending notification. -
endBatchSuppressed
void endBatchSuppressed()Finish the current batch and suppress any pending notification. -
onChange
void onChange()Send a change notification manually, for example because the automatic notification was suppressed.
-