Class AbstractProxyStorage
java.lang.Object
com.refinedmods.refinedstorage.api.storage.AbstractProxyStorage
- All Implemented Interfaces:
ExtractableStorage,InsertableStorage,Storage,StorageView
- Direct Known Subclasses:
LimitedStorageImpl,PriorityStorage,TrackedStorageImpl
@API(status=STABLE,
since="2.0.0-milestone.1.2")
public abstract class AbstractProxyStorage
extends Object
implements Storage
This is a utility class to easily decorate a
Storage.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongextract(ResourceKey resource, long amount, Action action, Actor actor) Extracts a resource from a storage.getAll()longlonginsert(ResourceKey resource, long amount, Action action, Actor actor) Inserts a resource into a storage.
-
Field Details
-
delegate
-
-
Constructor Details
-
AbstractProxyStorage
- Parameters:
delegate- the storage to delegate operations to, may not be null
-
-
Method Details
-
extract
Description copied from interface:ExtractableStorageExtracts a resource from a storage.- Specified by:
extractin interfaceExtractableStorage- Parameters:
resource- the resource, may not be nullamount- the amount, must be larger than 0action- the mode of extractionactor- the source- Returns:
- the amount extracted
-
insert
Description copied from interface:InsertableStorageInserts a resource into a storage.- Specified by:
insertin interfaceInsertableStorage- Parameters:
resource- the resource, may not be nullamount- the amount, must be larger than 0action- the mode of insertionactor- the source- Returns:
- the amount inserted
-
getAll
- Specified by:
getAllin interfaceStorageView- Returns:
- a list of resource amounts
-
getStored
public long getStored()- Specified by:
getStoredin interfaceStorageView- Returns:
- the amount stored
-