added attempted fix for inventory pickup
This commit is contained in:
parent
e183efef3a
commit
b13738bbfd
@ -3,7 +3,17 @@ function sparktech.register_wrench(name, dictionary)
|
||||
local dig_stlye_alt = minetest.setting_getbool("spark_dig_stlye_alt")
|
||||
local on_use = nil
|
||||
if dig_stlye_alt then
|
||||
on_use = function() return nil end
|
||||
on_use = function(one, player, pointedobject)
|
||||
if pointedobject == nil or pointedobject["type"] ~= "object" or pointedobject["ref"] == nil then
|
||||
minetest.debug("not the one")
|
||||
minetest.debug(dump2(pointedobject))
|
||||
return nil
|
||||
end
|
||||
local inventory = pointedobject["ref"]:get_wielded_item()
|
||||
minetest.debug("the one!")
|
||||
minetest.debug(dump2(inventory))
|
||||
player:get_inventory():add_item("main",pointedobject["ref"]:get_wielded_item())
|
||||
end -- this should work, it doesnt, for some reason
|
||||
end
|
||||
local on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing["type"] == "node" then
|
||||
|
Loading…
x
Reference in New Issue
Block a user