Account for Unsuccessful Transactions with DataHolderBuilder.add(Key, value) #2392
Labels
status: needs triage
This label is automatically applied to new issues and pull requests to indicate they require triage
Following #2388, when using builders such as
ItemStack.Builder
the transaction result ofadd(Key, value)
is silently ignored. This includesadd
ing to readonly values as in that issue, but could also apply to custom data which fails to be applied.I don't really have any good proposed solutions; the ones I can think of are throwing an exception, adding a new method/argument which throws an exception, or adding a
buildResult()
method that returns aTuple<ItemStack, DataTransactionResult>
or similar (but I'm not sure how this accounts for multiple failures). I personally prefer throwing an exception for my use cases (as I'm often hardcoding this and expect it to work), but in general I would thinkbuildResult()
is likely better.The text was updated successfully, but these errors were encountered: