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:22] – technici4n | tutorial:transfer-api_storage [2021/10/30 10:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
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.txt · Last modified: 2021/10/30 10:25 by 127.0.0.1