mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 08:05:18 +02:00
Inventory: Fix order of callbacks when swapping items
This commit is contained in:
@@ -3640,6 +3640,19 @@ Player Inventory lists
|
||||
* Is not created automatically, use `InvRef:set_size`
|
||||
* Is only used to enhance the empty hand's tool capabilities
|
||||
|
||||
ItemStack transaction order
|
||||
---------------------------
|
||||
|
||||
This list describes the situation for non-empty ItemStacks in both slots
|
||||
that cannot be stacked at all, hence triggering an ItemStack swap operation.
|
||||
Put/take callbacks on empty ItemStack are not executed.
|
||||
|
||||
1. The "allow take" and "allow put" callbacks are each run once for the source
|
||||
and destination inventory.
|
||||
2. The allowed ItemStacks are exchanged.
|
||||
3. The "on take" callbacks are run for the source and destination inventories
|
||||
4. The "on put" callbacks are run for the source and destination inventories
|
||||
|
||||
Colors
|
||||
======
|
||||
|
||||
|
Reference in New Issue
Block a user