Package appeng.api.networking.storage
Interface IStorageService
- All Superinterfaces:
IGridService
Grid-wide storage services for all
AEKeyType.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aIStorageProviderthat is not associated with a specificIGridNode.Returns the cached content of the network inventory.voidInvalidates thecached inventory, causing it to be re-calculated the next time it is accessed.voidrefreshGlobalStorageProvider(IStorageProvider provider) Refreshes the storage mounts provided by a global storage provider.voidRefreshes the storage mounts provided by anodethrough itsIStorageProvider.voidRemove a provider added withaddGlobalStorageProvider(IStorageProvider).
-
Method Details
-
getInventory
MEStorage getInventory()- Returns:
- The network inventory.
-
getCachedInventory
KeyCounter getCachedInventory()Returns the cached content of the network inventory. The cache is updated at most once per tick. Changes to network inventory will not be reflected by the cache until the next tick. Should be used when slightly outdated content is not a big deal. Preferred togetInventory().getAvailableStacks()for performance reasons.- Returns:
- The cached stacks of this network. Does not return a copy. Do not modify!
-
addGlobalStorageProvider
Adds aIStorageProviderthat is not associated with a specificIGridNode. This is for adding storage provided byIGridServices for examples. THIS IT NOT FOR USE BYNODESTHAT PROVIDE THEIStorageProviderSERVICE. Those are automatically handled by the storage system.- Parameters:
cc- to be added cell provider
-
removeGlobalStorageProvider
Remove a provider added withaddGlobalStorageProvider(IStorageProvider). -
refreshNodeStorageProvider
Refreshes the storage mounts provided by anodethrough itsIStorageProvider.- Throws:
IllegalArgumentException- If the given node is not part of this grid, or did not provideIStorageProvider.
-
refreshGlobalStorageProvider
Refreshes the storage mounts provided by a global storage provider.- Throws:
IllegalArgumentException- If the given provider has not beenregistered.
-
invalidateCache
void invalidateCache()Invalidates thecached inventory, causing it to be re-calculated the next time it is accessed.THIS IS A PERFORMANCE INTENSIVE OPERATION AND SHOULD BE USED WITH CARE.
-