User Tools

Site Tools


tutorial:transfer-api_storage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tutorial:transfer-api_storage [2021/10/30 10:22] technici4ntutorial:transfer-api_storage [2021/10/30 10:25] technici4n
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(); // Current resource  FluidVariant storedResource = view.getResource(); // Current resource
 + if (!filter.test(storedResource)) continue; // The filter rejected this resource, skip it.
  
  // If you want to extract any amount <= view.getAmount(), do this.  // If you want to extract any amount <= view.getAmount(), do this.
Line 104: Line 105:
  nestedTransaction.commit(); // Validate the nestedTransaction: the outer one will have to committed as well to validate this change.  nestedTransaction.commit(); // Validate the nestedTransaction: the outer one will have to committed as well to validate this change.
  } 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 at the end of the try { ... } block.
  }  }
  }  }
tutorial/transfer-api_storage.txt · Last modified: 2021/10/30 10:25 by 127.0.0.1