tutorial:transfer-api_storage
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:transfer-api_storage [2021/10/30 10:21] – technici4n | tutorial:transfer-api_storage [2021/10/30 10:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Fabric Transfer API: Understanding Storage<T> ===== | + | ===== Fabric Transfer API: Understanding Storage<FluidVariant> ===== |
//This article is part of a series on the Fabric Transfer API. [[tutorial: | //This article is part of a series on the Fabric Transfer API. [[tutorial: | ||
Line 92: | Line 92: | ||
if (view.isResourceBlank()) continue; // This means that the view contains no resource, represented by FluidVariant.blank(). | if (view.isResourceBlank()) continue; // This means that the view contains no resource, represented by FluidVariant.blank(). | ||
FluidVariant storedResource = view.getResource(); | FluidVariant storedResource = view.getResource(); | ||
+ | if (!filter.test(storedResource)) continue; // The filter rejected this resource, skip it. | ||
// If you want to extract any amount <= view.getAmount(), | // If you want to extract any amount <= view.getAmount(), | ||
Line 104: | Line 105: | ||
nestedTransaction.commit(); | nestedTransaction.commit(); | ||
} else { | } else { | ||
- | // If we do nothing, the extraction is cancelled immediately when nestedTransaction is closed. | + | // If we do nothing, the extraction is cancelled immediately when nestedTransaction is closed |
} | } | ||
} | } |
tutorial/transfer-api_storage.1635589312.txt.gz · Last modified: 2021/10/30 10:21 by technici4n