@@ 2,6 2,23 @@ local modname = "falling_nodes"
local utils = dofile(minetest.get_modpath(modname) .. "/utils.lua")
+falling_nodes.registered_materials = {}
+
+function falling_nodes.register_material(name, original_def)
+ local def = table.copy(original_def)
+ falling_nodes.registered_materials[name] = {}
+ -- TODO validation
+ for _,field in ipairs {
+ } do
+ falling_nodes.registered_materials[name][field] = def[field]
+ def[field] = nil
+ end
+ if not def.groups then def.groups = {} end
+ def.groups["falling_nodes:material"] = 1
+ def.groups.dig_immediate = 3
+ minetest.register_node(name, def)
+end
+
minetest.register_node("falling_nodes:sand", {
description = "Sand",
tiles = {"falling_nodes_sand.png"},