Class BlankVariantView<T extends TransferVariant<?>>
java.lang.Object
net.fabricmc.fabric.api.transfer.v1.storage.base.BlankVariantView<T>
- All Implemented Interfaces:
StorageView<T>
@Experimental
@Deprecated
public class BlankVariantView<T extends TransferVariant<?>>
extends Object
implements StorageView<T>
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 transfer variant storage view that contains a blank variant all the time (it's always empty), but may have a nonzero capacity.
This can be used to give capacity hints even if the storage is empty.
-
Constructor Summary
ConstructorDescriptionBlankVariantView(T blankVariant, long capacity)
Deprecated.Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionlong
extract(T resource, long maxAmount, TransactionContext transaction)
Deprecated.Try to extract a resource from this view.long
Deprecated.long
Deprecated.Deprecated.boolean
Deprecated.
-
Constructor Details
-
BlankVariantView
Deprecated.Create a new instance.- Throws:
IllegalArgumentException
- If the passedblankVariant
is not blank.
-
-
Method Details
-
extract
Deprecated.Description copied from interface:StorageView
Try to extract a resource from this view.- Specified by:
extract
in interfaceStorageView<T extends TransferVariant<?>>
- Returns:
- The amount that was extracted.
-
isResourceBlank
public boolean isResourceBlank()Deprecated.- Specified by:
isResourceBlank
in interfaceStorageView<T extends TransferVariant<?>>
- Returns:
true
if theStorageView.getResource()
contained in this storage view is blank, orfalse
otherwise.
-
getResource
Deprecated.- Specified by:
getResource
in interfaceStorageView<T extends TransferVariant<?>>
- Returns:
- The resource stored in this view. May not be blank if
StorageView.isResourceBlank()
isfalse
.
-
getAmount
public long getAmount()Deprecated.- Specified by:
getAmount
in interfaceStorageView<T extends TransferVariant<?>>
- Returns:
- The amount of
StorageView.getResource()
stored in this view.
-
getCapacity
public long getCapacity()Deprecated.- Specified by:
getCapacity
in interfaceStorageView<T extends TransferVariant<?>>
- Returns:
- The total amount of
StorageView.getResource()
that could be stored in this view, or an estimate of the number of resources that could be stored if this view has a blank resource.
-