Interface TransferPolicy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A gesture is decided transfer by transfer, in order: one transfer for a pickup, place, quick move out or
one-sided hotbar swap; one per target slot for a quick move in or a spread; a take-out then a put-in for a swap.
When a transfer that is not part of a swap is decided, the container's getters already reflect every earlier
transfer of the same gesture that was allowed, so a policy that caps the container by reading
SlotContainer.contents() cannot be bypassed by a multi-slot gesture. Both halves of a swap see the
container as it was before the gesture, and the swap is applied only if both are allowed in full.
TransferDecision.allowAtMost(int) limits the one transfer it answers. Listeners run after the whole
gesture. A policy must not call the container's mutators (setReadOnly, load, commit,
drain, end); doing so is not supported.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TransferPolicyallowAll()Allows every proposed transfer.decide(TransferRequest request)
-
Method Details
-
decide
-
allowAll
Allows every proposed transfer.
-