Package appeng.api.storage
Class SupplierStorage
java.lang.Object
appeng.api.storage.SupplierStorage
- All Implemented Interfaces:
MEStorage
Delegates all calls to a
MEStorage
returned by a supplier such that the underlying storage can change
dynamically. If the supplier returns a null value, this storage will appear empty and read-only.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
extract
(AEKey what, long amount, Actionable mode, IActionSource source) Extract the specified item from the ME Inventoryrequest a full report of all available items, storage.void
request a full report of all available items, storage.net.minecraft.network.chat.Component
long
insert
(AEKey what, long amount, Actionable mode, IActionSource source) Store new items, or simulate the addition of new items into the ME Inventory.boolean
isPreferredStorageFor
(AEKey what, IActionSource source) Returns whether this inventory is the preferred storage location for the given stack when being compared to other inventories of the same overall priority.
-
Constructor Details
-
SupplierStorage
-
-
Method Details
-
isPreferredStorageFor
Description copied from interface:MEStorage
Returns whether this inventory is the preferred storage location for the given stack when being compared to other inventories of the same overall priority. If for example an inventory already contains some amount of an item, it should be preferred over other inventories that don't when trying to store more of the item.- Specified by:
isPreferredStorageFor
in interfaceMEStorage
- Parameters:
source
- The source trying to find storage for stacks.
-
insert
Description copied from interface:MEStorage
Store new items, or simulate the addition of new items into the ME Inventory. -
extract
Description copied from interface:MEStorage
Extract the specified item from the ME Inventory -
getAvailableStacks
Description copied from interface:MEStorage
request a full report of all available items, storage.- Specified by:
getAvailableStacks
in interfaceMEStorage
- Parameters:
out
- The amounts for all available keys will be added to this tally.
-
getDescription
public net.minecraft.network.chat.Component getDescription()- Specified by:
getDescription
in interfaceMEStorage
- Returns:
- The type of storage represented by this object.
-
getAvailableStacks
Description copied from interface:MEStorage
request a full report of all available items, storage.- Specified by:
getAvailableStacks
in interfaceMEStorage
- Returns:
- a new list of this inventories content
-