Class ExternalStorage
java.lang.Object
com.refinedmods.refinedstorage.api.storage.external.ExternalStorage
- All Implemented Interfaces:
CompositeAwareChild,ExtractableStorage,InsertableStorage,Storage,StorageView
@API(status=STABLE,
since="2.0.0-milestone.2.4")
public class ExternalStorage
extends Object
implements CompositeAwareChild
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.refinedmods.refinedstorage.api.storage.composite.CompositeAwareChild
CompositeAwareChild.Amount -
Constructor Summary
ConstructorsConstructorDescriptionExternalStorage(ExternalStorageProvider provider, ExternalStorageListener listener) -
Method Summary
Modifier and TypeMethodDescriptioncompositeExtract(ResourceKey resource, long amount, Action action, Actor actor) Extracts a resource from a storage.compositeInsert(ResourceKey resource, long amount, Action action, Actor actor) Inserts a resource into a storage.booleanlongextract(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.voidonAddedIntoComposite(ParentComposite parentComposite) Called by aCompositeStoragewhen thisCompositeAwareChildis added into the composite storage.voidonRemovedFromComposite(ParentComposite parentComposite) Called by aCompositeStoragewhen thisCompositeAwareChildis removed from the composite storage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.refinedmods.refinedstorage.api.storage.composite.CompositeAwareChild
contains
-
Constructor Details
-
ExternalStorage
-
-
Method Details
-
getProvider
-
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
-
detectChanges
public boolean detectChanges() -
getAll
- Specified by:
getAllin interfaceStorageView- Returns:
- a list of resource amounts
-
getStored
public long getStored()- Specified by:
getStoredin interfaceStorageView- Returns:
- the amount stored
-
onAddedIntoComposite
Description copied from interface:CompositeAwareChildCalled by aCompositeStoragewhen thisCompositeAwareChildis added into the composite storage.- Specified by:
onAddedIntoCompositein interfaceCompositeAwareChild- Parameters:
parentComposite- the composite storage that thisCompositeAwareChildis contained in
-
onRemovedFromComposite
Description copied from interface:CompositeAwareChildCalled by aCompositeStoragewhen thisCompositeAwareChildis removed from the composite storage.- Specified by:
onRemovedFromCompositein interfaceCompositeAwareChild- Parameters:
parentComposite- the composite storage that thisCompositeAwareChildis/was contained in
-
compositeInsert
public CompositeAwareChild.Amount compositeInsert(ResourceKey resource, long amount, Action action, Actor actor) Description copied from interface:CompositeAwareChildInserts a resource into a storage.- Specified by:
compositeInsertin interfaceCompositeAwareChild- 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
-
compositeExtract
public CompositeAwareChild.Amount compositeExtract(ResourceKey resource, long amount, Action action, Actor actor) Description copied from interface:CompositeAwareChildExtracts a resource from a storage.- Specified by:
compositeExtractin interfaceCompositeAwareChild- 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
-