1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

Updated moretrees, plantlife, and MinetestForFunGame

- Solves #220
 - Merge mapgen into MinetestForFun Game
 - Merge acacia support in moretrees
 - Add 3dmushrooms mod (world.mt updated)
This commit is contained in:
LeMagnesium
2015-08-15 22:10:59 +02:00
parent 5fbf422aaf
commit 5b4172541b
110 changed files with 1733 additions and 1111 deletions

View File

@ -24,7 +24,6 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun's WTFPL texture pack:
default_jungletree.png
default_jungletree_top.png
default_lava.png
default_leaves.png
default_sapling.png
@ -57,11 +56,11 @@ VanessaE (WTFPL):
default_nc_front.png
default_nc_rb.png
default_nc_side.png
default_grass_*.png
default_desert_sand.png
default_desert_stone.png
default_desert_stone_brick.png
default_sand.png
default_jungletree_top.png
Calinou (CC BY-SA):
default_brick.png
@ -78,7 +77,6 @@ Jordach (CC BY-SA 3.0):
PilzAdam (WTFPL):
default_jungleleaves.png
default_junglesapling.png
default_junglewood.png
default_obsidian_glass.png
default_obsidian_shard.png
default_mineral_gold.png
@ -93,7 +91,6 @@ InfinityProject (WTFPL):
Splizard (CC BY-SA 3.0):
default_snow.png
default_snow_side.png
default_ice.png
default_pine_sapling.png
Zeg9 (CC BY-SA 3.0):
@ -104,7 +101,7 @@ Zeg9 (CC BY-SA 3.0):
default_gold_block.png
paramat (CC BY-SA 3.0):
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
wieldhand.png, derived from character.png by Jordach (CC BY-SA 3.0)
default_pinetree.png
default_pinetree_top.png
default_pinewood.png
@ -113,6 +110,15 @@ paramat (CC BY-SA 3.0):
default_river_water.png
default_river_water_source_animated.png
default_river_water_flowing_animated.png
default_acacia_leaves.png
default_acacia_sapling.png
default_acacia_tree.png
default_acacia_tree_top.png
default_acacia_wood.png
default_dry_grass.png
default_dry_grass_side.png
default_dry_grass_*.png
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
@ -125,7 +131,6 @@ BlockMen (CC BY-SA 3.0):
default_gold_ingot.png
default_tool_steelsword.png
default_diamond.png
default_diamond_block.png
default_book.png
default_tool_*.png
default_lava_source_animated.png
@ -152,6 +157,21 @@ Philipbenr (CC BY-SA 3.0):
default_grass.png
default_grass_side.png
Gambit (WTFPL):
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_iron_lump.png
default_gold_lump.png
default_clay_lump.png
default_coal.png
default_grass_*.png
default_paper.png
default_diamond_block.png
asl97 (WTFPL):
default_ice.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
@ -191,14 +211,3 @@ Mito551 (sounds) (CC BY-SA):
default_dirt_footstep.1.ogg
default_dirt_footstep.2.ogg
default_glass_footstep.ogg
Gambit (WTFPL):
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_iron_lump.png
default_gold_lump.png
default_clay_lump.png
default_coal.png
default_grass_*.png
default_paper.png

View File

@ -68,5 +68,9 @@ minetest.register_alias("steel_ingot", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick")
minetest.register_alias("snow", "default:snow")
-- Aliases for corrected pine node names
minetest.register_alias("default:pinetree", "default:pine_tree")
minetest.register_alias("default:pinewood", "default:pine_wood")
-- Mese now comes in the form of blocks, ore, crystal and fragments
minetest.register_alias("default:mese", "default:mese_block")
minetest.register_alias("default:mese", "default:mese_block")

View File

@ -22,9 +22,16 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:pinewood 4',
output = 'default:pine_wood 4',
recipe = {
{'default:pinetree'},
{'default:pine_tree'},
}
})
minetest.register_craft({
output = 'default:acacia_wood 4',
recipe = {
{'default:acacia_tree'},
}
})
@ -435,15 +442,6 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "default:sword_nyan",
recipe = {
{"default:nyancat"},
{"default:nyancat"},
{"group:stick"},
}
})
minetest.register_craft({
output = 'default:sword_diamond',
recipe = {
@ -462,6 +460,15 @@ minetest.register_craft({ -- Ultimate Warrior weapon
}
})
minetest.register_craft({
output = "default:sword_nyan",
recipe = {
{"default:nyancat"},
{"default:nyancat"},
{"group:stick"},
}
})
minetest.register_craft({
output = 'default:rail 16',
recipe = {
@ -1018,7 +1025,7 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:sapling",
recipe = "group:sapling",
burntime = 10,
})
@ -1040,12 +1047,6 @@ minetest.register_craft({
burntime = 370,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:grass_1",
@ -1054,7 +1055,7 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:pine_sapling",
burntime = 10,
recipe = "default:dry_grass_1",
burntime = 2,
})

View File

@ -165,42 +165,22 @@ local del1 = 0
local count = 0
default.cool_lava_source = function(pos)
local del2 = tonumber(os.clock())
if del2-del1 < 0.1
and count > 1 then
cool_wf_vm(pos, "default:lava_source", "default:obsidian_cooled")
count = 0
else
minetest.set_node(pos, {name = "default:obsidian_cooled"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.2})
if del2-del1 < 0.1 then
count = count + 1
end
end
del1 = del2
minetest.set_node(pos, {name = "default:obsidian"})
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
default.cool_lava_flowing = function(pos)
local del2 = tonumber(os.clock())
if del2-del1 < 0.1
and count > 1 then
cool_wf_vm(pos, "default:lava_flowing", "default:cobble_cooled")
count = 0
else
minetest.set_node(pos, {name = "default:cobble_cooled"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.2})
if del2-del1 < 0.1 then
count = count + 1
end
end
del1 = del2
minetest.set_node(pos, {name = "default:stone"})
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
minetest.register_abm({
nodenames = {"default:lava_flowing"},
neighbors = {"group:water"},
interval = 2,
chance = 1,
interval = 1,
chance = 2,
action = function(...)
default.cool_lava_flowing(...)
end,
@ -209,8 +189,8 @@ minetest.register_abm({
minetest.register_abm({
nodenames = {"default:lava_source"},
neighbors = {"group:water"},
interval = 2,
chance = 1,
interval = 1,
chance = 2,
action = function(...)
default.cool_lava_source(...)
end,
@ -224,12 +204,11 @@ minetest.register_abm({
-- wrapping the functions in abm action is necessary to make overriding them possible
function default.grow_cactus(pos, node)
if node.param2 >= 4 then
if node.param2 ~= 0 then
return
end
pos.y = pos.y - 1
local name = minetest.get_node(pos).name --MFF
if minetest.get_item_group(name, "sand") == 0 and name ~= "watershed:drygrass" then --MFF
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
return
end
pos.y = pos.y + 1
@ -249,7 +228,7 @@ end
function default.grow_papyrus(pos, node)
pos.y = pos.y - 1
local name = minetest.get_node(pos).name
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" and name ~= "default:sand" and name ~= "default:desert_sand" then --MFF
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then
return
end
if not minetest.find_node_near(pos, 3, {"group:water"}) then
@ -406,6 +385,7 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then
return
end
minetest.remove_node(pos, newnode)
minetest.set_node(pos, oldnode)
minetest.add_item(pos, "default:torch")
end)
@ -436,9 +416,9 @@ minetest.register_abm({
})
minetest.register_abm({
nodenames = {"default:dirt_with_grass"},
interval = 30,
chance = 2,
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_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

View File

@ -2,7 +2,6 @@
-- Aliases for map generator outputs
--
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
@ -19,15 +18,19 @@ minetest.register_alias("mapgen_snow", "default:snow")
minetest.register_alias("mapgen_ice", "default:ice")
minetest.register_alias("mapgen_sandstone", "default:sandstone")
-- Flora
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_jungletree", "default:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
minetest.register_alias("mapgen_pinetree", "default:pinetree")
minetest.register_alias("mapgen_pine_tree", "default:pine_tree")
minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
-- Dungeons
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
minetest.register_alias("mapgen_mese", "default:mese")
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
@ -43,11 +46,14 @@ minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebr
-- Register ores
--
-- All mapgens except singlenode
-- Blob ore first to avoid other ores inside blobs
function default.register_ores()
minetest.register_ore({
-- Clay
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
@ -66,7 +72,9 @@ function default.register_ores()
},
})
minetest.register_ore({
-- Sand
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone"},
@ -85,6 +93,8 @@ function default.register_ores()
},
})
-- Dirt
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
@ -104,6 +114,8 @@ function default.register_ores()
},
})
-- Gravel
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
@ -123,6 +135,8 @@ function default.register_ores()
},
})
-- Coal
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
@ -157,6 +171,8 @@ function default.register_ores()
flags = "absheight",
})
-- Iron
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
@ -203,6 +219,8 @@ function default.register_ores()
flags = "absheight",
})
--Mese
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
@ -321,6 +339,8 @@ function default.register_ores()
flags = "absheight",
})
-- Gold
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
@ -345,6 +365,8 @@ function default.register_ores()
flags = "absheight",
})
-- Diamond
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
@ -369,6 +391,8 @@ function default.register_ores()
flags = "absheight",
})
-- Copper
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
@ -609,12 +633,155 @@ end
-- Register biomes
--
-- All mapgens except mgv6 and singlenode
function default.register_biomes()
minetest.clear_registered_biomes()
-- Permanent ice
minetest.register_biome({
name = "default:grassland",
name = "glacier",
node_dust = "default:snowblock",
node_top = "default:snowblock",
depth_top = 1,
node_filler = "default:snowblock",
depth_filler = 3,
node_stone = "default:ice",
node_water_top = "default:ice",
depth_water_top = 10,
--node_water = "",
y_min = -8,
y_max = 31000,
heat_point = -5,
humidity_point = 50,
})
minetest.register_biome({
name = "glacier_ocean",
node_dust = "default:snowblock",
node_top = "default:gravel",
depth_top = 1,
node_filler = "default:gravel",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = -9,
heat_point = -5,
humidity_point = 50,
})
-- Cold
minetest.register_biome({
name = "tundra",
node_dust = "default:snow",
node_top = "default:dirt_with_snow",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 0,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 2,
y_max = 31000,
heat_point = 20,
humidity_point = 30,
})
minetest.register_biome({
name = "tundra_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 1,
heat_point = 20,
humidity_point = 30,
})
minetest.register_biome({
name = "taiga",
node_dust = "default:snow",
node_top = "default:snowblock",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 2,
y_max = 31000,
heat_point = 20,
humidity_point = 70,
})
minetest.register_biome({
name = "taiga_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 1,
heat_point = 20,
humidity_point = 70,
})
-- Cool
minetest.register_biome({
name = "stone_grassland",
--node_dust = "",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 0,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 6,
y_max = 31000,
heat_point = 45,
humidity_point = 30,
})
minetest.register_biome({
name = "stone_grassland_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 5,
heat_point = 45,
humidity_point = 30,
})
minetest.register_biome({
name = "coniferous_forest",
--node_dust = "",
node_top = "default:dirt_with_grass",
depth_top = 1,
@ -624,8 +791,235 @@ function default.register_biomes()
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -31000,
y_min = 6,
y_max = 31000,
heat_point = 45,
humidity_point = 70,
})
minetest.register_biome({
name = "coniferous_forest_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 5,
heat_point = 45,
humidity_point = 70,
})
-- Warm
minetest.register_biome({
name = "sandstone_grassland",
--node_dust = "",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 0,
node_stone = "default:sandstone",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 6,
y_max = 31000,
heat_point = 70,
humidity_point = 30,
})
minetest.register_biome({
name = "sandstone_grassland_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
node_stone = "default:sandstone",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 5,
heat_point = 70,
humidity_point = 30,
})
minetest.register_biome({
name = "deciduous_forest",
--node_dust = "",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 6,
y_max = 31000,
heat_point = 70,
humidity_point = 70,
})
minetest.register_biome({
name = "deciduous_forest_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 5,
heat_point = 70,
humidity_point = 70,
})
-- Hot
minetest.register_biome({
name = "desert",
--node_dust = "",
node_top = "default:desert_sand",
depth_top = 1,
node_filler = "default:desert_sand",
depth_filler = 1,
node_stone = "default:desert_stone",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 1,
y_max = 31000,
heat_point = 95,
humidity_point = 10,
})
minetest.register_biome({
name = "desert_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
node_stone = "default:desert_stone",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 0,
heat_point = 95,
humidity_point = 10,
})
minetest.register_biome({
name = "savanna",
--node_dust = "",
node_top = "default:dirt_with_dry_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 1,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 5,
y_max = 31000,
heat_point = 95,
humidity_point = 50,
})
minetest.register_biome({
name = "savanna_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 4,
heat_point = 95,
humidity_point = 50,
})
minetest.register_biome({
name = "rainforest",
--node_dust = "",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 1,
y_max = 31000,
heat_point = 95,
humidity_point = 90,
})
minetest.register_biome({
name = "rainforest_swamp",
--node_dust = "",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 0,
y_max = 0,
heat_point = 95,
humidity_point = 90,
})
minetest.register_biome({
name = "rainforest_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = -1,
heat_point = 95,
humidity_point = 90,
})
-- Underground
minetest.register_biome({
name = "underground",
--node_dust = "",
--node_top = "",
depth_top = 0,
--node_filler = "",
depth_filler = -4,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -31000,
y_max = -113,
heat_point = 50,
humidity_point = 50,
node_underwater = "default:sand",
@ -637,11 +1031,13 @@ end
--
-- Register mgv6 decorations
-- Register decorations
--
-- Mgv6
function default.register_mgv6_decorations()
minetest.clear_registered_decorations()
-- Papyrus
@ -661,7 +1057,7 @@ function default.register_mgv6_decorations()
y_max = 1,
decoration = "default:papyrus",
height = 2,
height_max = 4,
height_max = 4,
spawn_by = "default:water_source",
num_spawn_by = 1,
})
@ -687,7 +1083,7 @@ function default.register_mgv6_decorations()
height_max = 4,
})
-- Grasses
-- Long grasses
for length = 1, 5 do
minetest.register_decoration({
@ -745,91 +1141,96 @@ function default.register_mgv6_decorations()
})
end
-- All mapgens except mgv6 and singlenode
--
-- Register decorations
--
function default.register_decorations()
-- Flowers
local function register_grass_decoration(offset, scale, length)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
place_on = {"default:dirt_with_grass", "default:sand"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
offset = offset,
scale = scale,
spread = {x = 100, y = 100, z = 100},
seed = 436,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {
"stone_grassland", "stone_grassland_ocean",
"sandstone_grassland", "sandstone_grassland_ocean",
"deciduous_forest", "deciduous_forest_ocean",
"coniferous_forest", "coniferous_forest_ocean",
},
y_min = 5,
y_max = 31000,
decoration = "flowers:rose",
decoration = "default:grass_"..length,
})
end
local function register_dry_grass_decoration(offset, scale, length)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
place_on = {"default:dirt_with_dry_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
offset = offset,
scale = scale,
spread = {x = 100, y = 100, z = 100},
seed = 19822,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
biomes = {"savana"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:tulip",
decoration = "default:dry_grass_"..length,
})
end
function default.register_decorations()
minetest.clear_registered_decorations()
-- Apple tree
minetest.register_decoration({
deco_type = "simple",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
offset = offset,
scale = scale,
spread = {x = 100, y = 100, z = 100},
seed = 1220999,
octaves = 3,
persist = 0.6
persist = 0.66
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {"deciduous_forest"},
y_min = 6,
y_max = 31000,
decoration = "flowers:dandelion_yellow",
schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts",
flags = "place_center_x, place_center_z",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x = 100, y = 100, z = 100},
seed = 36662,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:geranium",
})
-- Jungle tree
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
deco_type = "schematic",
place_on = {"default:dirt_with_grass", "default:dirt"},
sidelen = 80,
fill_ratio = 0.09,
biomes = {"rainforest", "rainforest_swamp"},
y_min = 0,
y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts",
flags = "place_center_x, place_center_z",
})
-- Taiga and temperate forest pine tree
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:snowblock", "default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
@ -837,38 +1238,43 @@ function default.register_decorations()
spread = {x = 100, y = 100, z = 100},
seed = 1133,
octaves = 3,
persist = 0.6
persist = 0.66
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {"taiga", "coniferous_forest"},
y_min = 2,
y_max = 31000,
decoration = "flowers:viola",
schematic = minetest.get_modpath("default").."/schematics/pine_tree.mts",
flags = "place_center_x, place_center_z",
})
-- Acacia tree
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
deco_type = "schematic",
place_on = {"default:dirt_with_dry_grass"},
sidelen = 80,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x = 100, y = 100, z = 100},
seed = 73133,
offset = 0,
scale = 0.003,
spread = {x=250, y=250, z=250},
seed = 2,
octaves = 3,
persist = 0.6
persist = 0.66
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {"savanna"},
y_min = 6,
y_max = 31000,
decoration = "flowers:dandelion_white",
schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
-- Grasses
-- Large cactus
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
deco_type = "schematic",
place_on = {"default:desert_sand"},
sidelen = 80,
noise_params = {
offset = 0.04,
scale = 0.08,
@ -877,114 +1283,113 @@ function default.register_decorations()
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {"desert"},
y_min = 2,
y_max = 31000,
decoration = "default:grass_1",
schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts",
flags = "place_center_x",
rotation = "random",
})
-- Cactus
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
place_on = {"default:desert_sand"},
sidelen = 80,
noise_params = {
offset = 0.02,
scale = 0.08,
spread = {x = 100, y = 100, z = 100},
seed = 66440,
offset = -0.0005,
scale = 0.0015,
spread = {x=200, y=200, z=200},
seed = 230,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {"desert"},
y_min = 2,
y_max = 31000,
decoration = "default:grass_2",
decoration = "default:cactus",
height = 2,
height_max = 5,
})
-- Papyrus
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:sand"},
sidelen = 16,
noise_params = {
offset = -0.3,
scale = 0.7,
spread = {x=200, y=200, z=200},
seed = 354,
octaves = 3,
persist = 0.7
},
biomes = {"savanna_ocean", "desert_ocean"},
y_min = 0,
y_max = 0,
schematic = minetest.get_modpath("default").."/schematics/papyrus.mts",
})
-- Grasses
register_grass_decoration(-0.03, 0.09, 5)
register_grass_decoration(-0.015, 0.075, 4)
register_grass_decoration(0, 0.06, 3)
register_grass_decoration(0.015, 0.045, 2)
register_grass_decoration(0.03, 0.03, 1)
-- Dry grasses
register_dry_grass_decoration(0.01, 0.05, 5)
register_dry_grass_decoration(0.03, 0.03, 4)
register_dry_grass_decoration(0.05, 0.01, 3)
register_dry_grass_decoration(0.07, -0.01, 2)
register_dry_grass_decoration(0.09, -0.03, 1)
-- Junglegrass
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 80,
fill_ratio = 0.1,
biomes = {"rainforest"},
y_min = 1,
y_max = 31000,
decoration = "default:junglegrass",
})
-- Dry shrub
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:desert_sand", "default:dirt_with_snow"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.08,
spread = {x = 100, y = 100, z = 100},
seed = 66440,
scale = 0.02,
spread = {x=200, y=200, z=200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
biomes = {"desert", "tundra"},
y_min = 2,
y_max = 31000,
decoration = "default:grass_3",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.08,
spread = {x = 100, y = 100, z = 100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_4",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.04,
scale = 0.08,
spread = {x = 100, y = 100, z = 100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"default:grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_5",
decoration = "default:dry_shrub",
})
end
--
-- Detect mapgen to select functions
-- Generate nyan cats
--
-- All mapgens except singlenode
-- Mods using singlenode mapgen can call these functions to enable
-- the use of minetest.generate_ores or minetest.generate_decorations
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v5" then
default.register_biomes()
default.register_ores()
elseif mg_params.mgname == "v6" then
default.register_mgv6_decorations()
default.register_ores()
elseif mg_params.mgname == "v7" then
default.register_biomes()
default.register_decorations()
end
--
-- Generate nyan cats in all mapgens
--
-- facedir: 0/1/2/3 (head node facedir value)
-- length: length of rainbow tail
function default.make_nyancat(pos, facedir, length)
local tailvec = {x = 0, y = 0, z = 0}
if facedir == 0 then
@ -996,7 +1401,6 @@ function default.make_nyancat(pos, facedir, length)
elseif facedir == 3 then
tailvec.x = -1
else
--print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
facedir = 0
tailvec.z = 1
end
@ -1009,9 +1413,7 @@ function default.make_nyancat(pos, facedir, length)
end
end
function default.generate_nyancats(minp, maxp, seed)
if minp.y < -19600 then return end -- no generate in nether
local height_min = -30000
local height_max = 30000
if maxp.y < height_min or minp.y > height_max then
@ -1034,4 +1436,21 @@ function default.generate_nyancats(minp, maxp, seed)
end
minetest.register_on_generated(default.generate_nyancats)
--
-- Detect mapgen to select functions
--
-- Mods using singlenode mapgen can call these functions to enable
-- the use of minetest.generate_ores or minetest.generate_decorations
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v6" then
default.register_ores()
default.register_mgv6_decorations()
minetest.register_on_generated(default.generate_nyancats)
elseif mg_params.mgname ~= "singlenode" then
default.register_ores()
default.register_biomes()
default.register_decorations()
minetest.register_on_generated(default.generate_nyancats)
end

View File

@ -1,5 +1,15 @@
-- mods/default/nodes.lua
--[[ Node name convention:
Although many node names are in combined-word form, the required form for new
node names is words separated by underscores. If both forms are used in written
language (for example pinewood and pine wood) the underscore form should be used.
--]]
--[[ Index:
Stone
@ -28,6 +38,7 @@ Soft / Non-Stone
default:dirt
default:dirt_with_grass
default:dirt_with_dry_grass
default:dirt_with_grass_footsteps
default:dirt_with_snow
@ -59,11 +70,16 @@ default:junglewood
default:jungleleaves
default:junglesapling
default:pinetree
default:pinewood
default:pine_tree
default:pine_wood
default:pine_needles
default:pine_sapling
default:acacia_tree
default:acacia_wood
default:acacia_leaves
default:acacia_sapling
default:cherry_tree
default:cherry_log
default:cherry_plank
@ -104,12 +120,19 @@ default:cactus
default:papyrus
default:dry_shrub
default:junglegrass
default:grass_1
default:grass_2
default:grass_3
default:grass_4
default:grass_5
default:dry_grass_1
default:dry_grass_2
default:dry_grass_3
default:dry_grass_4
default:dry_grass_5
Liquids
-------
(1. Source 2. Flowing)
@ -331,6 +354,19 @@ minetest.register_node("default:dirt_with_grass", {
}),
})
minetest.register_node("default:dirt_with_dry_grass", {
description = "Dirt with Dry Grass",
tiles = {"default_dry_grass.png",
"default_dirt.png",
"default_dirt.png^default_dry_grass_side.png"
},
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"},
@ -455,19 +491,19 @@ minetest.register_node("default:snow", {
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
},
groups = {crumbly=3,falling_node=1, melts = 1, float = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.25},
dug = {name="default_snow_footstep", gain=0.75},
footstep = {name = "default_snow_footstep", gain = 0.25},
dug = {name = "default_snow_footstep", gain = 0.75},
}),
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"})
minetest.set_node(pos, {name = "default:dirt_with_snow"})
end
end,
})
@ -553,6 +589,7 @@ minetest.register_node("default:leaves", {
waving = 1,
visual_scale = 1.3,
tiles = {"default_leaves.png"},
special_tiles = {"default_leaves_simple.png"},
paramtype = "light",
walkable = false,
is_ground_content = false,
@ -633,6 +670,7 @@ minetest.register_node("default:jungleleaves", {
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_jungleleaves.png"},
special_tiles = {"default_jungleleaves_simple.png"},
paramtype = "light",
is_ground_content = false,
walkable = false,
@ -676,22 +714,23 @@ minetest.register_node("default:junglesapling", {
minetest.register_node("default:pinetree", {
minetest.register_node("default:pine_tree", {
description = "Pine Tree",
tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"},
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
"default_pine_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:pinewood", {
description = "Pinewood Planks",
tiles = {"default_pinewood.png"},
minetest.register_node("default:pine_wood", {
description = "Pine Wood Planks",
tiles = {"default_pine_wood.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
@ -703,20 +742,12 @@ minetest.register_node("default:pine_needles",{
waving = 1,
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {"default:pine_sapling"},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {"default:pine_needles"},
}
{items = {"default:pine_sapling"}, rarity = 20},
{items = {"default:pine_needles"}}
}
},
sounds = default.node_sound_leaves_defaults(),
@ -732,13 +763,74 @@ minetest.register_node("default:pine_sapling", {
inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
is_ground_content = true,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:acacia_tree", {
description = "Acacia Tree",
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
"default_acacia_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:acacia_wood", {
description = "Acacia Wood Planks",
tiles = {"default_acacia_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:acacia_leaves", {
description = "Acacia Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_acacia_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:acacia_sapling"}, rarity = 20},
{items = {"default:acacia_leaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("default:acacia_sapling", {
description = "Acacia Tree Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
@ -1208,6 +1300,54 @@ for i=2,5 do
})
end
minetest.register_node("default:dry_grass_1", {
description = "Dry Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_1.png"},
inventory_image = "default_dry_grass_3.png",
wield_image = "default_dry_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random dry grass node
local stack = ItemStack("default:dry_grass_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:dry_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
for i=2,5 do
minetest.register_node("default:dry_grass_"..i, {
description = "Dry Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_"..i..".png"},
inventory_image = "default_dry_grass_"..i..".png",
wield_image = "default_dry_grass_"..i..".png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
drop = "default:dry_grass_1",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
end
--
-- Liquids
--

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,7 +1,9 @@
--
-- Grow trees
-- Grow trees from saplings
--
-- 'Can grow' function
local random = math.random
local function can_grow(pos)
@ -17,10 +19,12 @@ local function can_grow(pos)
return true
end
-- Sapling ABMs
-- Sapling ABM
minetest.register_abm({
nodenames = {"default:sapling"},
nodenames = {"default:sapling", "default:junglesapling",
"default:pine_sapling", "default:acacia_sapling"},
interval = 10,
chance = 50,
action = function(pos, node)
@ -28,43 +32,45 @@ minetest.register_abm({
return
end
minetest.log("action", "A sapling grows into a tree at "..
local mapgen = minetest.get_mapgen_params().mgname
if node.name == "default:sapling" then
minetest.log("action", "A sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_tree(pos, random(1, 4) == 1)
end
})
minetest.register_abm({
nodenames = {"default:junglesapling"},
interval = 11,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
if mapgen == "v6" then
default.grow_tree(pos, random(1, 4) == 1)
else
default.grow_new_apple_tree(pos)
end
elseif node.name == "default:junglesapling" then
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_jungle_tree(pos)
else
default.grow_new_jungle_tree(pos)
end
elseif node.name == "default:pine_sapling" then
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
elseif node.name == "default:acacia_sapling" then
minetest.log("action", "An acacia sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_new_acacia_tree(pos)
end
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_jungle_tree(pos)
end
})
minetest.register_abm({
nodenames = {"default:pine_sapling"},
interval = 12,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
end
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_pine_tree(pos)
end
})
--
-- Tree generation
--
-- Appletree, jungletree function
-- Apple tree and jungle tree trunk and leaves function
local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
height, size, iters, is_apple_tree)
@ -74,11 +80,11 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
local c_apple = minetest.get_content_id("default:apple")
-- Trunk
for y_dist = 0, height - 1 do
local vi = a:index(x, y + y_dist, z)
data[a:index(x, y, z)] = tree_cid -- Force-place lowest trunk node to replace sapling
for yy = y + 1, y + height - 1 do
local vi = a:index(x, yy, z)
local node_id = data[vi]
if y_dist == 0 or node_id == c_air or node_id == c_ignore
or node_id == leaves_cid then
if node_id == c_air or node_id == c_ignore or node_id == leaves_cid then
data[vi] = tree_cid
end
end
@ -123,7 +129,8 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
end
end
-- Appletree
-- Apple tree
function default.grow_tree(pos, is_apple_tree, bad)
--[[
@ -155,7 +162,8 @@ function default.grow_tree(pos, is_apple_tree, bad)
vm:update_map()
end
-- Jungletree
-- Jungle tree
function default.grow_jungle_tree(pos, bad)
--[[
@ -206,16 +214,19 @@ function default.grow_jungle_tree(pos, bad)
vm:update_map()
end
-- Pinetree from mg mapgen mod, design by sfan5, pointy top added by paramat
-- Pine tree from mg mapgen mod, design by sfan5, pointy top added by paramat
local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles)
if data[vi] == c_air or data[vi] == c_ignore or data[vi] == c_snow then
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or node_id == c_snow then
data[vi] = c_pine_needles
end
end
local function add_snow(data, vi, c_air, c_ignore, c_snow)
if data[vi] == c_air or data[vi] == c_ignore then
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore then
data[vi] = c_snow
end
end
@ -226,7 +237,7 @@ function default.grow_pine_tree(pos)
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_pinetree = minetest.get_content_id("default:pinetree")
local c_pine_tree = minetest.get_content_id("default:pine_tree")
local c_pine_needles = minetest.get_content_id("default:pine_needles")
local c_snow = minetest.get_content_id("default:snow")
local c_snowblock = minetest.get_content_id("default:snowblock")
@ -240,16 +251,14 @@ function default.grow_pine_tree(pos)
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
-- Scan for snow nodes near sapling
-- Scan for snow nodes near sapling to enable snow on branches
local snow = false
for yy = y - 1, y + 1 do
for zz = z - 1, z + 1 do
local vi = a:index(x - 1, yy, zz)
for xx = x - 1, x + 1 do
local nodid = data[vi]
if nodid == c_snow
or nodid == c_snowblock
or nodid == c_dirtsnow then
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
snow = true
end
vi = vi + 1
@ -266,7 +275,7 @@ function default.grow_pine_tree(pos)
for xx = x - dev, x + dev do
if random() < 0.95 - dev * 0.05 then
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
if snow then
add_snow(data, via, c_air, c_ignore, c_snow)
end
@ -280,9 +289,9 @@ function default.grow_pine_tree(pos)
-- Centre top nodes
add_pine_needles(data, a:index(x, maxy + 1, z), c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
add_pine_needles(data, a:index(x, maxy + 2, z), c_air, c_ignore, c_snow,
c_pine_needles) -- Paramat added a pointy top node
c_pine_needles) -- Paramat added a pointy top node
if snow then
add_snow(data, a:index(x, maxy + 3, z), c_air, c_ignore, c_snow)
end
@ -301,7 +310,7 @@ function default.grow_pine_tree(pos)
local via = a:index(xi, yy + 1, zz)
for xx = xi, xi + 1 do
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
if snow then
add_snow(data, via, c_air, c_ignore, c_snow)
end
@ -319,7 +328,7 @@ function default.grow_pine_tree(pos)
for xx = x - dev, x + dev do
if random() < 0.95 - dev * 0.05 then
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
if snow then
add_snow(data, via, c_air, c_ignore, c_snow)
end
@ -332,9 +341,14 @@ function default.grow_pine_tree(pos)
end
-- Trunk
for yy = y, maxy do
data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling
for yy = y + 1, maxy do
local vi = a:index(x, yy, z)
data[vi] = c_pinetree
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or
node_id == c_pine_needles or node_id == c_snow then
data[vi] = c_pine_tree
end
end
vm:set_data(data)
@ -342,24 +356,49 @@ function default.grow_pine_tree(pos)
vm:update_map()
end
-- New apple tree
function default.grow_new_apple_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
-- New jungle tree
function default.grow_new_jungle_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
-- New pine tree
function default.grow_new_pine_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/pine_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
-- New acacia tree
function default.grow_new_acacia_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts"
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
path, random, nil, false)
end
-- From BFD:
minetest.register_node("default:mg_cherry_sapling", {
description = "Impossible to get node.",
visual_scale = 1.0,
inventory_image = "default_cherry_sapling.png",
wield_image = "default_cherry_sapling.png",
drawtype = "plantlike",
drawtype = "airlike",
paramtype = "light",
tiles = {"default_cherry_sapling.png"},
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2, dig_immediate=3, not_in_creative_inventory=1, attached_node=1},
drop = "default:cherry_sapling",
sounds = default.node_sound_leaves_defaults(),
tiles = {"xfences_space.png"},
groups = {not_in_creative_inventory=1},
})
local c_mg_cherry_sapling = minetest.get_content_id("default:mg_cherry_sapling")