Interface TransactionContext.CloseCallback
- All Known Implementing Classes:
SingleFluidStorage
,SingleStackStorage
,SingleVariantStorage
,SingleViewIterator
,SnapshotParticipant
- Enclosing interface:
- TransactionContext
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A callback that is invoked when a transaction is closed.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onClose
(TransactionContext transaction, TransactionContext.Result result) Perform an action when a transaction is closed.
-
Method Details
-
onClose
Perform an action when a transaction is closed.- Parameters:
transaction
- The closed transaction. OnlyTransactionContext.nestingDepth()
,TransactionContext.getOpenTransaction(int)
andTransactionContext.addOuterCloseCallback(net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext.OuterCloseCallback)
may be called on that transaction.TransactionContext.addCloseCallback(net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext.CloseCallback)
may additionally be called on parent transactions (accessed throughTransactionContext.getOpenTransaction(int)
for lower nesting depths).result
- The result of this transaction: whether it was committed or aborted.
-