mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Add unittests for item movement code (#11885)
This commit is contained in:
11
src/unittest/helpers/helper_moveaction.lua
Normal file
11
src/unittest/helpers/helper_moveaction.lua
Normal file
@@ -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)
|
Reference in New Issue
Block a user