mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 23:43:45 +01:00
fix not being able to pick up dropped objects while wielding dye
This commit is contained in:
parent
295cd027f2
commit
34299b01a0
7
init.lua
7
init.lua
@ -342,7 +342,12 @@ end
|
|||||||
|
|
||||||
function unifieddyes.on_use(itemstack, player, pointed_thing)
|
function unifieddyes.on_use(itemstack, player, pointed_thing)
|
||||||
|
|
||||||
if not pointed_thing or pointed_thing.type == "nothing" then return end -- if "using" the dye on air
|
if pointed_thing and pointed_thing.type == "object" then
|
||||||
|
pointed_thing.ref:punch(player, 0, itemstack:get_tool_capabilities())
|
||||||
|
return player:get_wielded_item() -- punch may modified the wielded item, load the new and return it
|
||||||
|
end
|
||||||
|
|
||||||
|
if not (pointed_thing and pointed_thing.type == "node") then return end -- if "using" the dye not on a node
|
||||||
|
|
||||||
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user