1 minetest.register_globalstep(function()
2 if not minetest.settings:get_bool("autodupe") then return end
3 local player = minetest.localplayer
4 if not player then return end
5 local airs = minetest.find_nodes_near(player:get_pos(), 5, "air")
6 for _, p in ipairs(airs) do
7 local invstr = "nodemeta:" .. p.x .. "," .. p.y .. "," .. p.z
8 if minetest.get_inventory(invstr) then
9 local invact = InventoryAction("drop")
10 invact:from(invstr, "src", 1)
15 local furnaces = minetest.find_nodes_near(player:get_pos(), 5, "mcl_furnaces:furnace")
17 local index = player:get_wield_index()
18 for _, p in ipairs(furnaces) do
19 local inv = minetest.get_inventory("nodemeta:" .. p.x .. "," .. p.y .. "," .. p.z)
20 if inv and inv.src and inv.src[1]:get_name() ~= "" then
22 autotool.select_best_tool("mcl_furnaces:furnace")
29 player:set_wield_index(index)
30 minetest.close_formspec("")
34 minetest.register_cheat("AutoDupe", "World", "autodupe")