minetest-gamemode-orion/mods/sparkdebug/lua/bigstick.lua

30 lines
637 B
Lua

local NAME = minetest.get_current_modname()
local dictionary = {}
local on_place = function(itemstack, placer, pointed_thing)
if pointed_thing["type"] == "node" then
for x=-1,1 do
for y=-1,1 do
for z=-1,1 do
sparktech.dig_node(
{
x = pointed_thing["under"]["x"] + x,
y = pointed_thing["under"]["y"] + y,
z = pointed_thing["under"]["z"] + z
},
placer:get_inventory(),
"main",
false,
placer
)
end
end
end
end
return itemstack
end
dictionary["on_place"] = on_place
dictionary["inventory_image"] = NAME .. "_bigstick.png"
minetest.register_tool(NAME .. ":bigstick", dictionary)