Prevent pummeling non-single stacks.

Allowing this could let you pound a whole stack of loose sand
into a single node of regular sand.
This commit is contained in:
Aaron Suen 2019-01-05 21:33:15 -05:00
parent 82d88b2e42
commit 6d5432bd6b

View File

@ -11,7 +11,8 @@ local function invdef(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack("solo", 1)
if not stack or stack:is_empty() then return end
if not stack or stack:is_empty()
or stack:get_count() ~= 1 then return end
return minetest.registered_items[stack:get_name()]
end