Interface InsertionOnlyStorage<T>
- All Superinterfaces:
Storage<T>
- All Known Implementing Classes:
EmptyItemFluidStorage
Deprecated.
Experimental feature, we reserve the right to remove or change it without further notice.
The transfer API is a complex addition, and we want to be able to correct possible design mistakes.
A
Storage that supports insertion, and not extraction.-
Method Summary
Modifier and TypeMethodDescriptiondefault longextract(T resource, long maxAmount, TransactionContext transaction)Deprecated.Try to extract up to some amount of a resource from this storage.default booleanDeprecated.Return false if callingStorage.extract(T, long, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext)will absolutely always return 0, or true otherwise or in doubt.Methods inherited from interface net.fabricmc.fabric.api.transfer.v1.storage.Storage
exactView, getVersion, insert, iterable, iterator, simulateExtract, simulateInsert, supportsInsertion
-
Method Details
-
supportsExtraction
default boolean supportsExtraction()Deprecated.Description copied from interface:StorageReturn false if callingStorage.extract(T, long, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext)will absolutely always return 0, or true otherwise or in doubt.Note: This function is meant to be used by pipes or other devices that can transfer resources to know if they should interact with this storage at all.
- Specified by:
supportsExtractionin interfaceStorage<T>
-
extract
Deprecated.Description copied from interface:StorageTry to extract up to some amount of a resource from this storage.- Specified by:
extractin interfaceStorage<T>- Parameters:
resource- The resource to extract. May not be blank.maxAmount- The maximum amount of resource to extract. May not be negative.transaction- The transaction this operation is part of.- Returns:
- A nonnegative integer not greater than maxAmount: the amount that was extracted.
-