}
})
---
--- Crafting (tool repair)
---
+-- Tool repair
minetest.register_craft({
type = "toolrepair",
additional_wear = -0.02,
{name="", gain=0.5}
--table.dug = table.dug or
-- {name="default_dirt_break", gain=0.5}
+ table.place = table.place or
+ {name="default_grass_footstep", gain=0.5}
default.node_sound_defaults(table)
return table
end
return table
end
---
+-- Register nodes
minetest.register_node("default:stone", {
description = "Stone",
tiles ={"default_stone.png"},
- is_ground_content = true,
groups = {cracky=3},
drop = 'default:cobble',
legacy_mineral = true,
minetest.register_node("default:stone_with_coal", {
description = "Stone with coal",
tiles ={"default_stone.png^default_mineral_coal.png"},
- is_ground_content = true,
groups = {cracky=3},
drop = 'default:coal_lump',
sounds = default.node_sound_stone_defaults(),
minetest.register_node("default:stone_with_iron", {
description = "Stone with iron",
tiles ={"default_stone.png^default_mineral_iron.png"},
- is_ground_content = true,
groups = {cracky=3},
drop = 'default:iron_lump',
sounds = default.node_sound_stone_defaults(),
minetest.register_node("default:dirt_with_grass", {
description = "Dirt with grass",
tiles ={"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
- is_ground_content = true,
- groups = {crumbly=3},
+ groups = {crumbly=3, soil=1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
minetest.register_node("default:dirt_with_grass_footsteps", {
description = "Dirt with grass and footsteps",
tiles ={"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
- is_ground_content = true,
- groups = {crumbly=3},
+ groups = {crumbly=3, soil=1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
minetest.register_node("default:dirt", {
description = "Dirt",
tiles ={"default_dirt.png"},
- is_ground_content = true,
- groups = {crumbly=3},
+ groups = {crumbly=3, soil=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("default:sand", {
description = "Sand",
tiles ={"default_sand.png"},
- is_ground_content = true,
groups = {crumbly=3, falling_node=1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:gravel", {
description = "Gravel",
tiles ={"default_gravel.png"},
- is_ground_content = true,
groups = {crumbly=2, falling_node=1},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45},
minetest.register_node("default:sandstone", {
description = "Sandstone",
tiles ={"default_sandstone.png"},
- is_ground_content = true,
groups = {crumbly=2,cracky=2},
drop = 'default:sand',
sounds = default.node_sound_stone_defaults(),
minetest.register_node("default:clay", {
description = "Clay",
tiles ={"default_clay.png"},
- is_ground_content = true,
groups = {crumbly=3},
drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults({
minetest.register_node("default:brick", {
description = "Brick",
tiles ={"default_brick.png"},
- is_ground_content = true,
groups = {cracky=3},
drop = 'default:clay_brick 4',
sounds = default.node_sound_stone_defaults(),
minetest.register_node("default:tree", {
description = "Tree",
tiles ={"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
- is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:jungletree", {
description = "Jungle Tree",
tiles ={"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
- is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
sounds = default.node_sound_leaves_defaults(),
})
+minetest.register_node("default:jungleleaves", {
+ description = "Jungle Leaves",
+ drawtype = "allfaces_optional",
+ waving = 1,
+ visual_scale = 1.3,
+ tiles = {"default_jungleleaves.png"},
+ paramtype = "light",
+ groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
+ sounds = default.node_sound_leaves_defaults(),
+})
+
minetest.register_node("default:cactus", {
description = "Cactus",
tiles ={"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
- is_ground_content = true,
groups = {snappy=2,choppy=3},
sounds = default.node_sound_wood_defaults(),
})
inventory_image = "default_papyrus.png",
wield_image = "default_papyrus.png",
paramtype = "light",
- is_ground_content = true,
walkable = false,
groups = {snappy=3},
sounds = default.node_sound_leaves_defaults(),
minetest.register_node("default:bookshelf", {
description = "Bookshelf",
tiles ={"default_wood.png", "default_wood.png", "default_bookshelf.png"},
- is_ground_content = true,
groups = {snappy=2,choppy=3,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
})
description = "Glass",
drawtype = "glasslike",
tiles ={"default_glass.png"},
- inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
sunlight_propagates = true,
- is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(),
})
inventory_image = "default_fence.png",
wield_image = "default_fence.png",
paramtype = "light",
- is_ground_content = true,
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
inventory_image = "default_rail.png",
wield_image = "default_rail.png",
paramtype = "light",
- is_ground_content = true,
walkable = false,
selection_box = {
type = "fixed",
wield_image = "default_ladder.png",
paramtype = "light",
paramtype2 = "wallmounted",
- is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
minetest.register_node("default:wood", {
description = "Wood",
tiles ={"default_wood.png"},
- is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:mese", {
description = "Mese",
tiles ={"default_mese.png"},
- is_ground_content = true,
groups = {cracky=1,level=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("default:cloud", {
description = "Cloud",
tiles ={"default_cloud.png"},
- is_ground_content = true,
sounds = default.node_sound_defaults(),
})
pointable = false,
diggable = false,
buildable_to = true,
+ is_ground_content = false,
+ drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
pointable = false,
diggable = false,
buildable_to = true,
+ is_ground_content = false,
+ drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
pointable = false,
diggable = false,
buildable_to = true,
+ is_ground_content = false,
+ drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
pointable = false,
diggable = false,
buildable_to = true,
+ is_ground_content = false,
+ drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
+ is_ground_content = false,
walkable = false,
light_source = LIGHT_MAX-1,
selection_box = {
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
+ is_ground_content = false,
walkable = false,
selection_box = {
type = "wallmounted",
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
on_construct = function(pos)
- --local n = minetest.env:get_node(pos)
- local meta = minetest.env:get_meta(pos)
+ --local n = minetest.get_node(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[text;;${text}]")
meta:set_string("infotext", "\"\"")
end,
on_receive_fields = function(pos, formname, fields, sender)
--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
fields.text = fields.text or ""
print((sender:get_player_name() or "").." wrote \""..fields.text..
"\" to sign at "..minetest.pos_to_string(pos))
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
+ is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "list[current_player;main;0,5;8,4;]" ..
+ "listring[]")
meta:set_string("infotext", "Chest")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
end,
can_dig = function(pos,player)
- local meta = minetest.env:get_meta(pos);
+ local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
+ is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Locked Chest (owned by "..
meta:get_string("owner")..")")
end,
on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "list[current_player;main;0,5;8,4;]" ..
+ "listring[]")
meta:set_string("infotext", "Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
end,
can_dig = function(pos,player)
- local meta = minetest.env:get_meta(pos);
+ local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
- "list[current_player;main;0,5;8,4;]"
+ "list[current_player;main;0,5;8,4;]" ..
+ "listring[current_name;dst]" ..
+ "listring[current_player;main]" ..
+ "listring[current_name;src]" ..
+ "listring[current_player;main]"
minetest.register_node("default:furnace", {
description = "Furnace",
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
+ is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Furnace")
local inv = meta:get_inventory()
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
- local meta = minetest.env:get_meta(pos);
+ local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
drop = "default:furnace",
groups = {cracky=2},
legacy_facedir_simple = true,
+ is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Furnace");
local inv = meta:get_inventory()
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
- local meta = minetest.env:get_meta(pos);
+ local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
end,
})
-function hacky_swap_node(pos,name)
- local node = minetest.env:get_node(pos)
- local meta = minetest.env:get_meta(pos)
- local meta0 = meta:to_table()
+function swap_node(pos,name)
+ local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
- local meta0 = meta:to_table()
- minetest.env:set_node(pos,node)
- meta = minetest.env:get_meta(pos)
- meta:from_table(meta0)
+ minetest.swap_node(pos, node)
end
minetest.register_abm({
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Furnace active: "..percent.."%")
- hacky_swap_node(pos,"default:furnace_active")
+ swap_node(pos,"default:furnace_active")
meta:set_string("formspec",
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
- "list[current_player;main;0,5;8,4;]")
+ "list[current_player;main;0,5;8,4;]" ..
+ "listring[current_name;dst]" ..
+ "listring[current_player;main]" ..
+ "listring[current_name;src]" ..
+ "listring[current_player;main]")
return
end
if fuel.time <= 0 then
meta:set_string("infotext","Furnace out of fuel")
- hacky_swap_node(pos,"default:furnace")
+ swap_node(pos,"default:furnace")
meta:set_string("formspec", default.furnace_inactive_formspec)
return
end
if cooked.item:is_empty() then
if was_active then
meta:set_string("infotext","Furnace is empty")
- hacky_swap_node(pos,"default:furnace")
+ swap_node(pos,"default:furnace")
meta:set_string("formspec", default.furnace_inactive_formspec)
end
return
minetest.register_node("default:cobble", {
description = "Cobble",
tiles ={"default_cobble.png"},
- is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:mossycobble", {
description = "Mossy Cobble",
tiles ={"default_mossycobble.png"},
- is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:steelblock", {
description = "Steel Block",
tiles ={"default_steel_block.png"},
- is_ground_content = true,
groups = {snappy=1,bendy=2},
sounds = default.node_sound_stone_defaults(),
})
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
+ is_ground_content = false,
sounds = default.node_sound_defaults(),
})
description = "Nyancat Rainbow",
tiles ={"default_nc_rb.png"},
inventory_image = "default_nc_rb.png",
+ is_ground_content = false,
groups = {cracky=2},
sounds = default.node_sound_defaults(),
})
sounds = default.node_sound_defaults(),
})
+minetest.register_node("default:dirt_with_snow", {
+ description = "Dirt with Snow",
+ tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
+ groups = {crumbly=3,soil=1},
+ drop = 'default:dirt',
+ sounds = default.node_sound_dirt_defaults(),
+})
+
+minetest.register_node("default:snow", {
+ description = "Snow",
+ tiles = {"default_snow.png"},
+ inventory_image = "default_snowball.png",
+ wield_image = "default_snowball.png",
+ paramtype = "light",
+ buildable_to = true,
+ drawtype = "nodebox",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
+ },
+ },
+ groups = {crumbly=3,falling_node=1},
+ sounds = default.node_sound_dirt_defaults(),
+
+ on_construct = function(pos)
+ pos.y = pos.y - 1
+ if minetest.get_node(pos).name == "default:dirt_with_grass" then
+ minetest.set_node(pos, {name="default:dirt_with_snow"})
+ end
+ end,
+})
+
+minetest.register_node("default:snowblock", {
+ description = "Snow Block",
+ tiles = {"default_snow.png"},
+ groups = {crumbly=3},
+ sounds = default.node_sound_dirt_defaults(),
+})
+
+minetest.register_node("default:ice", {
+ description = "Ice",
+ tiles = {"default_ice.png"},
+ is_ground_content = false,
+ paramtype = "light",
+ groups = {cracky=3},
+ sounds = default.node_sound_glass_defaults(),
+})
+
+minetest.register_node("default:pinetree", {
+ description = "Pine Tree",
+ tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"},
+ paramtype2 = "facedir",
+ groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
+ sounds = default.node_sound_wood_defaults(),
+})
+
+minetest.register_node("default:pine_needles",{
+ description = "Pine Needles",
+ drawtype = "allfaces_optional",
+ visual_scale = 1.3,
+ tiles = {"default_pine_needles.png"},
+ waving = 1,
+ paramtype = "light",
+ groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
+ sounds = default.node_sound_leaves_defaults(),
+})
+
+--
+-- Grow tree function
+--
+
+local c_air = minetest.get_content_id("air")
+local c_ignore = minetest.get_content_id("ignore")
+local c_tree = minetest.get_content_id("default:tree")
+local c_leaves = minetest.get_content_id("default:leaves")
+local c_apple = minetest.get_content_id("default:apple")
+function default.grow_tree(data, a, pos, is_apple_tree, seed)
+ --[[
+ NOTE: Tree-placing code is currently duplicated in the engine
+ and in games that have saplings; both are deprecated but not
+ replaced yet
+ ]]--
+ local pr = PseudoRandom(seed)
+ local th = pr:next(4, 5)
+ local x, y, z = pos.x, pos.y, pos.z
+ for yy = y, y+th-1 do
+ local vi = a:index(x, yy, z)
+ if a:contains(x, yy, z) and (data[vi] == c_air or yy == y) then
+ data[vi] = c_tree
+ end
+ end
+ y = y+th-1 -- (x, y, z) is now last piece of trunk
+ local leaves_a = VoxelArea:new{MinEdge={x=-2, y=-1, z=-2}, MaxEdge={x=2, y=2, z=2}}
+ local leaves_buffer = {}
+
+ -- Force leaves near the trunk
+ local d = 1
+ for xi = -d, d do
+ for yi = -d, d do
+ for zi = -d, d do
+ leaves_buffer[leaves_a:index(xi, yi, zi)] = true
+ end
+ end
+ end
+
+ -- Add leaves randomly
+ for iii = 1, 8 do
+ local d = 1
+ local xx = pr:next(leaves_a.MinEdge.x, leaves_a.MaxEdge.x - d)
+ local yy = pr:next(leaves_a.MinEdge.y, leaves_a.MaxEdge.y - d)
+ local zz = pr:next(leaves_a.MinEdge.z, leaves_a.MaxEdge.z - d)
+
+ for xi = 0, d do
+ for yi = 0, d do
+ for zi = 0, d do
+ leaves_buffer[leaves_a:index(xx+xi, yy+yi, zz+zi)] = true
+ end
+ end
+ end
+ end
+
+ -- Add the leaves
+ for xi = leaves_a.MinEdge.x, leaves_a.MaxEdge.x do
+ for yi = leaves_a.MinEdge.y, leaves_a.MaxEdge.y do
+ for zi = leaves_a.MinEdge.z, leaves_a.MaxEdge.z do
+ if a:contains(x+xi, y+yi, z+zi) then
+ local vi = a:index(x+xi, y+yi, z+zi)
+ if data[vi] == c_air or data[vi] == c_ignore then
+ if leaves_buffer[leaves_a:index(xi, yi, zi)] then
+ if is_apple_tree and pr:next(1, 100) <= 10 then
+ data[vi] = c_apple
+ else
+ data[vi] = c_leaves
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+--
+-- ABMs
+--
+
+minetest.register_abm({
+ nodenames = {"default:sapling"},
+ interval = 10,
+ chance = 50,
+ action = function(pos, node)
+ local node_under = minetest.registered_nodes[
+ minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name]
+ if not node_under then
+ return
+ end
+ local is_soil = node_under.groups.soil
+ if is_soil == nil or is_soil == 0 then return end
+ print("A sapling grows into a tree at "..minetest.pos_to_string(pos))
+ local vm = minetest.get_voxel_manip()
+ local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16})
+ local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
+ local data = vm:get_data()
+ default.grow_tree(data, a, pos, math.random(1, 4) == 1, math.random(1,100000))
+ vm:set_data(data)
+ vm:write_to_map(data)
+ vm:update_map()
+ end
+})
+
+minetest.register_abm({
+ nodenames = {"default:dirt"},
+ interval = 2,
+ chance = 200,
+ action = function(pos, node)
+ local above = {x=pos.x, y=pos.y+1, z=pos.z}
+ local name = minetest.get_node(above).name
+ local nodedef = minetest.registered_nodes[name]
+ if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light")
+ and nodedef.liquidtype == "none"
+ and (minetest.get_node_light(above) or 0) >= 13 then
+ if name == "default:snow" or name == "default:snowblock" then
+ minetest.set_node(pos, {name = "default:dirt_with_snow"})
+ else
+ minetest.set_node(pos, {name = "default:dirt_with_grass"})
+ end
+ end
+ end
+})
+
+minetest.register_abm({
+ nodenames = {"default:dirt_with_grass"},
+ interval = 2,
+ chance = 20,
+ action = function(pos, node)
+ local above = {x=pos.x, y=pos.y+1, z=pos.z}
+ local name = minetest.get_node(above).name
+ local nodedef = minetest.registered_nodes[name]
+ if name ~= "ignore" and nodedef
+ and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
+ and nodedef.liquidtype == "none") then
+ minetest.set_node(pos, {name = "default:dirt"})
+ end
+ end
+})
+
--
-- Crafting items
--
})
--
--- Aliases for the current map generator outputs
---
-
-minetest.register_alias("mapgen_air", "air")
-minetest.register_alias("mapgen_stone", "default:stone")
-minetest.register_alias("mapgen_tree", "default:tree")
-minetest.register_alias("mapgen_leaves", "default:leaves")
-minetest.register_alias("mapgen_apple", "default:apple")
-minetest.register_alias("mapgen_water_source", "default:water_source")
-minetest.register_alias("mapgen_dirt", "default:dirt")
-minetest.register_alias("mapgen_sand", "default:sand")
-minetest.register_alias("mapgen_gravel", "default:gravel")
-minetest.register_alias("mapgen_clay", "default:clay")
-minetest.register_alias("mapgen_lava_source", "default:lava_source")
-minetest.register_alias("mapgen_cobble", "default:cobble")
-minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
-minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
-minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
-minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
-minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
-minetest.register_alias("mapgen_mese", "default:mese")
-
-minetest.register_biome_groups({
-0.35, 0.30, 0.20
-})
-
---
--- Register the biomes for the map generator
+-- Support old code
--
-minetest.register_biome({
- group_id = 0,
- name = "Ocean",
- terrain_type = "liquid",
- node_top = "default:gravel",
- node_filler = "default:stone",
- num_top_nodes = 4,
- height_min = -3000,
- height_max = 3000,
- heat_min = -20.0,
- heat_max = 100.0,
- humidity_min = 0.0,
- humidity_max = 100.0,
- scale = 10.0,
- offset = -10.0,
-})
-
-minetest.register_biome({
- group_id = 1,
- name = "Beach",
- terrain_type = "normal",
- node_top = "default:sand",
- node_filler = "default:stone",
- num_top_nodes = 5,
- height_min = -3000,
- height_max = 3000,
- heat_min = 60.0,
- heat_max = 100.0,
- humidity_min = 0.0,
- humidity_max = 100.0,
- scale = 5.0,
- offset = 5.0,
-})
-
-minetest.register_biome({
- group_id = 2,
- name = "Land",
- terrain_type = "normal",
- node_top = "default:dirt_with_grass",
- node_filler = "default:stone",
- num_top_nodes = 5,
- height_min = -3000,
- height_max = 3000,
- heat_min = -50.0,
- heat_max = 100.0,
- humidity_min = 0.0,
- humidity_max = 100.0,
- scale = 12.0,
- offset = 10.0,
-})
-
-minetest.register_biome({
- group_id = 3,
- name = "Hills",
- terrain_type = "normal",
- node_top = "default:dirt",
- node_filler = "default:stone",
- num_top_nodes = 3,
- height_min = -3000,
- height_max = 3000,
- heat_min = -50.0,
- heat_max = 100.0,
- humidity_min = 0.0,
- humidity_max = 100.0,
- scale = 70.0,
- offset = 30.0,
-})
-
--- Support old code
function default.spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
--dump2(minetest.registered_entities)
-- END
+