aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/helpers/helper_moveaction.lua
diff options
context:
space:
mode:
authorsavilli <78875209+savilli@users.noreply.github.com>2022-09-27 22:22:11 +0200
committerGitHub <noreply@github.com>2022-09-27 16:22:11 -0400
commit907dcdcf7bb513ecfeb1c988f071f497dcfbf765 (patch)
tree5ef19550e97f876f9a1d5eadbedc4c4de879d8a8 /src/unittest/helpers/helper_moveaction.lua
parent3f801bc096077a91094087fab4a4557198429851 (diff)
downloadminetest-907dcdcf7bb513ecfeb1c988f071f497dcfbf765.tar.xz
Add unittests for item movement code (#11885)
Diffstat (limited to 'src/unittest/helpers/helper_moveaction.lua')
-rw-r--r--src/unittest/helpers/helper_moveaction.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unittest/helpers/helper_moveaction.lua b/src/unittest/helpers/helper_moveaction.lua
new file mode 100644
index 000000000..8cffe01b8
--- /dev/null
+++ b/src/unittest/helpers/helper_moveaction.lua
@@ -0,0 +1,11 @@
+minetest.register_allow_player_inventory_action(function(player, action, inventory, info)
+ if info.stack:get_name() == "default:water" then
+ return 0
+ end
+
+ if info.stack:get_name() == "default:lava" then
+ return 5
+ end
+
+ return info.stack:get_count()
+end)