1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 17:50:37 +01: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: Cisoun's WTFPL texture pack:
default_jungletree.png default_jungletree.png
default_jungletree_top.png
default_lava.png default_lava.png
default_leaves.png default_leaves.png
default_sapling.png default_sapling.png
@ -57,11 +56,11 @@ VanessaE (WTFPL):
default_nc_front.png default_nc_front.png
default_nc_rb.png default_nc_rb.png
default_nc_side.png default_nc_side.png
default_grass_*.png
default_desert_sand.png default_desert_sand.png
default_desert_stone.png default_desert_stone.png
default_desert_stone_brick.png default_desert_stone_brick.png
default_sand.png default_sand.png
default_jungletree_top.png
Calinou (CC BY-SA): Calinou (CC BY-SA):
default_brick.png default_brick.png
@ -78,7 +77,6 @@ Jordach (CC BY-SA 3.0):
PilzAdam (WTFPL): PilzAdam (WTFPL):
default_jungleleaves.png default_jungleleaves.png
default_junglesapling.png default_junglesapling.png
default_junglewood.png
default_obsidian_glass.png default_obsidian_glass.png
default_obsidian_shard.png default_obsidian_shard.png
default_mineral_gold.png default_mineral_gold.png
@ -93,7 +91,6 @@ InfinityProject (WTFPL):
Splizard (CC BY-SA 3.0): Splizard (CC BY-SA 3.0):
default_snow.png default_snow.png
default_snow_side.png default_snow_side.png
default_ice.png
default_pine_sapling.png default_pine_sapling.png
Zeg9 (CC BY-SA 3.0): Zeg9 (CC BY-SA 3.0):
@ -104,7 +101,7 @@ Zeg9 (CC BY-SA 3.0):
default_gold_block.png default_gold_block.png
paramat (CC BY-SA 3.0): 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.png
default_pinetree_top.png default_pinetree_top.png
default_pinewood.png default_pinewood.png
@ -113,6 +110,15 @@ paramat (CC BY-SA 3.0):
default_river_water.png default_river_water.png
default_river_water_source_animated.png default_river_water_source_animated.png
default_river_water_flowing_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): brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png default_desert_cobble.png
@ -125,7 +131,6 @@ BlockMen (CC BY-SA 3.0):
default_gold_ingot.png default_gold_ingot.png
default_tool_steelsword.png default_tool_steelsword.png
default_diamond.png default_diamond.png
default_diamond_block.png
default_book.png default_book.png
default_tool_*.png default_tool_*.png
default_lava_source_animated.png default_lava_source_animated.png
@ -152,6 +157,21 @@ Philipbenr (CC BY-SA 3.0):
default_grass.png default_grass.png
default_grass_side.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): Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/ 1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/ 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.1.ogg
default_dirt_footstep.2.ogg default_dirt_footstep.2.ogg
default_glass_footstep.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("clay_brick", "default:clay_brick")
minetest.register_alias("snow", "default:snow") 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 -- 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({ minetest.register_craft({
output = 'default:pinewood 4', output = 'default:pine_wood 4',
recipe = { 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({ minetest.register_craft({
output = 'default:sword_diamond', output = 'default:sword_diamond',
recipe = { 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({ minetest.register_craft({
output = 'default:rail 16', output = 'default:rail 16',
recipe = { recipe = {
@ -1018,7 +1025,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:sapling", recipe = "group:sapling",
burntime = 10, burntime = 10,
}) })
@ -1040,12 +1047,6 @@ minetest.register_craft({
burntime = 370, burntime = 370,
}) })
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 10,
})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:grass_1", recipe = "default:grass_1",
@ -1054,7 +1055,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:pine_sapling", recipe = "default:dry_grass_1",
burntime = 10, burntime = 2,
}) })

View File

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

View File

@ -2,7 +2,6 @@
-- Aliases for map generator outputs -- Aliases for map generator outputs
-- --
minetest.register_alias("mapgen_stone", "default:stone") minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_dirt", "default:dirt") minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") 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_ice", "default:ice")
minetest.register_alias("mapgen_sandstone", "default:sandstone") minetest.register_alias("mapgen_sandstone", "default:sandstone")
-- Flora
minetest.register_alias("mapgen_tree", "default:tree") minetest.register_alias("mapgen_tree", "default:tree")
minetest.register_alias("mapgen_leaves", "default:leaves") minetest.register_alias("mapgen_leaves", "default:leaves")
minetest.register_alias("mapgen_apple", "default:apple") minetest.register_alias("mapgen_apple", "default:apple")
minetest.register_alias("mapgen_jungletree", "default:jungletree") minetest.register_alias("mapgen_jungletree", "default:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves") minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass") 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") 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_stone_with_iron", "default:stone_with_iron")
minetest.register_alias("mapgen_mese", "default:mese") minetest.register_alias("mapgen_mese", "default:mese")
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal") 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 -- Register ores
-- --
-- All mapgens except singlenode
-- Blob ore first to avoid other ores inside blobs -- Blob ore first to avoid other ores inside blobs
function default.register_ores() function default.register_ores()
minetest.register_ore({
-- Clay
minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:clay", ore = "default:clay",
wherein = {"default:sand"}, wherein = {"default:sand"},
@ -66,7 +72,9 @@ function default.register_ores()
}, },
}) })
minetest.register_ore({ -- Sand
minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:sand", ore = "default:sand",
wherein = {"default:stone"}, wherein = {"default:stone"},
@ -85,6 +93,8 @@ function default.register_ores()
}, },
}) })
-- Dirt
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:dirt", ore = "default:dirt",
@ -104,6 +114,8 @@ function default.register_ores()
}, },
}) })
-- Gravel
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:gravel", ore = "default:gravel",
@ -123,6 +135,8 @@ function default.register_ores()
}, },
}) })
-- Coal
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_coal", ore = "default:stone_with_coal",
@ -157,6 +171,8 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
-- Iron
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "default:stone_with_iron",
@ -203,6 +219,8 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
--Mese
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_mese", ore = "default:stone_with_mese",
@ -321,6 +339,8 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
-- Gold
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_gold", ore = "default:stone_with_gold",
@ -345,6 +365,8 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
-- Diamond
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_diamond", ore = "default:stone_with_diamond",
@ -369,6 +391,8 @@ function default.register_ores()
flags = "absheight", flags = "absheight",
}) })
-- Copper
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_copper", ore = "default:stone_with_copper",
@ -609,12 +633,155 @@ end
-- Register biomes -- Register biomes
-- --
-- All mapgens except mgv6 and singlenode
function default.register_biomes() function default.register_biomes()
minetest.clear_registered_biomes() minetest.clear_registered_biomes()
-- Permanent ice
minetest.register_biome({ 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_dust = "",
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
depth_top = 1, depth_top = 1,
@ -624,8 +791,235 @@ function default.register_biomes()
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
y_min = -31000, y_min = 6,
y_max = 31000, 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, heat_point = 50,
humidity_point = 50, humidity_point = 50,
node_underwater = "default:sand", node_underwater = "default:sand",
@ -637,11 +1031,13 @@ end
-- --
-- Register mgv6 decorations -- Register decorations
-- --
-- Mgv6
function default.register_mgv6_decorations() function default.register_mgv6_decorations()
minetest.clear_registered_decorations()
-- Papyrus -- Papyrus
@ -661,7 +1057,7 @@ function default.register_mgv6_decorations()
y_max = 1, y_max = 1,
decoration = "default:papyrus", decoration = "default:papyrus",
height = 2, height = 2,
height_max = 4, height_max = 4,
spawn_by = "default:water_source", spawn_by = "default:water_source",
num_spawn_by = 1, num_spawn_by = 1,
}) })
@ -687,7 +1083,7 @@ function default.register_mgv6_decorations()
height_max = 4, height_max = 4,
}) })
-- Grasses -- Long grasses
for length = 1, 5 do for length = 1, 5 do
minetest.register_decoration({ minetest.register_decoration({
@ -745,91 +1141,96 @@ function default.register_mgv6_decorations()
}) })
end end
-- All mapgens except mgv6 and singlenode
-- local function register_grass_decoration(offset, scale, length)
-- Register decorations
--
function default.register_decorations()
-- Flowers
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass", "default:sand"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.02, offset = offset,
scale = 0.03, scale = scale,
spread = {x = 100, y = 100, z = 100}, spread = {x = 100, y = 100, z = 100},
seed = 436, seed = 436,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"default:grassland"}, biomes = {
y_min = -31000, "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, y_max = 31000,
decoration = "flowers:rose", decoration = "default:grass_"..length,
}) })
end
local function register_dry_grass_decoration(offset, scale, length)
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_dry_grass"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.02, offset = offset,
scale = 0.03, scale = scale,
spread = {x = 100, y = 100, z = 100}, spread = {x = 100, y = 100, z = 100},
seed = 19822, seed = 19822,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"default:grassland"}, biomes = {"savana"},
y_min = -31000, y_min = -31000,
y_max = 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({ minetest.register_decoration({
deco_type = "simple", deco_type = "schematic",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.02, offset = offset,
scale = 0.03, scale = scale,
spread = {x = 100, y = 100, z = 100}, spread = {x = 100, y = 100, z = 100},
seed = 1220999, seed = 1220999,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.66
}, },
biomes = {"default:grassland"}, biomes = {"deciduous_forest"},
y_min = -31000, y_min = 6,
y_max = 31000, 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({ -- Jungle tree
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",
})
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "schematic",
place_on = {"default:dirt_with_grass"}, 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, sidelen = 16,
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
@ -837,38 +1238,43 @@ function default.register_decorations()
spread = {x = 100, y = 100, z = 100}, spread = {x = 100, y = 100, z = 100},
seed = 1133, seed = 1133,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.66
}, },
biomes = {"default:grassland"}, biomes = {"taiga", "coniferous_forest"},
y_min = -31000, y_min = 2,
y_max = 31000, 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({ minetest.register_decoration({
deco_type = "simple", deco_type = "schematic",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_dry_grass"},
sidelen = 16, sidelen = 80,
noise_params = { noise_params = {
offset = -0.02, offset = 0,
scale = 0.03, scale = 0.003,
spread = {x = 100, y = 100, z = 100}, spread = {x=250, y=250, z=250},
seed = 73133, seed = 2,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.66
}, },
biomes = {"default:grassland"}, biomes = {"savanna"},
y_min = -31000, y_min = 6,
y_max = 31000, 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({ minetest.register_decoration({
deco_type = "simple", deco_type = "schematic",
place_on = {"default:dirt_with_grass"}, place_on = {"default:desert_sand"},
sidelen = 16, sidelen = 80,
noise_params = { noise_params = {
offset = 0.04, offset = 0.04,
scale = 0.08, scale = 0.08,
@ -877,114 +1283,113 @@ function default.register_decorations()
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"default:grassland"}, biomes = {"desert"},
y_min = -31000, y_min = 2,
y_max = 31000, 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({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:desert_sand"},
sidelen = 16, sidelen = 80,
noise_params = { noise_params = {
offset = 0.02, offset = -0.0005,
scale = 0.08, scale = 0.0015,
spread = {x = 100, y = 100, z = 100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 230,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"default:grassland"}, biomes = {"desert"},
y_min = -31000, y_min = 2,
y_max = 31000, 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({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, 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, sidelen = 16,
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.08, scale = 0.02,
spread = {x = 100, y = 100, z = 100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 329,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"default:grassland"}, biomes = {"desert", "tundra"},
y_min = -31000, y_min = 2,
y_max = 31000, y_max = 31000,
decoration = "default:grass_3", decoration = "default:dry_shrub",
})
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",
}) })
end 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) function default.make_nyancat(pos, facedir, length)
local tailvec = {x = 0, y = 0, z = 0} local tailvec = {x = 0, y = 0, z = 0}
if facedir == 0 then if facedir == 0 then
@ -996,7 +1401,6 @@ function default.make_nyancat(pos, facedir, length)
elseif facedir == 3 then elseif facedir == 3 then
tailvec.x = -1 tailvec.x = -1
else else
--print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
facedir = 0 facedir = 0
tailvec.z = 1 tailvec.z = 1
end end
@ -1009,9 +1413,7 @@ function default.make_nyancat(pos, facedir, length)
end end
end end
function default.generate_nyancats(minp, maxp, seed) function default.generate_nyancats(minp, maxp, seed)
if minp.y < -19600 then return end -- no generate in nether
local height_min = -30000 local height_min = -30000
local height_max = 30000 local height_max = 30000
if maxp.y < height_min or minp.y > height_max then if maxp.y < height_min or minp.y > height_max then
@ -1034,4 +1436,21 @@ function default.generate_nyancats(minp, maxp, seed)
end 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 -- 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: --[[ Index:
Stone Stone
@ -28,6 +38,7 @@ Soft / Non-Stone
default:dirt default:dirt
default:dirt_with_grass default:dirt_with_grass
default:dirt_with_dry_grass
default:dirt_with_grass_footsteps default:dirt_with_grass_footsteps
default:dirt_with_snow default:dirt_with_snow
@ -59,11 +70,16 @@ default:junglewood
default:jungleleaves default:jungleleaves
default:junglesapling default:junglesapling
default:pinetree default:pine_tree
default:pinewood default:pine_wood
default:pine_needles default:pine_needles
default:pine_sapling default:pine_sapling
default:acacia_tree
default:acacia_wood
default:acacia_leaves
default:acacia_sapling
default:cherry_tree default:cherry_tree
default:cherry_log default:cherry_log
default:cherry_plank default:cherry_plank
@ -104,12 +120,19 @@ default:cactus
default:papyrus default:papyrus
default:dry_shrub default:dry_shrub
default:junglegrass default:junglegrass
default:grass_1 default:grass_1
default:grass_2 default:grass_2
default:grass_3 default:grass_3
default:grass_4 default:grass_4
default:grass_5 default:grass_5
default:dry_grass_1
default:dry_grass_2
default:dry_grass_3
default:dry_grass_4
default:dry_grass_5
Liquids Liquids
------- -------
(1. Source 2. Flowing) (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", { minetest.register_node("default:dirt_with_grass_footsteps", {
description = "Dirt with Grass and Footsteps", description = "Dirt with Grass and Footsteps",
tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, 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 = { node_box = {
type = "fixed", type = "fixed",
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}, groups = {crumbly=3,falling_node=1, melts = 1, float = 1},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.25}, footstep = {name = "default_snow_footstep", gain = 0.25},
dug = {name="default_snow_footstep", gain=0.75}, dug = {name = "default_snow_footstep", gain = 0.75},
}), }),
on_construct = function(pos) on_construct = function(pos)
pos.y = pos.y - 1 pos.y = pos.y - 1
if minetest.get_node(pos).name == "default:dirt_with_grass" then 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
end, end,
}) })
@ -553,6 +589,7 @@ minetest.register_node("default:leaves", {
waving = 1, waving = 1,
visual_scale = 1.3, visual_scale = 1.3,
tiles = {"default_leaves.png"}, tiles = {"default_leaves.png"},
special_tiles = {"default_leaves_simple.png"},
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
is_ground_content = false, is_ground_content = false,
@ -633,6 +670,7 @@ minetest.register_node("default:jungleleaves", {
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
waving = 1, waving = 1,
tiles = {"default_jungleleaves.png"}, tiles = {"default_jungleleaves.png"},
special_tiles = {"default_jungleleaves_simple.png"},
paramtype = "light", paramtype = "light",
is_ground_content = false, is_ground_content = false,
walkable = 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", 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", paramtype2 = "facedir",
is_ground_content = false, 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(), sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node on_place = minetest.rotate_node
}) })
minetest.register_node("default:pinewood", { minetest.register_node("default:pine_wood", {
description = "Pinewood Planks", description = "Pine Wood Planks",
tiles = {"default_pinewood.png"}, tiles = {"default_pine_wood.png"},
is_ground_content = false, 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(), sounds = default.node_sound_wood_defaults(),
}) })
@ -703,20 +742,12 @@ minetest.register_node("default:pine_needles",{
waving = 1, waving = 1,
paramtype = "light", paramtype = "light",
is_ground_content = false, is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
{ {items = {"default:pine_sapling"}, rarity = 20},
-- player will get sapling with 1/20 chance {items = {"default:pine_needles"}}
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"},
}
} }
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -732,13 +763,74 @@ minetest.register_node("default:pine_sapling", {
inventory_image = "default_pine_sapling.png", inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png", wield_image = "default_pine_sapling.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true, is_ground_content = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} 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(), sounds = default.node_sound_leaves_defaults(),
}) })
@ -1208,6 +1300,54 @@ for i=2,5 do
}) })
end 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 -- 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 random = math.random
local function can_grow(pos) local function can_grow(pos)
@ -17,10 +19,12 @@ local function can_grow(pos)
return true return true
end end
-- Sapling ABMs
-- Sapling ABM
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:sapling"}, nodenames = {"default:sapling", "default:junglesapling",
"default:pine_sapling", "default:acacia_sapling"},
interval = 10, interval = 10,
chance = 50, chance = 50,
action = function(pos, node) action = function(pos, node)
@ -28,43 +32,45 @@ minetest.register_abm({
return return
end 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)) minetest.pos_to_string(pos))
default.grow_tree(pos, random(1, 4) == 1) if mapgen == "v6" then
end default.grow_tree(pos, random(1, 4) == 1)
}) else
default.grow_new_apple_tree(pos)
minetest.register_abm({ end
nodenames = {"default:junglesapling"}, elseif node.name == "default:junglesapling" then
interval = 11, minetest.log("action", "A jungle sapling grows into a tree at "..
chance = 50, minetest.pos_to_string(pos))
action = function(pos, node) if mapgen == "v6" then
if not can_grow(pos) then default.grow_jungle_tree(pos)
return 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 end
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_jungle_tree(pos)
end 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)) -- Tree generation
default.grow_pine_tree(pos) --
end
})
-- 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, local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
height, size, iters, is_apple_tree) 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") local c_apple = minetest.get_content_id("default:apple")
-- Trunk -- Trunk
for y_dist = 0, height - 1 do data[a:index(x, y, z)] = tree_cid -- Force-place lowest trunk node to replace sapling
local vi = a:index(x, y + y_dist, z) for yy = y + 1, y + height - 1 do
local vi = a:index(x, yy, z)
local node_id = data[vi] local node_id = data[vi]
if y_dist == 0 or node_id == c_air or node_id == c_ignore if node_id == c_air or node_id == c_ignore or node_id == leaves_cid then
or node_id == leaves_cid then
data[vi] = tree_cid data[vi] = tree_cid
end end
end end
@ -123,7 +129,8 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
end end
end end
-- Appletree
-- Apple tree
function default.grow_tree(pos, is_apple_tree, bad) 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() vm:update_map()
end end
-- Jungletree
-- Jungle tree
function default.grow_jungle_tree(pos, bad) function default.grow_jungle_tree(pos, bad)
--[[ --[[
@ -206,16 +214,19 @@ function default.grow_jungle_tree(pos, bad)
vm:update_map() vm:update_map()
end 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) 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 data[vi] = c_pine_needles
end end
end end
local function add_snow(data, vi, c_air, c_ignore, c_snow) 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 data[vi] = c_snow
end end
end end
@ -226,7 +237,7 @@ function default.grow_pine_tree(pos)
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore") 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_pine_needles = minetest.get_content_id("default:pine_needles")
local c_snow = minetest.get_content_id("default:snow") local c_snow = minetest.get_content_id("default:snow")
local c_snowblock = minetest.get_content_id("default:snowblock") 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 a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data() 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 local snow = false
for yy = y - 1, y + 1 do for yy = y - 1, y + 1 do
for zz = z - 1, z + 1 do for zz = z - 1, z + 1 do
local vi = a:index(x - 1, yy, zz) local vi = a:index(x - 1, yy, zz)
for xx = x - 1, x + 1 do for xx = x - 1, x + 1 do
local nodid = data[vi] local nodid = data[vi]
if nodid == c_snow if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
or nodid == c_snowblock
or nodid == c_dirtsnow then
snow = true snow = true
end end
vi = vi + 1 vi = vi + 1
@ -266,7 +275,7 @@ function default.grow_pine_tree(pos)
for xx = x - dev, x + dev do for xx = x - dev, x + dev do
if random() < 0.95 - dev * 0.05 then if random() < 0.95 - dev * 0.05 then
add_pine_needles(data, vi, c_air, c_ignore, c_snow, add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles) c_pine_needles)
if snow then if snow then
add_snow(data, via, c_air, c_ignore, c_snow) add_snow(data, via, c_air, c_ignore, c_snow)
end end
@ -280,9 +289,9 @@ function default.grow_pine_tree(pos)
-- Centre top nodes -- Centre top nodes
add_pine_needles(data, a:index(x, maxy + 1, z), c_air, c_ignore, c_snow, 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, 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 if snow then
add_snow(data, a:index(x, maxy + 3, z), c_air, c_ignore, c_snow) add_snow(data, a:index(x, maxy + 3, z), c_air, c_ignore, c_snow)
end end
@ -301,7 +310,7 @@ function default.grow_pine_tree(pos)
local via = a:index(xi, yy + 1, zz) local via = a:index(xi, yy + 1, zz)
for xx = xi, xi + 1 do for xx = xi, xi + 1 do
add_pine_needles(data, vi, c_air, c_ignore, c_snow, add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles) c_pine_needles)
if snow then if snow then
add_snow(data, via, c_air, c_ignore, c_snow) add_snow(data, via, c_air, c_ignore, c_snow)
end end
@ -319,7 +328,7 @@ function default.grow_pine_tree(pos)
for xx = x - dev, x + dev do for xx = x - dev, x + dev do
if random() < 0.95 - dev * 0.05 then if random() < 0.95 - dev * 0.05 then
add_pine_needles(data, vi, c_air, c_ignore, c_snow, add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles) c_pine_needles)
if snow then if snow then
add_snow(data, via, c_air, c_ignore, c_snow) add_snow(data, via, c_air, c_ignore, c_snow)
end end
@ -332,9 +341,14 @@ function default.grow_pine_tree(pos)
end end
-- Trunk -- 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) 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 end
vm:set_data(data) vm:set_data(data)
@ -342,24 +356,49 @@ function default.grow_pine_tree(pos)
vm:update_map() vm:update_map()
end 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: -- From BFD:
minetest.register_node("default:mg_cherry_sapling", { minetest.register_node("default:mg_cherry_sapling", {
description = "Impossible to get node.", description = "Impossible to get node.",
visual_scale = 1.0, drawtype = "airlike",
inventory_image = "default_cherry_sapling.png",
wield_image = "default_cherry_sapling.png",
drawtype = "plantlike",
paramtype = "light", paramtype = "light",
tiles = {"default_cherry_sapling.png"}, tiles = {"xfences_space.png"},
walkable = false, groups = {not_in_creative_inventory=1},
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(),
}) })
local c_mg_cherry_sapling = minetest.get_content_id("default:mg_cherry_sapling") local c_mg_cherry_sapling = minetest.get_content_id("default:mg_cherry_sapling")

View File

@ -129,7 +129,7 @@ function doors.register_door(name, def)
local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
pos.y = pos.y+dir pos.y = pos.y+dir
if not minetest.get_node(pos).name == check_name then if minetest.get_node(pos).name ~= check_name then
return return
end end
local p2 = minetest.get_node(pos).param2 local p2 = minetest.get_node(pos).param2

View File

@ -14,3 +14,9 @@ http://sam.zoy.org/wtfpl/COPYING for more details.
License of media (textures and sounds) License of media (textures and sounds)
-------------------------------------- --------------------------------------
WTFPL WTFPL
Gambit (WTFPL):
flowers_mushroom_*.png
DanDuncombe (WTFPL):
flowers_spores_*.png

View File

@ -1,21 +1,33 @@
-- Minetest 0.4 mod: default -- Minetest 0.4 mod: default
-- See README.txt for licensing and other information. -- See README.txt for licensing and other information.
-- Namespace for functions -- Namespace for functions
flowers = {} flowers = {}
-- Map Generation -- Map Generation
dofile(minetest.get_modpath("flowers").."/mapgen.lua")
dofile(minetest.get_modpath("flowers") .. "/mapgen.lua")
--
-- Flowers
--
-- Aliases for original flowers mod -- Aliases for original flowers mod
minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white")
minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow")
minetest.register_alias("flowers:flower_geranium", "flowers:geranium")
minetest.register_alias("flowers:flower_rose", "flowers:rose") minetest.register_alias("flowers:flower_rose", "flowers:rose")
minetest.register_alias("flowers:flower_tulip", "flowers:tulip") minetest.register_alias("flowers:flower_tulip", "flowers:tulip")
minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow")
minetest.register_alias("flowers:flower_geranium", "flowers:geranium")
minetest.register_alias("flowers:flower_viola", "flowers:viola") minetest.register_alias("flowers:flower_viola", "flowers:viola")
minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white")
-- Flower registration
-- Flower registration function
local function add_simple_flower(name, desc, box, f_groups) local function add_simple_flower(name, desc, box, f_groups)
-- Common flowers' groups -- Common flowers' groups
f_groups.snappy = 3 f_groups.snappy = 3
@ -24,10 +36,10 @@ local function add_simple_flower(name, desc, box, f_groups)
f_groups.flora = 1 f_groups.flora = 1
f_groups.attached_node = 1 f_groups.attached_node = 1
minetest.register_node("flowers:"..name.."", { minetest.register_node("flowers:" .. name, {
description = desc, description = desc,
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "flowers_" .. name .. ".png" }, tiles = {"flowers_" .. name .. ".png"},
inventory_image = "flowers_" .. name .. ".png", inventory_image = "flowers_" .. name .. ".png",
wield_image = "flowers_" .. name .. ".png", wield_image = "flowers_" .. name .. ".png",
sunlight_propagates = true, sunlight_propagates = true,
@ -43,14 +55,13 @@ local function add_simple_flower(name, desc, box, f_groups)
}) })
end end
-- Registrations using the function above
flowers.datas = { flowers.datas = {
{"dandelion_yellow", "Yellow Dandelion", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_yellow=1}}, {"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1}},
{"geranium", "Blue Geranium", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_blue=1}}, {"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1}},
{"rose", "Rose", { -0.15, -0.5, -0.15, 0.15, 0.3, 0.15 }, {color_red=1}}, {"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1}},
{"tulip", "Orange Tulip", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_orange=1}}, {"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1}},
{"dandelion_white", "White dandelion", { -0.5, -0.5, -0.5, 0.5, -0.2, 0.5 }, {color_white=1}}, {"viola", "Viola", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1}},
{"viola", "Viola", { -0.5, -0.5, -0.5, 0.5, -0.2, 0.5 }, {color_violet=1}} {"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1}}
} }
for _,item in pairs(flowers.datas) do for _,item in pairs(flowers.datas) do
@ -81,6 +92,8 @@ minetest.register_node("flowers:lily_pad", {
}, },
}) })
-- Flower spread
minetest.register_abm({ minetest.register_abm({
nodenames = {"group:flora"}, nodenames = {"group:flora"},
neighbors = {"default:dirt_with_grass", "default:desert_sand"}, neighbors = {"default:dirt_with_grass", "default:desert_sand"},
@ -91,7 +104,7 @@ minetest.register_abm({
local under = minetest.get_node(pos) local under = minetest.get_node(pos)
pos.y = pos.y + 1 pos.y = pos.y + 1
if under.name == "default:desert_sand" then if under.name == "default:desert_sand" then
minetest.set_node(pos, {name="default:dry_shrub"}) minetest.set_node(pos, {name = "default:dry_shrub"})
elseif under.name ~= "default:dirt_with_grass" then elseif under.name ~= "default:dirt_with_grass" then
return return
end end
@ -101,8 +114,8 @@ minetest.register_abm({
return return
end end
local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4} local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4}
local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4} local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4}
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
return return
end end
@ -121,8 +134,127 @@ minetest.register_abm({
return return
end end
if minetest.get_node(seedling).name == "air" then if minetest.get_node(seedling).name == "air" then
minetest.set_node(seedling, {name=node.name}) minetest.set_node(seedling, {name = node.name})
end end
end end
end, end,
}) })
--
-- Mushrooms
--
local mushrooms_datas = {
{"brown", 2},
{"red", -6}
}
for _, m in pairs(mushrooms_datas) do
local name, nut = m[1], m[2]
-- Register fertile mushrooms
-- These are placed by mapgen and the growing ABM.
-- These drop an infertile mushroom, and 0 to 3 spore
-- nodes with an average of 1.25 per mushroom, for
-- a slow multiplication of mushrooms when farming.
minetest.register_node("flowers:mushroom_fertile_" .. name, {
description = string.sub(string.upper(name), 0, 1) ..
string.sub(name, 2) .. " Fertile Mushroom",
tiles = {"flowers_mushroom_" .. name .. ".png"},
inventory_image = "flowers_mushroom_" .. name .. ".png",
wield_image = "flowers_mushroom_" .. name .. ".png",
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1,
not_in_creative_inventory = 1},
drop = {
items = {
{items = {"flowers:mushroom_" .. name}},
{items = {"flowers:mushroom_spores_" .. name}, rarity = 4},
{items = {"flowers:mushroom_spores_" .. name}, rarity = 2},
{items = {"flowers:mushroom_spores_" .. name}, rarity = 2}
}
},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(nut),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}
})
-- Register infertile mushrooms
-- These do not drop spores, to avoid the use of repeated digging
-- and placing of a single mushroom to generate unlimited spores.
minetest.register_node("flowers:mushroom_" .. name, {
description = string.sub(string.upper(name), 0, 1) ..
string.sub(name, 2) .. " Mushroom",
tiles = {"flowers_mushroom_" .. name .. ".png"},
inventory_image = "flowers_mushroom_" .. name .. ".png",
wield_image = "flowers_mushroom_" .. name .. ".png",
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(nut),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}
})
-- Register mushroom spores
minetest.register_node("flowers:mushroom_spores_" .. name, {
description = string.sub(string.upper(name), 0, 1) ..
string.sub(name, 2) .. " Mushroom Spores",
drawtype = "signlike",
tiles = {"flowers_mushroom_spores_" .. name .. ".png"},
inventory_image = "flowers_mushroom_spores_" .. name .. ".png",
wield_image = "flowers_mushroom_spores_" .. name .. ".png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
selection_box = {
type = "wallmounted",
},
groups = {dig_immediate = 3, attached_node = 1},
})
end
-- Register growing ABM
minetest.register_abm({
nodenames = {"flowers:mushroom_spores_brown", "flowers:mushroom_spores_red"},
interval = 11,
chance = 50,
action = function(pos, node)
local node_under = minetest.get_node_or_nil({x = pos.x,
y = pos.y - 1, z = pos.z})
if not node_under then
return
end
if minetest.get_item_group(node_under.name, "soil") ~= 0 and
minetest.get_node_light(pos, nil) <= 13 then
if node.name == "flowers:mushroom_spores_brown" then
minetest.set_node(pos, {name = "flowers:mushroom_fertile_brown"})
elseif node.name == "flowers:mushroom_spores_red" then
minetest.set_node(pos, {name = "flowers:mushroom_fertile_red"})
end
end
end
})

View File

@ -1,4 +1,8 @@
local function register_flower(name) --
-- Mgv6
--
local function register_mgv6_flower(name)
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
@ -17,15 +21,102 @@ local function register_flower(name)
}) })
end end
function flowers.register_mgv6_decorations() local function register_mgv6_mushroom(name)
register_flower("rose") minetest.register_decoration({
register_flower("tulip") deco_type = "simple",
register_flower("dandelion_yellow") place_on = {"default:dirt_with_grass"},
register_flower("geranium") sidelen = 16,
register_flower("viola") noise_params = {
register_flower("dandelion_white") offset = 0,
scale = 0.04,
spread = {x=100, y=100, z=100},
seed = 7133,
octaves = 3,
persist = 0.6
},
y_min = 1,
y_max = 30,
decoration = "flowers:"..name,
spawn_by = "default:tree",
num_spawn_by = 1,
})
end end
function flowers.register_mgv6_decorations()
register_mgv6_flower("rose")
register_mgv6_flower("tulip")
register_mgv6_flower("dandelion_yellow")
register_mgv6_flower("geranium")
register_mgv6_flower("viola")
register_mgv6_flower("dandelion_white")
register_mgv6_mushroom("mushroom_fertile_brown")
register_mgv6_mushroom("mushroom_fertile_red")
end
--
-- All other biome API mapgens
--
local function register_flower(seed, name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=200, y=200, z=200},
seed = seed,
octaves = 3,
persist = 0.6
},
biomes = {
"stone_grassland",
"sandstone_grassland",
"deciduous_forest",
"coniferous_forest",
},
y_min = 6,
y_max = 31000,
decoration = "flowers:"..name,
})
end
local function register_mushroom(name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.006,
spread = {x=200, y=200, z=200},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest", "coniferous_forest"},
y_min = 6,
y_max = 31000,
decoration = "flowers:"..name,
})
end
function flowers.register_decorations()
register_flower(436, "rose")
register_flower(19822, "tulip")
register_flower(1220999, "dandelion_yellow")
register_flower(36662, "geranium")
register_flower(1133, "viola")
register_flower(73133, "dandelion_white")
register_mushroom("mushroom_fertile_brown")
register_mushroom("mushroom_fertile_red")
end
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:water_source"}, place_on = {"default:water_source"},
@ -78,10 +169,16 @@ minetest.register_decoration({
}) })
-- Enable in mapgen v6 only --
-- 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
-- Enable in mapgen v6 only
local mg_params = minetest.get_mapgen_params() local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v6" then if mg_params.mgname == "v6" then
flowers.register_mgv6_decorations() flowers.register_mgv6_decorations()
elseif mg_params.mgname ~= "singlenode" then
flowers.register_decorations()
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 94 B

After

Width:  |  Height:  |  Size: 94 B

View File

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

View File

@ -1 +1,2 @@
default default
farming

View File

@ -1,14 +1,25 @@
-- Minetest 0.4 mod: stairs -- Minetest 0.4 mod: stairs
-- See README.txt for licensing and other information. -- See README.txt for licensing and other information.
-- Global namespace for functions
stairs = {} stairs = {}
-- Get setting for replace ABM
local replace = minetest.setting_getbool("enable_stairs_replace_abm")
-- Register stairs.
-- Node will be called stairs:stair_<subname> -- Node will be called stairs:stair_<subname>
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds) function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
minetest.register_node(":stairs:stair_" .. subname, { minetest.register_node(":stairs:stair_" .. subname, {
description = description, description = description,
drawtype = "mesh", drawtype = "mesh",
mesh = "stairs.obj", mesh = "stairs_stair.obj",
tiles = images, tiles = images,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
@ -48,7 +59,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
param2 = minetest.dir_to_facedir(dir) param2 = minetest.dir_to_facedir(dir)
end end
if p0.y-1 == p1.y then if p0.y - 1 == p1.y then
param2 = param2 + 20 param2 = param2 + 20
if param2 == 21 then if param2 == 21 then
param2 = 23 param2 = 23
@ -62,10 +73,12 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
}) })
-- for replace ABM -- for replace ABM
minetest.register_node(":stairs:stair_" .. subname.."upside_down", { if replace then
replace_name = "stairs:stair_" .. subname, minetest.register_node(":stairs:stair_" .. subname .. "upside_down", {
groups = {slabs_replace=1}, replace_name = "stairs:stair_" .. subname,
}) groups = {slabs_replace = 1},
})
end
minetest.register_craft({ minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 6', output = 'stairs:stair_' .. subname .. ' 6',
@ -87,7 +100,10 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
}) })
end end
-- Register slabs.
-- Node will be called stairs:slab_<subname> -- Node will be called stairs:slab_<subname>
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds) function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
minetest.register_node(":stairs:slab_" .. subname, { minetest.register_node(":stairs:slab_" .. subname, {
description = description, description = description,
@ -120,7 +136,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and
n0.param2 >= 20) n0.param2 >= 20)
if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and p0.y+1 == p1.y then if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and
p0.y + 1 == p1.y then
slabpos = p0 slabpos = p0
slabnode = n0 slabnode = n0
elseif n1.name == "stairs:slab_" .. subname then elseif n1.name == "stairs:slab_" .. subname then
@ -136,7 +153,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
pointed_thing.above = slabpos pointed_thing.above = slabpos
local success local success
fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) fakestack, success = minetest.item_place(fakestack, placer,
pointed_thing)
-- If the item was taken from the fake stack, decrement original -- If the item was taken from the fake stack, decrement original
if success then if success then
itemstack:set_count(fakestack:get_count()) itemstack:set_count(fakestack:get_count())
@ -148,7 +166,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
end end
-- Upside down slabs -- Upside down slabs
if p0.y-1 == p1.y then if p0.y - 1 == p1.y then
-- Turn into full block if pointing at a existing slab -- Turn into full block if pointing at a existing slab
if n0_is_upside_down then if n0_is_upside_down then
-- Remove the slab at the position of the slab -- Remove the slab at the position of the slab
@ -159,7 +177,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
pointed_thing.above = p0 pointed_thing.above = p0
local success local success
fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) fakestack, success = minetest.item_place(fakestack, placer,
pointed_thing)
-- If the item was taken from the fake stack, decrement original -- If the item was taken from the fake stack, decrement original
if success then if success then
itemstack:set_count(fakestack:get_count()) itemstack:set_count(fakestack:get_count())
@ -175,7 +194,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
end end
-- If pointing at the side of a upside down slab -- If pointing at the side of a upside down slab
if n0_is_upside_down and p0.y+1 ~= p1.y then if n0_is_upside_down and p0.y + 1 ~= p1.y then
param2 = 20 param2 = 20
end end
@ -184,10 +203,12 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
}) })
-- for replace ABM -- for replace ABM
minetest.register_node(":stairs:slab_" .. subname.."upside_down", { if replace then
replace_name = "stairs:slab_"..subname, minetest.register_node(":stairs:slab_" .. subname .. "upside_down", {
groups = {slabs_replace=1}, replace_name = "stairs:slab_".. subname,
}) groups = {slabs_replace = 1},
})
end
minetest.register_craft({ minetest.register_craft({
output = 'stairs:slab_' .. subname .. ' 6', output = 'stairs:slab_' .. subname .. ' 6',
@ -197,127 +218,180 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
}) })
end end
-- Replace old "upside_down" nodes with new param2 versions
minetest.register_abm({
nodenames = {"group:slabs_replace"},
interval = 1,
chance = 1,
action = function(pos, node)
node.name = minetest.registered_nodes[node.name].replace_name
node.param2 = node.param2 + 20
if node.param2 == 21 then
node.param2 = 23
elseif node.param2 == 23 then
node.param2 = 21
end
minetest.set_node(pos, node)
end,
})
-- Optionally replace old "upside_down" nodes with new param2 versions.
-- Disabled by default.
if replace then
minetest.register_abm({
nodenames = {"group:slabs_replace"},
interval = 8,
chance = 1,
action = function(pos, node)
node.name = minetest.registered_nodes[node.name].replace_name
node.param2 = node.param2 + 20
if node.param2 == 21 then
node.param2 = 23
elseif node.param2 == 23 then
node.param2 = 21
end
minetest.set_node(pos, node)
end,
})
end
-- Stair/slab registration function.
-- Nodes will be called stairs:{stair,slab}_<subname> -- Nodes will be called stairs:{stair,slab}_<subname>
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
function stairs.register_stair_and_slab(subname, recipeitem, groups, images,
desc_stair, desc_slab, sounds)
stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds) stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds) stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
end end
-- Register default stairs and slabs
stairs.register_stair_and_slab("wood", "default:wood", stairs.register_stair_and_slab("wood", "default:wood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"default_wood.png"}, {"default_wood.png"},
"Wooden Stair", "Wooden Stair",
"Wooden Slab", "Wooden Slab",
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
stairs.register_stair_and_slab("junglewood", "default:junglewood",
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"default_junglewood.png"},
"Junglewood Stair",
"Junglewood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("pine_wood", "default:pine_wood",
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"default_pine_wood.png"},
"Pine Wood Stair",
"Pine Wood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("acacia_wood", "default:acacia_wood",
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"default_acacia_wood.png"},
"Acacia Wood Stair",
"Acacia Wood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("stone", "default:stone", stairs.register_stair_and_slab("stone", "default:stone",
{cracky=3}, {cracky = 3},
{"default_stone.png"}, {"default_stone.png"},
"Stone Stair", "Stone Stair",
"Stone Slab", "Stone Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("cobble", "default:cobble", stairs.register_stair_and_slab("cobble", "default:cobble",
{cracky=3}, {cracky = 3},
{"default_cobble.png"}, {"default_cobble.png"},
"Cobblestone Stair", "Cobblestone Stair",
"Cobblestone Slab", "Cobblestone Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("stonebrick", "default:stonebrick",
{cracky = 3},
{"default_stone_brick.png"},
"Stone Brick Stair",
"Stone Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("desert_stone", "default:desert_stone", stairs.register_stair_and_slab("desert_stone", "default:desert_stone",
{cracky=3}, {cracky = 3},
{"default_desert_stone.png"}, {"default_desert_stone.png"},
"Desertstone Stair", "Desertstone Stair",
"Desertstone Slab", "Desertstone Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("desert_cobble", "default:desert_cobble", stairs.register_stair_and_slab("desert_cobble", "default:desert_cobble",
{cracky=3}, {cracky = 3},
{"default_desert_cobble.png"}, {"default_desert_cobble.png"},
"Desert Cobblestone Stair", "Desert Cobblestone Stair",
"Desert Cobblestone Slab", "Desert Cobblestone Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick", stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick",
{cracky=3}, {cracky = 3},
{"default_desert_stone_brick.png"}, {"default_desert_stone_brick.png"},
"Desert Stone Brick Stair", "Desert Stone Brick Stair",
"Desert Stone Brick Slab", "Desert Stone Brick Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("brick", "default:brick",
{cracky=3},
{"default_brick.png"},
"Brick Stair",
"Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("sandstone", "default:sandstone", stairs.register_stair_and_slab("sandstone", "default:sandstone",
{crumbly=1,cracky=3}, {crumbly = 2, cracky = 2},
{"default_sandstone.png"}, {"default_sandstone.png"},
"Sandstone Stair", "Sandstone Stair",
"Sandstone Slab", "Sandstone Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick", stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick",
{crumbly=2,cracky=2}, {crumbly = 2, cracky = 2},
{"default_sandstone_brick.png"}, {"default_sandstone_brick.png"},
"Sandstone Brick Stair", "Sandstone Brick Stair",
"Sandstone Brick Slab", "Sandstone Brick Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("junglewood", "default:junglewood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"default_junglewood.png"},
"Junglewood Stair",
"Junglewood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("stonebrick", "default:stonebrick",
{cracky=3},
{"default_stone_brick.png"},
"Stone Brick Stair",
"Stone Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("pinewood", "default:pinewood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"default_pinewood.png"},
"Pinewood Stair",
"Pinewood Slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("obsidian", "default:obsidian", stairs.register_stair_and_slab("obsidian", "default:obsidian",
{cracky=1,level=2}, {cracky = 1, level = 2},
{"default_obsidian.png"}, {"default_obsidian.png"},
"Obsidian Stair", "Obsidian Stair",
"Obsidian Slab", "Obsidian Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick", stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick",
{cracky=1,level=2}, {cracky = 1, level = 2},
{"default_obsidian_brick.png"}, {"default_obsidian_brick.png"},
"Obsidian Brick Stair", "Obsidian Brick Stair",
"Obsidian Brick Slab", "Obsidian Brick Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("brick", "default:brick",
{cracky = 3},
{"default_brick.png"},
"Brick Stair",
"Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("straw", "farming:straw",
{snappy = 3, flammable = 4},
{"farming_straw.png"},
"Straw Stair",
"Straw Slab",
default.node_sound_leaves_defaults())
stairs.register_stair_and_slab("steelblock", "default:steelblock",
{cracky = 1, level = 2},
{"default_steel_block.png"},
"Steel Block Stair",
"Steel Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("copperblock", "default:copperblock",
{cracky = 1, level = 2},
{"default_copper_block.png"},
"Copper Block Stair",
"Copper Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("bronzeblock", "default:bronzeblock",
{cracky = 1, level = 2},
{"default_bronze_block.png"},
"Bronze Block Stair",
"Bronze Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("goldblock", "default:goldblock",
{cracky = 1},
{"default_gold_block.png"},
"Gold Block Stair",
"Gold Block Slab",
default.node_sound_stone_defaults())
-- From BFD: -- From BFD:
stairs.register_stair_and_slab("cherry_wood", "default:cherry_plank", stairs.register_stair_and_slab("cherry_wood", "default:cherry_plank",

View File

@ -185,7 +185,7 @@ xpanes.register_pane("bar", {
textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"}, textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"},
inventory_image = "xpanes_bar.png", inventory_image = "xpanes_bar.png",
wield_image = "xpanes_bar.png", wield_image = "xpanes_bar.png",
groups = {cracky=3, pane=1}, groups = {cracky=3, pane=1}, -- //MFF
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
recipe = { recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},

View File

@ -118,18 +118,24 @@ moretrees.rubber_tree_biome = {
} }
moretrees.jungletree_biome = { moretrees.jungletree_biome = {
surface = "default:dirt_with_grass", surface = {
avoid_nodes = moretrees.avoidnodes, "default:dirt",
avoid_radius = 5, "default:dirt_with_grass",
"woodsoils:dirt_with_leaves_1",
"woodsoils:grass_with_leaves_1",
"woodsoils:grass_with_leaves_2"
},
avoid_nodes = {"moretrees:jungletree_trunk"},
max_count = 12,
avoid_radius = 3,
rarity = 85,
seed_diff = 329, seed_diff = 329,
min_elevation = -5, min_elevation = 1,
max_elevation = 10, near_nodes = {"default:jungletree"},
temp_min = 0.25, near_nodes_size = 6,
near_nodes = {"default:water_source"}, near_nodes_vertical = 2,
near_nodes_size = 20, near_nodes_count = 1,
near_nodes_count = 7, plantlife_limit = -0.9,
rarity = 10,
max_count = 10,
} }
moretrees.spruce_biome = { moretrees.spruce_biome = {
@ -180,4 +186,3 @@ moretrees.fir_biome_snow = {
delete_above = true, delete_above = true,
spawn_replace_node = true spawn_replace_node = true
} }

View File

@ -38,18 +38,6 @@ moretrees.plantlike_leaves = false
moretrees.enable_leafdecay = true moretrees.enable_leafdecay = true
-- Enable this one if you want this mod's leafdecay code to affect the old
-- default trees too; this setting is independent of the one above. You'll
-- want to manually disable the default leafdecay code in minetest_game if
-- you enable this, otherwise you'll have two sets of leaf decay code running
-- at the same time, which will just waste CPU for no benefit.
moretrees.enable_default_leafdecay = true
-- Enable this one for default *jungle* leaves
moretrees.enable_default_jungle_leafdecay = true
-- Enable this if you want moretrees to redefine default apples so that they -- Enable this if you want moretrees to redefine default apples so that they
-- fall when leaves decay/are dug. -- fall when leaves decay/are dug.
@ -61,10 +49,6 @@ moretrees.leafdecay_delay = 2
moretrees.leafdecay_chance = 100 moretrees.leafdecay_chance = 100
moretrees.leafdecay_radius = 5 moretrees.leafdecay_radius = 5
moretrees.default_jungle_leafdecay_delay = 2
moretrees.default_jungle_leafdecay_chance = 100
moretrees.default_jungle_leafdecay_radius = 5
moretrees.palm_leafdecay_radius = 15 moretrees.palm_leafdecay_radius = 15
moretrees.default_leafdecay_delay = 3 moretrees.default_leafdecay_delay = 3

View File

@ -13,8 +13,7 @@
-- by RealBadAngel. -- by RealBadAngel.
-- --
-- License: WTFPL for all parts (code and textures, including those copied -- License: WTFPL for all parts (code and textures, including those copied
-- from the jungletree and conifers mods) except the default jungle tree trunk -- from the the old jungletree and conifers mods).
-- texture, which is CC-By-SA.
moretrees = {} moretrees = {}
@ -120,14 +119,13 @@ else
moretrees.spawn_rubber_tree_object = moretrees.rubber_tree_model moretrees.spawn_rubber_tree_object = moretrees.rubber_tree_model
moretrees.spawn_willow_object = moretrees.willow_model moretrees.spawn_willow_object = moretrees.willow_model
moretrees.spawn_acacia_object = moretrees.acacia_model moretrees.spawn_acacia_object = moretrees.acacia_model
moretrees.spawn_birch_object = "moretrees:grow_birch" moretrees.spawn_birch_object = "moretrees.grow_birch"
moretrees.spawn_spruce_object = "moretrees:grow_spruce" moretrees.spawn_spruce_object = "moretrees.grow_spruce"
moretrees.spawn_jungletree_object = "moretrees:grow_jungletree" moretrees.spawn_jungletree_object = "moretrees.grow_jungletree"
moretrees.spawn_fir_object = "moretrees:grow_fir" moretrees.spawn_fir_object = "moretrees.grow_fir"
moretrees.spawn_fir_snow_object = "moretrees:grow_fir_snow" moretrees.spawn_fir_snow_object = "moretrees.grow_fir_snow"
end end
if moretrees.enable_beech then if moretrees.enable_beech then
biome_lib:register_generate_plant(moretrees.beech_biome, moretrees.spawn_beech_object) biome_lib:register_generate_plant(moretrees.beech_biome, moretrees.spawn_beech_object)
end end
@ -185,7 +183,7 @@ end
-- Code to spawn a birch tree -- Code to spawn a birch tree
function moretrees:grow_birch(pos) function moretrees.grow_birch(pos)
minetest.remove_node(pos) minetest.remove_node(pos)
if math.random(1,2) == 1 then if math.random(1,2) == 1 then
minetest.spawn_tree(pos, moretrees.birch_model1) minetest.spawn_tree(pos, moretrees.birch_model1)
@ -196,7 +194,7 @@ end
-- Code to spawn a spruce tree -- Code to spawn a spruce tree
function moretrees:grow_spruce(pos) function moretrees.grow_spruce(pos)
minetest.remove_node(pos) minetest.remove_node(pos)
if math.random(1,2) == 1 then if math.random(1,2) == 1 then
minetest.spawn_tree(pos, moretrees.spruce_model1) minetest.spawn_tree(pos, moretrees.spruce_model1)
@ -221,7 +219,7 @@ moretrees.ct_rules_b1 = "[-FBf][+FBf]"
moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A" moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
moretrees.ct_rules_b2 = "[-fB][+fB]" moretrees.ct_rules_b2 = "[-fB][+fB]"
function moretrees:grow_jungletree(pos) function moretrees.grow_jungletree(pos)
local r1 = math.random(2) local r1 = math.random(2)
local r2 = math.random(3) local r2 = math.random(3)
if r1 == 1 then if r1 == 1 then
@ -261,7 +259,7 @@ end
-- code to spawn fir trees -- code to spawn fir trees
function moretrees:grow_fir(pos) function moretrees.grow_fir(pos)
if math.random(2) == 1 then if math.random(2) == 1 then
moretrees.fir_model.leaves="moretrees:fir_leaves" moretrees.fir_model.leaves="moretrees:fir_leaves"
else else
@ -288,7 +286,7 @@ end
-- same thing, but a smaller version that grows only in snow biomes -- same thing, but a smaller version that grows only in snow biomes
function moretrees:grow_fir_snow(pos) function moretrees.grow_fir_snow(pos)
if math.random(2) == 1 then if math.random(2) == 1 then
moretrees.fir_model.leaves="moretrees:fir_leaves" moretrees.fir_model.leaves="moretrees:fir_leaves"
else else

View File

@ -19,7 +19,7 @@ end
if moretrees.enable_leafdecay then if moretrees.enable_leafdecay then
for i in ipairs(moretrees.treelist) do for i in ipairs(moretrees.treelist) do
local treename = moretrees.treelist[i][1] local treename = moretrees.treelist[i][1]
if treename ~= "jungletree" and treename ~= "fir" and treename ~= "palm" then if treename ~= "jungletree" and treename ~= "pine" and treename ~= "acacia" and treename ~= "fir" and treename ~= "palm" then
minetest.register_abm({ minetest.register_abm({
nodenames = "moretrees:"..treename.."_leaves", nodenames = "moretrees:"..treename.."_leaves",
interval = moretrees.leafdecay_delay, interval = moretrees.leafdecay_delay,
@ -35,11 +35,11 @@ if moretrees.enable_leafdecay then
end end
minetest.register_abm({ minetest.register_abm({
nodenames = {"moretrees:jungletree_leaves_red","moretrees:jungletree_leaves_green","moretrees:jungletree_leaves_yellow"}, nodenames = {"default:jungleleaves", "moretrees:jungletree_leaves_red", "moretrees:jungletree_leaves_yellow"},
interval = moretrees.leafdecay_delay, interval = moretrees.leafdecay_delay,
chance = moretrees.leafdecay_chance, chance = moretrees.leafdecay_chance,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.find_node_near(pos, moretrees.leafdecay_radius, {"ignore", "default:jungletree", "moretrees:jungletree_trunk"}) then return end if minetest.find_node_near(pos, moretrees.leafdecay_radius, {"ignore", "default:jungletree"}) then return end
process_drops(pos, node.name) process_drops(pos, node.name)
minetest.remove_node(pos) minetest.remove_node(pos)
nodeupdate(pos) nodeupdate(pos)
@ -71,21 +71,6 @@ if moretrees.enable_leafdecay then
}) })
end end
if moretrees.enable_default_leafdecay then
minetest.register_abm({
nodenames = "default:leaves",
interval = moretrees.default_leafdecay_delay,
chance = moretrees.default_leafdecay_chance,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.find_node_near(pos, moretrees.default_leafdecay_radius, { "ignore", "default:tree" }) then return end
process_drops(pos, node.name)
minetest.remove_node(pos)
nodeupdate(pos)
end
})
end
-- Decay apple tree blossoms from nature_classic mod -- Decay apple tree blossoms from nature_classic mod
if minetest.get_modpath("nature_classic") then if minetest.get_modpath("nature_classic") then
minetest.register_abm({ minetest.register_abm({
@ -100,18 +85,3 @@ if minetest.get_modpath("nature_classic") then
end end
}) })
end end
if moretrees.enable_default_jungle_leafdecay then
minetest.register_abm({
nodenames = "default:jungleleaves",
interval = moretrees.default_jungle_leafdecay_delay,
chance = moretrees.default_jungle_leafdecay_chance,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.find_node_near(pos, moretrees.default_jungle_leafdecay_radius, { "ignore", "default:jungletree" }) then return end
process_drops(pos, node.name)
minetest.remove_node(pos)
nodeupdate(pos)
end
})
end

View File

@ -65,7 +65,6 @@ Spruce Cone = Fichtenzapfen
Pine Cone = Kiefernzapfen Pine Cone = Kiefernzapfen
Fir Cone = Tannenzapfen Fir Cone = Tannenzapfen
Jungle Sapling = Tropenbaumsetzling Jungle Sapling = Tropenbaumsetzling
Jungle Tree Leaves (Green) = Tropenbaumlaub (gruen)
Jungle Tree Leaves (Yellow) = Tropenbaumlaub (gelb) Jungle Tree Leaves (Yellow) = Tropenbaumlaub (gelb)
Jungle Tree Leaves (Red) = Tropenbaumlaub (rot) Jungle Tree Leaves (Red) = Tropenbaumlaub (rot)
Douglas Fir Leaves (Bright) = Douglasiennadeln (breit) Douglas Fir Leaves (Bright) = Douglasiennadeln (breit)

View File

@ -65,7 +65,6 @@ Spruce Cone =
Pine Cone = Pine Cone =
Fir Cone = Fir Cone =
Jungle Sapling = Jungle Sapling =
Jungle Tree Leaves (Green) =
Jungle Tree Leaves (Yellow) = Jungle Tree Leaves (Yellow) =
Jungle Tree Leaves (Red) = Jungle Tree Leaves (Red) =
Douglas Fir Leaves (Bright) = Douglas Fir Leaves (Bright) =

View File

@ -5,17 +5,18 @@ moretrees.avoidnodes = {}
moretrees.treelist = { moretrees.treelist = {
{"beech", "Beech Tree"}, {"beech", "Beech Tree"},
{"apple_tree", "Apple Tree"}, {"apple_tree", "Apple Tree"},
{"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"sequoia", "Giant Sequoia"}, {"sequoia", "Giant Sequoia"},
{"birch", "Birch Tree"}, {"birch", "Birch Tree"},
{"palm", "Palm Tree", "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 }, {"palm", "Palm Tree", "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 },
{"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"pine", "Pine Tree", "pine_cone", "Pine Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"willow", "Willow Tree"}, {"willow", "Willow Tree"},
{"acacia", "Acacia Tree"},
{"rubber_tree", "Rubber Tree"}, {"rubber_tree", "Rubber Tree"},
{"jungletree", "Jungle Tree"}, {"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"jungletree", "Jungle Tree", nil, nil, nil, nil, "default_junglesapling.png" },
{"pine", "Pine Tree", "pine_cone", "Pine Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8, "default_pine_sapling.png" },
{"acacia", "Acacia Tree", nil, nil, nil, nil, "default_acacia_sapling.png" },
} }
local dirs1 = { 21, 20, 23, 22, 21 } local dirs1 = { 21, 20, 23, 22, 21 }
@ -75,9 +76,10 @@ for i in ipairs(moretrees.treelist) do
local fruitdesc = moretrees.treelist[i][4] local fruitdesc = moretrees.treelist[i][4]
local selbox = moretrees.treelist[i][5] local selbox = moretrees.treelist[i][5]
local vscale = moretrees.treelist[i][6] local vscale = moretrees.treelist[i][6]
local saptext = moretrees.treelist[i][7] or "moretrees_"..treename.."_sapling.png"
if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes. if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes.
-- and treename ~= "acacia" UNCOMMENT WHEN ACACIA IS MERGED FROM MT_GAME and treename ~= "acacia"
and treename ~= "pine" then and treename ~= "pine" then
minetest.register_node("moretrees:"..treename.."_trunk", { minetest.register_node("moretrees:"..treename.."_trunk", {
@ -105,8 +107,8 @@ for i in ipairs(moretrees.treelist) do
minetest.register_node("moretrees:"..treename.."_sapling", { minetest.register_node("moretrees:"..treename.."_sapling", {
description = S(treedesc.." Sapling"), description = S(treedesc.." Sapling"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"moretrees_"..treename.."_sapling.png"}, tiles = {saptext},
inventory_image = "moretrees_"..treename.."_sapling.png", inventory_image = saptext,
paramtype = "light", paramtype = "light",
paramtype2 = "waving", paramtype2 = "waving",
walkable = false, walkable = false,
@ -118,28 +120,10 @@ for i in ipairs(moretrees.treelist) do
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
description = S(treedesc.." Sapling"),
drawtype = "plantlike",
tiles = {"moretrees_"..treename.."_sapling.png"},
inventory_image = "moretrees_"..treename.."_sapling.png",
paramtype = "light",
paramtype2 = "waving",
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,not_in_creative_inventory=1,sapling=1},
sounds = default.node_sound_defaults(),
drop = "moretrees:"..treename.."_sapling"
})
-- player will get a sapling with 1/100 chance -- player will get a sapling with 1/100 chance
-- player will get leaves only if he/she gets no saplings, -- player will get leaves only if he/she gets no saplings,
-- this is because max_items is 1 -- this is because max_items is 1
local droprarity = 100 local droprarity = 100
if treename == "palm" then if treename == "palm" then
@ -183,7 +167,7 @@ for i in ipairs(moretrees.treelist) do
stairsplus:register_all( stairsplus:register_all(
"moretrees", "moretrees",
treename.."_trunk", treename.."_trunk",
"moretrees:"..treename.."_trunk", "moretrees:"..treename.."_trunk",
{ {
groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 }, groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 },
tiles = { tiles = {
@ -235,6 +219,23 @@ for i in ipairs(moretrees.treelist) do
end end
end end
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
description = S(treedesc.." Sapling"),
drawtype = "plantlike",
tiles = {saptext},
inventory_image = saptext,
paramtype = "light",
paramtype2 = "waving",
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,not_in_creative_inventory=1,sapling=1},
sounds = default.node_sound_defaults(),
drop = "moretrees:"..treename.."_sapling"
})
if fruit then if fruit then
minetest.register_node("moretrees:"..fruit, { minetest.register_node("moretrees:"..fruit, {
description = S(fruitdesc), description = S(fruitdesc),
@ -276,46 +277,9 @@ end
-- Extra nodes for jungle trees: -- Extra nodes for jungle trees:
minetest.register_node("moretrees:jungletree_sapling", { local jungleleaves = {"yellow","red"}
description = S("Jungle Sapling"), local jungleleavesnames = {"Yellow", "Red"}
drawtype = "plantlike", for color = 1, #jungleleaves do
visual_scale = 1.0,
tiles = {"default_junglesapling.png"},
inventory_image = "default_junglesapling.png",
wield_image = "default_junglesapling.png",
paramtype = "light",
paramtype2 = "waving",
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(),
})
minetest.register_node("moretrees:jungletree_sapling_ongen", {
description = S("Jungle Sapling"),
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_junglesapling.png"},
inventory_image = "default_junglesapling.png",
wield_image = "default_junglesapling.png",
paramtype = "light",
paramtype2 = "waving",
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,not_in_creative_inventory=1,sapling=1},
sounds = default.node_sound_leaves_defaults(),
drop = "moretrees:jungletree_sapling"
})
local jungleleaves = {"green","yellow","red"}
local jungleleavesnames = {"Green", "Yellow", "Red"}
for color = 1, 3 do
local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color] local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color]
local moretrees_leaves_inventory_image = nil local moretrees_leaves_inventory_image = nil
@ -338,7 +302,7 @@ for color = 1, 3 do
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
{items = {'moretrees:jungletree_sapling'}, rarity = 100 }, {items = {"default:junglesapling"}, rarity = 100 },
{items = {"moretrees:jungletree_leaves_"..jungleleaves[color]} } {items = {"moretrees:jungletree_leaves_"..jungleleaves[color]} }
} }
}, },
@ -380,15 +344,16 @@ if moretrees.enable_redefine_apple then
end end
table.insert(moretrees.avoidnodes, "default:jungletree") table.insert(moretrees.avoidnodes, "default:jungletree")
table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk") table.insert(moretrees.avoidnodes, "default:pine_tree")
table.insert(moretrees.avoidnodes, "default:acacia_tree")
table.insert(moretrees.avoidnodes, "moretrees:fir_trunk") table.insert(moretrees.avoidnodes, "moretrees:fir_trunk")
table.insert(moretrees.avoidnodes, "default:tree") table.insert(moretrees.avoidnodes, "default:tree")
if moretrees.spawn_saplings then if moretrees.spawn_saplings then
table.insert(moretrees.avoidnodes, "snow:sapling_pine") table.insert(moretrees.avoidnodes, "snow:sapling_pine")
table.insert(moretrees.avoidnodes, "default:junglesapling") table.insert(moretrees.avoidnodes, "default:junglesapling")
table.insert(moretrees.avoidnodes, "moretrees:jungle_tree_sapling") table.insert(moretrees.avoidnodes, "default:pine_sapling")
table.insert(moretrees.avoidnodes, "moretrees:jungle_tree_sapling_ongen") table.insert(moretrees.avoidnodes, "default:acacia_sapling")
end end
-- "empty" (tapped) rubber tree nodes -- "empty" (tapped) rubber tree nodes
@ -418,45 +383,56 @@ minetest.register_abm({
end, end,
}) })
-- For compatibility with old nodes and recently-changed nodes. -- To get Moretrees to generate its own jungle trees among the default mapgen
-- we need our own copy of that node, which moretrees will match against.
minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk") local jungle_tree = moretrees.clone_node("default:jungletree")
minetest.register_alias("farming_plus:rubber_tree_full", "moretrees:rubber_tree_trunk") minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
minetest.register_alias("farming:rubber_tree_full", "moretrees:rubber_tree_trunk")
minetest.register_alias("technic:rubber_leaves", "moretrees:rubber_tree_leaves") -- For compatibility with old nodes, recently-changed nodes, and default nodes
minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves")
minetest.register_alias("farming:rubber_leaves", "moretrees:rubber_tree_leaves")
minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling") minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk")
minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling") minetest.register_alias("farming_plus:rubber_tree_full", "moretrees:rubber_tree_trunk")
minetest.register_alias("farming:rubber_sapling", "moretrees:rubber_tree_sapling") minetest.register_alias("farming:rubber_tree_full", "moretrees:rubber_tree_trunk")
minetest.register_alias("default:junglesapling","moretrees:jungletree_sapling") minetest.register_alias("technic:rubber_leaves", "moretrees:rubber_tree_leaves")
minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree") minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves")
minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree") minetest.register_alias("farming:rubber_leaves", "moretrees:rubber_tree_leaves")
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
minetest.register_alias("jungletree:leaves_green", "moretrees:jungletree_leaves_green") minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling")
minetest.register_alias("jungletree:leaves_red", "moretrees:jungletree_leaves_red") minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling")
minetest.register_alias("jungletree:leaves_yellow", "moretrees:jungletree_leaves_yellow") minetest.register_alias("farming:rubber_sapling", "moretrees:rubber_tree_sapling")
minetest.register_alias("moretrees:conifer_trunk", "moretrees:fir_trunk") minetest.register_alias("moretrees:conifer_trunk", "moretrees:fir_trunk")
minetest.register_alias("moretrees:conifer_trunk_sideways", "moretrees:fir_trunk_sideways") minetest.register_alias("moretrees:conifer_trunk_sideways", "moretrees:fir_trunk_sideways")
minetest.register_alias("moretrees:conifer_leaves", "moretrees:fir_leaves") minetest.register_alias("moretrees:conifer_leaves", "moretrees:fir_leaves")
minetest.register_alias("moretrees:conifer_leaves_bright", "moretrees:fir_leaves_bright") minetest.register_alias("moretrees:conifer_leaves_bright", "moretrees:fir_leaves_bright")
minetest.register_alias("moretrees:conifer_sapling", "moretrees:fir_sapling") minetest.register_alias("moretrees:conifer_sapling", "moretrees:fir_sapling")
minetest.register_alias("conifers:trunk", "moretrees:fir_trunk") minetest.register_alias("conifers:trunk", "moretrees:fir_trunk")
minetest.register_alias("conifers:trunk_reversed", "moretrees:fir_trunk_sideways") minetest.register_alias("conifers:trunk_reversed", "moretrees:fir_trunk_sideways")
minetest.register_alias("conifers:leaves", "moretrees:fir_leaves") minetest.register_alias("conifers:leaves", "moretrees:fir_leaves")
minetest.register_alias("conifers:leaves_special", "moretrees:fir_leaves_bright") minetest.register_alias("conifers:leaves_special", "moretrees:fir_leaves_bright")
minetest.register_alias("conifers:sapling", "moretrees:fir_sapling") minetest.register_alias("conifers:sapling", "moretrees:fir_sapling")
minetest.register_alias("moretrees:pine_trunk", "default:pinetree") minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
minetest.register_alias("moretrees:pine_planks", "default:pinewood") minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree")
minetest.register_alias("moretrees:pine_sapling", "default:pine_sapling") minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
minetest.register_alias("moretrees:pine_leaves", "default:pine_needles") minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungletree_leaves")
minetest.register_alias("jungletree:leaves_green", "default:jungleleaves")
minetest.register_alias("jungletree:leaves_red", "moretrees:jungletree_leaves_red")
minetest.register_alias("jungletree:leaves_yellow", "moretrees:jungletree_leaves_yellow")
minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree")
minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood")
minetest.register_alias("moretrees:acacia_sapling", "default:acacia_sapling")
minetest.register_alias("moretrees:acacia_leaves", "default:acacia_leaves")
minetest.register_alias("moretrees:pine_trunk", "default:pinetree")
minetest.register_alias("moretrees:pine_planks", "default:pinewood")
minetest.register_alias("moretrees:pine_sapling", "default:pine_sapling")
minetest.register_alias("moretrees:pine_leaves", "default:pine_needles")
-- Overriding moretrees' palm leaves: -- Overriding moretrees' palm leaves:
minetest.override_item("moretrees:palm_leaves",{walkable = false}) minetest.override_item("moretrees:palm_leaves",{walkable = false})

View File

@ -78,7 +78,7 @@ biome_lib:grow_plants({
biome_lib:grow_plants({ biome_lib:grow_plants({
grow_delay = moretrees.sapling_interval, grow_delay = moretrees.sapling_interval,
grow_chance = moretrees.sapling_chance, grow_chance = moretrees.sapling_chance,
grow_plant = "moretrees:jungletree_sapling", grow_plant = "default:junglesapling",
grow_nodes = moretrees.jungletree_biome.surface, grow_nodes = moretrees.jungletree_biome.surface,
grow_function = "moretrees:grow_jungletree" grow_function = "moretrees:grow_jungletree"
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

View File

@ -144,8 +144,8 @@ moretrees.pine_model={
rules_b="[&&&TTT[++^Fdd][--&Fdd]//dd[+^d][--&Fd]]", rules_b="[&&&TTT[++^Fdd][--&Fdd]//dd[+^d][--&Fd]]",
rules_c="/", rules_c="/",
rules_d="F", rules_d="F",
trunk="moretrees:pine_trunk", trunk="default:pine_tree",
leaves="moretrees:pine_leaves", leaves="default:pine_needles",
angle=30, angle=30,
iterations=2, iterations=2,
random_level=0, random_level=0,
@ -191,8 +191,8 @@ moretrees.acacia_model={
.."GGfffff--G--" .."GGfffff--G--"
.."ffffGGG", .."ffffGGG",
rules_c = "/", rules_c = "/",
trunk="moretrees:acacia_trunk", trunk="default:acacia_tree",
leaves="moretrees:acacia_leaves", leaves="default:acacia_leaves",
angle=45, angle=45,
iterations=3, iterations=3,
random_level=0, random_level=0,
@ -217,8 +217,8 @@ moretrees.jungletree_model={
axiom=nil, axiom=nil,
rules_a=nil, rules_a=nil,
rules_b=nil, rules_b=nil,
trunk="default:jungletree", trunk="moretrees:jungletree_trunk",
leaves="moretrees:jungletree_leaves_green", leaves="default:jungleleaves",
leaves2=nil, leaves2=nil,
leaves2_chance=nil, leaves2_chance=nil,
angle=45, angle=45,

View File

@ -0,0 +1,2 @@
default
flowers

View File

@ -0,0 +1,68 @@
-- 3D Mushroom mod by VanessaE
--
-- License: WTFPL for everything.
mushroom = {}
minetest.override_item("flowers:mushroom_fertile_brown", {
drawtype = "mesh",
mesh = "3dmushrooms.obj",
tiles = {"3dmushrooms_brown.png"},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
inventory_image = "3dmushrooms_brown_inv.png"
})
minetest.override_item("flowers:mushroom_brown", {
drawtype = "mesh",
mesh = "3dmushrooms.obj",
tiles = {"3dmushrooms_brown.png"},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
inventory_image = "3dmushrooms_brown_inv.png"
})
minetest.override_item("flowers:mushroom_fertile_red", {
drawtype = "mesh",
mesh = "3dmushrooms.obj",
tiles = {"3dmushrooms_red.png"},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
inventory_image = "3dmushrooms_red_inv.png"
})
minetest.override_item("flowers:mushroom_red", {
drawtype = "mesh",
mesh = "3dmushrooms.obj",
tiles = {"3dmushrooms_red.png"},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
inventory_image = "3dmushrooms_red_inv.png"
})
-- aliases to the default mushrooms
minetest.register_alias("mushroom:brown", "flowers:mushroom_brown")
minetest.register_alias("mushroom:brown_natural", "flowers:mushroom_fertile_brown")
minetest.register_alias("mushroom:spore_brown", "flowers:mushroom_spores_brown")
minetest.register_alias("mushroom:spore2", "flowers:mushroom_spores_brown")
minetest.register_alias("mushroom:brown_essence", "flowers:mushroom_brown")
minetest.register_alias("mushroom:red", "flowers:mushroom_red")
minetest.register_alias("mushroom:red_natural", "flowers:mushroom_fertile_red")
minetest.register_alias("mushroom:spore_red", "flowers:mushroom_spores_red")
minetest.register_alias("mushroom:spore1", "flowers:mushroom_spores_red")
minetest.register_alias("mushroom:poison", "flowers:mushroom_red")
minetest.register_alias("mushroom:identifier", "default:mese_crystal_fragment")
minetest.log("action", "[3D Mushrooms] loaded.")

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -1,2 +1,4 @@
default default
biome_lib biome_lib
stonage?
sumpf?

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 609 B

View File

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 620 B

View File

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 396 B

View File

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 540 B

View File

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 285 B

View File

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 657 B

View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

View File

Before

Width:  |  Height:  |  Size: 83 B

After

Width:  |  Height:  |  Size: 83 B

View File

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

View File

@ -27,8 +27,9 @@ bushes_classic.bushes_descriptions = {
bushes_classic.spawn_list = {} bushes_classic.spawn_list = {}
dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua') local modpath = minetest.get_modpath('bushes_classic')
dofile(minetest.get_modpath('bushes_classic') .. '/nodes.lua') dofile(modpath..'/cooking.lua')
dofile(modpath..'/nodes.lua')
biome_lib:spawn_on_surfaces({ biome_lib:spawn_on_surfaces({
spawn_delay = 3600, spawn_delay = 3600,

View File

@ -220,55 +220,6 @@ for i in ipairs(algae_list) do
}) })
end end
-- register all potted plant nodes, crafts, and most backward-compat aliases
-- Description, base node name, item to craft flowerpot with
-- /MFF BEGIN (Mg|06/04/15 4:31PM)
--[[local flowers_list = {
{ "Rose", "rose", "flowers:rose" },
{ "Tulip", "tulip", "flowers:tulip" },
{ "Yellow Dandelion", "dandelion_yellow", "flowers:dandelion_yellow" },
{ "White Dandelion", "dandelion_white", "flowers:dandelion_white" },
{ "Blue Geranium", "geranium", "flowers:geranium" },
{ "Viola", "viola", "flowers:viola" },
{ "Cactus", "cactus", "default:cactus" },
{ "Bonsai", "bonsai", "default:sapling" }
}
for i in ipairs(flowers_list) do
local flowerdesc = flowers_list[i][1]
local flower = flowers_list[i][2]
local craftwith = flowers_list[i][3]
minetest.register_node(":flowers:potted_"..flower, {
description = S("Potted "..flowerdesc),
drawtype = "mesh",
mesh = "flowers_potted.obj",
tiles = { "flowers_potted_"..flower..".png", "flowers_potted.png" },
sunlight_propagates = true,
paramtype = "light",
walkable = false,
groups = { snappy = 3, flammable=2 },
sounds = default.node_sound_glass_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.2, -0.5, -0.2, 0.2, 0.4, 0.2 },
},
})
minetest.register_craft( {
type = "shapeless",
output = "flowers:potted_"..flower,
recipe = {
craftwith,
"flowers:flower_pot"
}
})
minetest.register_alias("flowers:flower_"..flower.."_pot", "flowers:potted_"..flower)
end
]]-- /MFF END (Mg|06/04/15 4:32PM)
local box = { local box = {
type="fixed", type="fixed",
fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } }, fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },

View File

@ -13,55 +13,23 @@ dofile(minetest.get_modpath("molehills").."/molehills_settings.txt")
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- NoDe -- NoDe
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
local mh_cbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
}
minetest.register_node("molehills:molehill",{ minetest.register_node("molehills:molehill",{
drawtype = "nodebox", drawtype = "mesh",
mesh = "molehill_molehill.obj",
description = "Mole Hill", description = "Mole Hill",
inventory_image = "molehills_side.png", inventory_image = "molehills_side.png",
tiles = { tiles = { "molehills_dirt.png" },
"molehills_dirt.png",--"molehill_top.png", paramtype = "light",
"molehills_dirt.png",--"molehill_top.png", selection_box = mh_cbox,
"molehills_dirt.png"--"molehill_side.png" collision_box = mh_cbox,
},
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
-- { left, bottom, front, right, top, back}
{-2/16, -3/16, -1/16, 2/16, -2/16, 1/16},
{-1/16, -3/16, -2/16, 1/16, -2/16, 2/16},
-- { left, bottom, front, right, top, back}
{-4/16, -4/16, -2/16, 4/16, -3/16, 2/16},
{-2/16, -4/16, -4/16, 2/16, -3/16, 4/16},
{-3/16, -4/16, -3/16, 3/16, -3/16, 3/16},
-- { left, bottom, front, right, top, back}
{-5/16, -5/16, -2/16, 5/16, -4/16, 2/16},
{-2/16, -5/16, -5/16, 2/16, -4/16, 5/16},
{-4/16, -5/16, -4/16, 4/16, -4/16, 4/16},
-- { left, bottom, front, right, top, back}
{-6/16, -6/16, -2/16, 6/16, -5/16, 2/16},
{-2/16, -6/16, -6/16, 2/16, -5/16, 6/16},
{-5/16, -6/16, -4/16, 5/16, -5/16, 4/16},
{-4/16, -6/16, -5/16, 4/16, -5/16, 5/16},
-- { left, bottom, front, right, top, back}
{-7/16, -7/16, -3/16, 7/16, -6/16, 3/16},
{-3/16, -7/16, -7/16, 3/16, -6/16, 7/16},
{-6/16, -7/16, -4/16, 6/16, -6/16, 4/16},
{-4/16, -7/16, -6/16, 4/16, -6/16, 6/16},
{-5/16, -7/16, -5/16, 5/16, -6/16, 5/16},
-- { left, bottom, front, right, top, back}
--[[b]] {-1/2 , -1/2 , -3/16, 1/2 , -7/16, 3/16}, -- left to right
--[[o]] {-3/16, -1/2 , -1/2 , 3/16, -7/16, 1/2 }, -- front to back
--[[t]] {-7/16, -1/2 , -5/16, 7/16, -7/16, 5/16},
--[[t]] {-5/16, -1/2 , -7/16, 5/16, -7/16, 7/16},
--[[m]] {-6/16, -1/2 , -6/16, 6/16, -7/16, 6/16}, -- mid
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 2/16, 1/2},
},
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults(),
}) })
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------

View File

@ -0,0 +1,197 @@
# Blender v2.73 (sub 0) OBJ File: 'anthill.blend'
# www.blender.org
o Cylinder_Cylinder.001
v 0.099056 -0.499969 -0.498228
v 0.038417 -0.200463 -0.141682
v 0.255808 -0.499933 -0.402046
v 0.095605 -0.174690 -0.147239
v 0.423075 -0.499913 -0.296918
v 0.102439 -0.169033 -0.075679
v 0.444026 -0.499843 -0.095234
v 0.125298 -0.217477 -0.063343
v 0.468682 -0.499958 0.074790
v 0.157655 -0.214352 0.001348
v 0.396548 -0.500000 0.246048
v 0.133778 -0.189245 0.108513
v 0.280708 -0.500000 0.383197
v 0.070517 -0.218946 0.104754
v 0.089852 -0.499943 0.434316
v 0.048523 -0.205247 0.128681
v -0.093309 -0.499902 0.467111
v -0.039037 -0.211895 0.149030
v -0.272965 -0.499875 0.396496
v -0.108297 -0.175918 0.104100
v -0.388317 -0.499877 0.239075
v -0.139068 -0.179051 0.073370
v -0.437531 -0.499999 0.063918
v -0.141812 -0.255882 0.005117
v -0.458429 -0.499805 -0.104397
v -0.189265 -0.217436 -0.065303
v -0.385597 -0.499914 -0.288584
v -0.112692 -0.207830 -0.096879
v -0.248347 -0.499927 -0.384586
v -0.083136 -0.202256 -0.170048
v -0.095346 -0.499958 -0.514449
v -0.023049 -0.216681 -0.204058
v 0.071880 -0.343843 -0.343933
v 0.189128 -0.354687 -0.277980
v 0.311273 -0.378789 -0.248498
v 0.296760 -0.346318 -0.056661
v 0.332231 -0.342427 0.044933
v 0.259921 -0.360316 0.147910
v 0.213270 -0.362883 0.253745
v 0.059007 -0.360067 0.351374
v -0.068448 -0.357957 0.335642
v -0.164888 -0.343166 0.232553
v -0.269761 -0.352370 0.140734
v -0.367168 -0.370891 0.062326
v -0.294491 -0.324099 -0.079712
v -0.276314 -0.352585 -0.236032
v -0.206169 -0.372829 -0.314307
v -0.065547 -0.371444 -0.355380
v 0.000709 -0.156135 -0.047193
vt 0.572002 0.826281
vt 0.535907 0.620231
vt 0.597591 0.625892
vt 0.604963 0.552988
vt 0.830215 0.729053
vt 0.629619 0.540419
vt 0.814561 0.533613
vt 0.664520 0.474514
vt 0.638766 0.365335
vt 0.774826 0.325198
vt 0.570532 0.369165
vt 0.724507 0.217375
vt 0.546808 0.344788
vt 0.452364 0.324057
vt 0.420641 0.133939
vt 0.377660 0.369831
vt 0.316619 0.238965
vt 0.344469 0.401138
vt 0.203502 0.332509
vt 0.341509 0.470674
vt 0.290325 0.542416
vt 0.176827 0.557096
vt 0.372919 0.574586
vt 0.196433 0.716353
vt 0.404798 0.649130
vt 0.469609 0.683778
vt 0.272092 0.796098
vt 0.770390 0.885486
vt 0.973405 0.572910
vt 0.591386 0.033412
vt 0.226599 0.867698
vt 0.423770 0.837943
vt 0.601314 0.983475
vt 0.078559 0.769893
vt 0.000000 0.582245
vt 0.098436 0.412390
vt 0.075624 0.232320
vt 0.200045 0.071942
vt 0.558116 0.117912
vt 0.922195 0.225217
vt 0.852821 0.430110
vt 0.698467 0.759089
vt 0.495235 0.523967
vt 0.391629 1.000000
vt 0.022541 0.410768
vt 0.797247 0.085491
vt 0.393825 0.000000
vt 0.950807 0.778383
vt 1.000000 0.399692
g Cylinder_Cylinder.001_None
s 1
f 33/1 2/2 4/3
f 4/3 6/4 35/5
f 35/5 6/4 8/6
f 36/7 8/6 10/8
f 10/8 12/9 38/10
f 12/9 14/11 39/12
f 39/12 14/11 16/13
f 16/13 18/14 41/15
f 18/14 20/16 42/17
f 20/16 22/18 43/19
f 43/19 22/18 24/20
f 24/20 26/21 45/22
f 26/21 28/23 46/24
f 46/24 28/23 30/25
f 32/26 2/2 33/1
f 47/27 30/25 32/26
f 3/28 7/29 15/30
f 29/31 47/27 48/32
f 48/32 33/1 1/33
f 27/34 46/24 47/27
f 25/35 45/22 46/24
f 44/36 45/22 25/35
f 21/37 43/19 44/36
f 42/17 43/19 21/37
f 41/15 42/17 19/38
f 15/30 40/39 41/15
f 39/12 40/39 15/30
f 11/40 38/10 39/12
f 37/41 38/10 11/40
f 7/29 36/7 37/41
f 35/5 36/7 7/29
f 3/28 34/42 35/5
f 33/1 34/42 3/28
f 4/3 2/2 49/43
f 2/2 32/26 49/43
f 32/26 30/25 49/43
f 30/25 28/23 49/43
f 28/23 26/21 49/43
f 26/21 24/20 49/43
f 24/20 22/18 49/43
f 22/18 20/16 49/43
f 20/16 18/14 49/43
f 18/14 16/13 49/43
f 16/13 14/11 49/43
f 14/11 12/9 49/43
f 12/9 10/8 49/43
f 10/8 8/6 49/43
f 8/6 6/4 49/43
f 6/4 4/3 49/43
f 34/42 33/1 4/3
f 34/42 4/3 35/5
f 36/7 35/5 8/6
f 37/41 36/7 10/8
f 37/41 10/8 38/10
f 38/10 12/9 39/12
f 40/39 39/12 16/13
f 40/39 16/13 41/15
f 41/15 18/14 42/17
f 42/17 20/16 43/19
f 44/36 43/19 24/20
f 44/36 24/20 45/22
f 45/22 26/21 46/24
f 47/27 46/24 30/25
f 48/32 32/26 33/1
f 48/32 47/27 32/26
f 29/31 31/44 1/33
f 23/45 27/34 29/31
f 27/34 23/45 25/35
f 15/30 19/38 21/37
f 11/40 13/46 15/30
f 15/30 17/47 19/38
f 3/28 23/45 29/31
f 29/31 1/33 3/28
f 3/28 5/48 7/29
f 7/29 9/49 11/40
f 23/45 15/30 21/37
f 15/30 23/45 3/28
f 15/30 7/29 11/40
f 31/44 29/31 48/32
f 31/44 48/32 1/33
f 29/31 27/34 47/27
f 27/34 25/35 46/24
f 23/45 44/36 25/35
f 23/45 21/37 44/36
f 19/38 42/17 21/37
f 17/47 41/15 19/38
f 17/47 15/30 41/15
f 13/46 39/12 15/30
f 13/46 11/40 39/12
f 9/49 37/41 11/40
f 9/49 7/29 37/41
f 5/48 35/5 7/29
f 5/48 3/28 35/5
f 1/33 33/1 3/28

View File

@ -1,41 +0,0 @@
-- Redefine grass and dirt nodes
minetest.override_item("default:dirt", {
drop = {
max_items = 2,
items = {
{
items = {"mushroom:spore1"},
rarity = 40,
},
{
items = {"mushroom:spore2"},
rarity = 40,
},
{
items = {"default:dirt"},
}
}
}
})
minetest.override_item("default:dirt_with_grass", {
drop = {
max_items = 2,
items = {
{
items = {"mushroom:spore1"},
rarity = 40,
},
{
items = {"mushroom:spore2"},
rarity = 40,
},
{
items = {"default:dirt"},
}
}
}
})

View File

@ -1,95 +0,0 @@
-- craft items
minetest.register_craftitem("mushroom:spore1",{
description = "Unidentified Mushroom Spore",
inventory_image = "mushroom_spore.png",
wield_image = "mushroom_spore.png",
stack_max = 100,
})
minetest.register_craftitem("mushroom:spore2",{
description = "Unidentified Mushroom Spore",
inventory_image = "mushroom_spore.png",
wield_image = "mushroom_spore.png",
stack_max = 100,
})
minetest.register_craftitem("mushroom:identifier",{
description = "Mushroom Spore Identifier/Spore Extractor",
inventory_image = "mushroom_identifier.png",
wield_image = "mushroom_identifier.png",
})
minetest.register_craftitem("mushroom:brown_essence",{
description = "Healthy Brown Mushroom Essence",
inventory_image = "mushroom_essence.png",
wield_image = "mushroom_essence.png",
on_use = minetest.item_eat(5), --notre modif de gain de faim
groups = {vessel=1}, -- Modif MFF (needed for vessels furniture)
})
minetest.register_craftitem("mushroom:poison",{
description = "Red Mushroom Poison",
inventory_image = "mushroom_poison.png",
wield_image = "mushroom_poison.png",
on_use = minetest.item_eat(-10),
groups = {vessel=1}, -- Modif MFF (needed for vessels furniture)
})
-- recipes
minetest.register_craft( {
output = "mushroom:identifier",
recipe = {
{ "", "default:torch", "" },
{ "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" },
}
})
minetest.register_craft( {
type = "shapeless",
output = "mushroom:brown_essence",
recipe = { "mushroom:brown" , "vessels:glass_bottle" },
})
minetest.register_craft( {
type = "shapeless",
output = "mushroom:poison",
recipe = { "mushroom:red" , "vessels:glass_bottle" },
})
minetest.register_craft( {
type = "shapeless",
output = "mushroom:spore_brown",
recipe = { "mushroom:identifier" , "mushroom:spore1" },
replacements = {
{ 'mushroom:identifier', 'mushroom:identifier' }
}
})
minetest.register_craft( {
type = "shapeless",
output = "mushroom:spore_red",
recipe = { "mushroom:identifier" , "mushroom:spore2" },
replacements = {
{ 'mushroom:identifier', 'mushroom:identifier' }
}
})
minetest.register_craft( {
type = "shapeless",
output = "mushroom:spore_red 2",
recipe = { "mushroom:identifier" , "mushroom:red" },
replacements = {
{ 'mushroom:identifier', 'mushroom:identifier' }
}
})
minetest.register_craft( {
type = "shapeless",
output = "mushroom:spore_brown 2",
recipe = { "mushroom:identifier" , "mushroom:brown" },
replacements = {
{ 'mushroom:identifier', 'mushroom:identifier' }
}
})

View File

@ -1,3 +0,0 @@
default
vessels?
woodsoils?

View File

@ -1,261 +0,0 @@
-- Mushroom mod by DanDuncombe and VanessaE
--
-- License: CC-By-SA for texures derived from Minetest defaults,
-- WTFPL for all code and everything else.
mushroom = {}
minetest.register_node("mushroom:brown",{
description = "Brown Mushroom",
drawtype = "mesh",
mesh = "plantlife_mushroom.obj",
tiles = {"mushroom_brown_3d.png"},
sunlight_propagates = true,
inventory_image = "mushroom_brown_inv.png",
groups = {oddly_breakable_by_hand=3,attached_node=1},
paramtype = "light",
walkable = false,
on_use = minetest.item_eat(5), -- Modif MFF
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
drop = "mushroom:brown",
})
minetest.register_node("mushroom:red",{
description = "Red Mushroom",
drawtype = "mesh",
mesh = "plantlife_mushroom.obj",
tiles = {"mushroom_red_3d.png"},
sunlight_propagates = true,
inventory_image = "mushroom_red_inv.png",
groups = {oddly_breakable_by_hand=3,attached_node=1},
paramtype = "light",
walkable = false,
on_use = minetest.item_eat(-5), -- Modif MFF
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
drop = "mushroom:red",
})
minetest.register_node("mushroom:spore_brown",{
description = "Brown Mushroom Spore",
drawtype = "raillike",
paramtype = "light",
tiles = {"mushroom_spore_brown.png"},
sunlight_propagates = true,
walkable = false,
groups = {oddly_breakable_by_hand=3,attached_node=1},
inventory_image = "mushroom_spore_brown.png",
wield_image = "mushroom_spore_brown.png",
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
},
})
minetest.register_node("mushroom:spore_red",{
description = "Red Mushroom Spore",
drawtype = "raillike",
paramtype = "light",
tiles = {"mushroom_spore_red.png"},
sunlight_propagates = true,
walkable = false,
groups = {oddly_breakable_by_hand=3,attached_node=1},
inventory_image = "mushroom_spore_red.png",
wield_image = "mushroom_spore_red.png",
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
},
})
--Natural Mushrooms
minetest.register_node("mushroom:brown_natural",{
description = "Brown Mushroom (Naturally Spawned)",
drawtype = "mesh",
mesh = "plantlife_mushroom.obj",
tiles = {"mushroom_brown_3d.png"},
sunlight_propagates = true,
inventory_image = "mushroom_brown_inv.png",
groups = {oddly_breakable_by_hand=3, not_in_creative_inventory=1},
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
drop = "mushroom:brown",
})
minetest.register_node("mushroom:red_natural",{
description = "Red Mushroom (Naturally Spawned)",
drawtype = "mesh",
mesh = "plantlife_mushroom.obj",
tiles = {"mushroom_red_3d.png"},
sunlight_propagates = true,
inventory_image = "mushroom_red_inv.png",
groups = {oddly_breakable_by_hand=3, not_in_creative_inventory=1},
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
},
drop = "mushroom:red",
})
-- Spore Growing ABMs
minetest.register_abm({
nodenames = {"mushroom:spore_brown"},
neighbors = {"air"},
interval = 360, -- Modif MFF
chance = 12, -- Modif MFF
action = function(pos, node)
local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_"))
and minetest.get_node_light(pos, nil) < 8 then
minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:brown"})
end
end
})
minetest.register_abm({
nodenames = {"mushroom:spore_red"},
neighbors = {"air"},
interval = 360, -- Modif MFF
chance = 12, -- Modif MFF
action = function(pos, node)
local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_"))
and minetest.get_node_light(pos, nil) < 8 then
minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:red"})
end
end
})
-- list of trees that mushrooms can grow next to
local trees_list = {
"default:tree",
"default:jungletree",
"moretrees:apple_tree_trunk",
"moretrees:beech_trunk",
"moretrees:birch_trunk",
"moretrees:fir_trunk",
"moretrees:oak_trunk",
"moretrees:pine_trunk",
"moretrees:rubber_tree_trunk",
"moretrees:rubber_tree_trunk_empty",
"moretrees:sequoia_trunk",
"moretrees:spruce_trunk",
"moretrees:willow_trunk",
}
-- Natural Spawning ABM
minetest.register_abm({
nodenames = {
"default:dirt_with_grass",
"default:dirt",
"woodsoils:dirt_with_leaves_1",
"woodsoils:dirt_with_leaves_2",
"woodsoils:grass_with_leaves_1",
"woodsoils:grass_with_leaves_2",
"farming:soil_wet"
},
neighbors = {"air"},
interval = 900, -- Modif MFF
chance = 300, -- Modif MFF
action = function(pos, node)
local top_pos = {x=pos.x, y=pos.y+1, z=pos.z}
if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8
and minetest.find_node_near(pos, 1, trees_list)
and minetest.find_node_near(pos, 3, "default:water_source") then
if math.random(0, 1) == 0 then
minetest.set_node(top_pos, {name="mushroom:brown_natural"})
else
minetest.set_node(top_pos, {name="mushroom:red_natural"})
end
end
end
})
minetest.register_abm({
nodenames = {"default:stone"},
neighbors = {"air"},
interval = 900, -- Modif MFF
chance = 300, -- Modif MFF
action = function(pos, node)
local top_pos = {x=pos.x, y=pos.y+1, z=pos.z}
if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8
and minetest.find_node_near(pos, 1, {"default:water_source"}) then
if math.random(0,1) == 0 then
minetest.set_node(top_pos, {name="mushroom:brown_natural"})
else
minetest.set_node(top_pos, {name="mushroom:red_natural"})
end
end
end
})
-- Spreading ABM
minetest.register_abm({
nodenames = {
"mushroom:brown_natural",
"mushroom:red_natural"
},
neighbors = {"air"},
interval = 120,
chance = 100,
action = function(pos, node)
local soil_pos = {x=pos.x, y=pos.y-1, z=pos.z}
local soil = minetest.get_node(soil_pos)
local woodsoil_str = "woodsoils:.+_with_leaves_?"
if minetest.get_node_light(pos, nil) < 8
and minetest.find_node_near(pos, 1, trees_list) then
local spread_x = math.random(-1, 1)
local spread_z = math.random(-1, 1)
local newpos = {x=pos.x+spread_x, y=pos.y, z=pos.z+spread_z}
local newsoil = minetest.get_node({x=newpos.x, y=newpos.y-1, z=newpos.z})
if minetest.get_node(newpos).name == "air"
and (newsoil.name == "default:dirt_with_grass"
or newsoil.name == "default:dirt"
or string.match(newsoil.name, woodsoil_str))
and minetest.find_node_near(newpos, 3, "default:water_source") then
minetest.set_node(newpos, {name=node.name})
end
end
end
})
-- Dying ABM
minetest.register_abm({
nodenames = {
"mushroom:brown",
"mushroom:red",
},
neighbors = {"air"},
interval = 120,
chance = 50,
action = function(pos, node)
local soil = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
if soil.name ~= "farming:soil_wet"
and not string.find(soil.name, "homedecor:flower_pot_") then
minetest.remove_node(pos)
end
end
})
dofile(minetest.get_modpath("mushroom").."/crafting.lua")
dofile(minetest.get_modpath("mushroom").."/compat.lua")
minetest.log("action", "[Mushrooms] loaded.")

Some files were not shown because too many files have changed in this diff Show More