Interface RootStorage

All Superinterfaces:
ExtractableStorage, InsertableStorage, Storage, StorageView, TrackedStorage
All Known Subinterfaces:
FuzzyRootStorage, StorageNetworkComponent
All Known Implementing Classes:
PlatformStorageNetworkComponent, RootStorageImpl, com.refinedmods.refinedstorage.api.network.impl.storage.StorageNetworkComponentImpl

@API(status=STABLE, since="2.0.0-milestone.1.0") public interface RootStorage extends Storage, TrackedStorage
The entry-point for various storage operations. It acts as a storage, and is usually backed by a CompositeStorage.
  • Method Details

    • addListener

      void addListener(ResourceListListener listener)
      Adds a listener.
      Parameters:
      listener - the listener
    • removeListener

      void removeListener(ResourceListListener listener)
      Removes a listener.
      Parameters:
      listener - the listener
    • get

      long get(ResourceKey resource)
      Parameters:
      resource - the resource
      Returns:
      the amount stored, or zero if not stored
    • contains

      boolean contains(ResourceKey resource)
      Parameters:
      resource - the resource
      Returns:
      whether the storage contains the resource
    • sortSources

      void sortSources()
      Sorts the sources in the backing storage.
    • addSource

      void addSource(Storage source)
      Adds a source and resorts all the sources.
      Parameters:
      source - the source
    • removeSource

      void removeSource(Storage source)
      Removes a source .
      Parameters:
      source - the source
    • hasSource

      boolean hasSource(Predicate<Storage> matcher)
      Checks if a source is present.
      Parameters:
      matcher - a predicate
      Returns:
      whether the predicate matched