1 function basic_dump2(o)
2 if type(o) == "number" then
4 elseif type(o) == "string" then
5 return string.format("%q", o)
6 elseif type(o) == "boolean" then
8 elseif type(o) == "function" then
10 elseif type(o) == "userdata" then
12 elseif type(o) == "nil" then
15 error("cannot dump a " .. type(o))
20 function dump2(o, name, dumped)
24 if type(o) == "number" or type(o) == "string" or type(o) == "boolean"
25 or type(o) == "function" or type(o) == "nil"
26 or type(o) == "userdata" then
27 io.write(basic_dump2(o), "\n")
28 elseif type(o) == "table" then
30 io.write(dumped[o], "\n")
33 io.write("{}\n") -- new table
34 for k,v in pairs(o) do
35 local fieldname = string.format("%s[%s]", name, basic_dump2(k))
36 dump2(v, fieldname, dumped)
40 error("cannot dump a " .. type(o))
45 function dump(o, dumped)
47 if type(o) == "number" then
49 elseif type(o) == "string" then
50 return string.format("%q", o)
51 elseif type(o) == "table" then
53 return "<circular reference>"
57 for k,v in pairs(o) do
58 t[#t+1] = "" .. k .. " = " .. dump(v, dumped)
60 return "{" .. table.concat(t, ", ") .. "}"
61 elseif type(o) == "boolean" then
63 elseif type(o) == "function" then
65 elseif type(o) == "userdata" then
67 elseif type(o) == "nil" then
70 error("cannot dump a " .. type(o))
76 -- Built-in node definitions. Also defined in C.
79 minetest.register_nodedef_defaults({
80 -- name intentionally not defined here
83 tile_images = {"unknown_block.png"},
84 inventory_image = "unknown_block.png",
86 {image="", backface_culling=true},
87 {image="", backface_culling=true},
90 post_effect_color = {a=0, r=0, g=0, b=0},
92 is_ground_content = false,
93 light_propagates = false,
94 sunlight_propagates = false,
100 wall_mounted = false,
101 often_contains_mineral = false,
104 extra_dug_item_rarity = 2,
106 liquid_type = "none",
107 liquid_alternative_flowing = "",
108 liquid_alternative_source = "",
109 liquid_viscosity = 0,
111 damage_per_second = 0,
112 selection_box = {type="regular"},
114 diggablity = "normal",
121 cookresult_item = "", -- Cannot be cooked
122 furnace_cooktime = 3.0,
123 furnace_burntime = -1, -- Cannot be used as fuel
126 minetest.register_node("air", {
127 drawtype = "airlike",
129 light_propagates = true,
130 sunlight_propagates = true,
135 air_equivalent = true,
138 minetest.register_node("ignore", {
139 drawtype = "airlike",
141 light_propagates = false,
142 sunlight_propagates = false,
146 buildable_to = true, -- A way to remove accidentally placed ignores
147 air_equivalent = true,