~fgaz/minetest-falling_nodes

e2baedad108d3755069ebfcf08925a990af70711 — Francesco Gazzetta 6 months ago bc3f7e6 prerelease-2024-04-06
Add void
2 files changed, 29 insertions(+), 0 deletions(-)

M mods/falling_nodes/materials.lua
A mods/falling_nodes/textures/falling_nodes_void.png
M mods/falling_nodes/materials.lua => mods/falling_nodes/materials.lua +29 -0
@@ 121,6 121,35 @@ minetest.register_abm {
  action = action_clone,
}

minetest.register_node("falling_nodes:void", {
  description = "Void",
  tiles = {"falling_nodes_void.png"},
  groups = {
    ["falling_nodes:material"] = 1,
    dig_immediate = 3,
  },
})

local function action_void(pos)
  for _,p in ipairs(utils.get_neighbors(pos)) do
    local node = minetest.get_node(p)
    if minetest.get_item_group(node.name, "falling_nodes:material") == 1 and
       node.name ~= "falling_nodes:void" then
      minetest.remove_node(p)
    end
  end
end

minetest.register_abm {
  label = "Void",
  nodenames = {"falling_nodes:void"},
  neighbors = {"group:falling_nodes:material"},
  interval = minetest.settings:get("abm_interval") * 1,
  chance = 1,
  catch_up = false,
  action = action_void,
}

minetest.register_node("falling_nodes:oil", {
  description = "Oil",
  tiles = {"falling_nodes_oil.png"},

A mods/falling_nodes/textures/falling_nodes_void.png => mods/falling_nodes/textures/falling_nodes_void.png +0 -0