summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2021-02-21 20:02:23 +0100
committerGitHub <noreply@github.com>2021-02-21 20:02:23 +0100
commit051e4c2b00a30c496b5545a6f0b01c9a14e937a4 (patch)
tree760607f2f8033c1c066fa313a73555ee941b00ee /games
parentc12e9cdcba6b4183de6df4fd05f61a06f804642c (diff)
downloadminetest-051e4c2b00a30c496b5545a6f0b01c9a14e937a4.tar.gz
minetest-051e4c2b00a30c496b5545a6f0b01c9a14e937a4.tar.bz2
minetest-051e4c2b00a30c496b5545a6f0b01c9a14e937a4.zip
Fix wrong reported item counts for inventory actions using Shift-Move (#10930)
Diffstat (limited to 'games')
-rw-r--r--games/devtest/mods/chest/init.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/games/devtest/mods/chest/init.lua b/games/devtest/mods/chest/init.lua
index fc92bfdd1..5798c13e7 100644
--- a/games/devtest/mods/chest/init.lua
+++ b/games/devtest/mods/chest/init.lua
@@ -23,6 +23,18 @@ minetest.register_node("chest:chest", {
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "Allow put: " .. stack:to_string())
+ return stack:get_count()
+ end,
+ allow_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "Allow take: " .. stack:to_string())
+ return stack:get_count()
+ end,
+ on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "On put: " .. stack:to_string())
+ end,
+ on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.chat_send_player(player:get_player_name(), "On take: " .. stack:to_string())
+ end,
})
-
-