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 TypeMethodDescriptionvoid
Start a new change notifications batch, deferring change notifications.boolean
boolean
void
endBatch()
Finish the current batch and send any pending notification.void
Finish the current batch and suppress any pending notification.long
extract
(int slot, AEKey what, long amount, Actionable mode) Try to extract something from a given slot.long
getAmount
(int slot) long
getCapacity
(AEKeyType keyType) @Nullable AEKey
getKey
(int slot) long
getMaxAmount
(AEKey key) @Nullable GenericStack
getStack
(int slot) long
insert
(int slot, AEKey what, long amount, Actionable mode) Try to insert something into a given slot.boolean
isAllowedIn
(int slot, AEKey what) Return true if the key isof a supported type
and would pass a potential filter configured for the given slot.default boolean
isSupportedType
(AEKey what) Return true if the key would generally be allowed, ignoring the current state of the inventory.boolean
isSupportedType
(AEKeyType type) Return true if the key would generally be allowed, ignoring the current state of the inventory.void
onChange()
Send a change notification manually, for example because the automatic notification was suppressed.void
setStack
(int slot, @Nullable GenericStack newStack) int
size()
-
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 type
and 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.
-