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
ConstructorDescriptionExternalStorage
(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.boolean
long
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.void
onAddedIntoComposite
(ParentComposite parentComposite) Called by aCompositeStorage
when thisCompositeAwareChild
is added into the composite storage.void
onRemovedFromComposite
(ParentComposite parentComposite) Called by aCompositeStorage
when thisCompositeAwareChild
is removed from the composite storage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.refinedmods.refinedstorage.api.storage.composite.CompositeAwareChild
contains
-
Constructor Details
-
ExternalStorage
-
-
Method Details
-
getProvider
-
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
-
detectChanges
public boolean detectChanges() -
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
-
onAddedIntoComposite
Description copied from interface:CompositeAwareChild
Called by aCompositeStorage
when thisCompositeAwareChild
is added into the composite storage.- Specified by:
onAddedIntoComposite
in interfaceCompositeAwareChild
- Parameters:
parentComposite
- the composite storage that thisCompositeAwareChild
is contained in
-
onRemovedFromComposite
Description copied from interface:CompositeAwareChild
Called by aCompositeStorage
when thisCompositeAwareChild
is removed from the composite storage.- Specified by:
onRemovedFromComposite
in interfaceCompositeAwareChild
- Parameters:
parentComposite
- the composite storage that thisCompositeAwareChild
is/was contained in
-
compositeInsert
public CompositeAwareChild.Amount compositeInsert(ResourceKey resource, long amount, Action action, Actor actor) Description copied from interface:CompositeAwareChild
Inserts a resource into a storage.- Specified by:
compositeInsert
in 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:CompositeAwareChild
Extracts a resource from a storage.- Specified by:
compositeExtract
in 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
-