Class StorageImpl
java.lang.Object
com.refinedmods.refinedstorage.api.storage.StorageImpl
- All Implemented Interfaces:
ExtractableStorage
,InsertableStorage
,Storage
,StorageView
@API(status=STABLE,
since="2.0.0-milestone.1.0")
public class StorageImpl
extends Object
implements Storage
An implementation of a
Storage
which has a resource list as a backing list.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
extract
(ResourceKey resource, long amount, Action action, Actor actor) Extracts a resource from a storage.getAll()
long
long
insert
(ResourceKey resource, long amount, Action action, Actor actor) Inserts a resource into a storage.
-
Constructor Details
-
StorageImpl
-
StorageImpl
public StorageImpl()
-
-
Method Details
-
extract
Description copied from interface:ExtractableStorage
Extracts a resource from a storage.- Specified by:
extract
in 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:InsertableStorage
Inserts a resource into a storage.- Specified by:
insert
in 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:
getAll
in interfaceStorageView
- Returns:
- a list of resource amounts
-
getStored
public long getStored()- Specified by:
getStored
in interfaceStorageView
- Returns:
- the amount stored
-