Updated moretrees, plantlife, and MinetestForFunGame
- Solves #220 - Merge mapgen into MinetestForFun Game - Merge acacia support in moretrees - Add 3dmushrooms mod (world.mt updated)
@ -24,7 +24,6 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
Cisoun's WTFPL texture pack:
|
||||
default_jungletree.png
|
||||
default_jungletree_top.png
|
||||
default_lava.png
|
||||
default_leaves.png
|
||||
default_sapling.png
|
||||
@ -57,11 +56,11 @@ VanessaE (WTFPL):
|
||||
default_nc_front.png
|
||||
default_nc_rb.png
|
||||
default_nc_side.png
|
||||
default_grass_*.png
|
||||
default_desert_sand.png
|
||||
default_desert_stone.png
|
||||
default_desert_stone_brick.png
|
||||
default_sand.png
|
||||
default_jungletree_top.png
|
||||
|
||||
Calinou (CC BY-SA):
|
||||
default_brick.png
|
||||
@ -78,7 +77,6 @@ Jordach (CC BY-SA 3.0):
|
||||
PilzAdam (WTFPL):
|
||||
default_jungleleaves.png
|
||||
default_junglesapling.png
|
||||
default_junglewood.png
|
||||
default_obsidian_glass.png
|
||||
default_obsidian_shard.png
|
||||
default_mineral_gold.png
|
||||
@ -93,7 +91,6 @@ InfinityProject (WTFPL):
|
||||
Splizard (CC BY-SA 3.0):
|
||||
default_snow.png
|
||||
default_snow_side.png
|
||||
default_ice.png
|
||||
default_pine_sapling.png
|
||||
|
||||
Zeg9 (CC BY-SA 3.0):
|
||||
@ -104,7 +101,7 @@ Zeg9 (CC BY-SA 3.0):
|
||||
default_gold_block.png
|
||||
|
||||
paramat (CC BY-SA 3.0):
|
||||
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
|
||||
wieldhand.png, derived from character.png by Jordach (CC BY-SA 3.0)
|
||||
default_pinetree.png
|
||||
default_pinetree_top.png
|
||||
default_pinewood.png
|
||||
@ -113,6 +110,15 @@ paramat (CC BY-SA 3.0):
|
||||
default_river_water.png
|
||||
default_river_water_source_animated.png
|
||||
default_river_water_flowing_animated.png
|
||||
default_acacia_leaves.png
|
||||
default_acacia_sapling.png
|
||||
default_acacia_tree.png
|
||||
default_acacia_tree_top.png
|
||||
default_acacia_wood.png
|
||||
default_dry_grass.png
|
||||
default_dry_grass_side.png
|
||||
default_dry_grass_*.png
|
||||
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
|
||||
|
||||
brunob.santos (CC BY-SA 4.0):
|
||||
default_desert_cobble.png
|
||||
@ -125,7 +131,6 @@ BlockMen (CC BY-SA 3.0):
|
||||
default_gold_ingot.png
|
||||
default_tool_steelsword.png
|
||||
default_diamond.png
|
||||
default_diamond_block.png
|
||||
default_book.png
|
||||
default_tool_*.png
|
||||
default_lava_source_animated.png
|
||||
@ -152,6 +157,21 @@ Philipbenr (CC BY-SA 3.0):
|
||||
default_grass.png
|
||||
default_grass_side.png
|
||||
|
||||
Gambit (WTFPL):
|
||||
default_bronze_ingot.png
|
||||
default_copper_ingot.png
|
||||
default_copper_lump.png
|
||||
default_iron_lump.png
|
||||
default_gold_lump.png
|
||||
default_clay_lump.png
|
||||
default_coal.png
|
||||
default_grass_*.png
|
||||
default_paper.png
|
||||
default_diamond_block.png
|
||||
|
||||
asl97 (WTFPL):
|
||||
default_ice.png
|
||||
|
||||
Glass breaking sounds (CC BY 3.0):
|
||||
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
|
||||
2: http://www.freesound.org/people/Tomlija/sounds/97669/
|
||||
@ -191,14 +211,3 @@ Mito551 (sounds) (CC BY-SA):
|
||||
default_dirt_footstep.1.ogg
|
||||
default_dirt_footstep.2.ogg
|
||||
default_glass_footstep.ogg
|
||||
|
||||
Gambit (WTFPL):
|
||||
default_bronze_ingot.png
|
||||
default_copper_ingot.png
|
||||
default_copper_lump.png
|
||||
default_iron_lump.png
|
||||
default_gold_lump.png
|
||||
default_clay_lump.png
|
||||
default_coal.png
|
||||
default_grass_*.png
|
||||
default_paper.png
|
||||
|
@ -68,5 +68,9 @@ minetest.register_alias("steel_ingot", "default:steel_ingot")
|
||||
minetest.register_alias("clay_brick", "default:clay_brick")
|
||||
minetest.register_alias("snow", "default:snow")
|
||||
|
||||
-- Aliases for corrected pine node names
|
||||
minetest.register_alias("default:pinetree", "default:pine_tree")
|
||||
minetest.register_alias("default:pinewood", "default:pine_wood")
|
||||
|
||||
-- Mese now comes in the form of blocks, ore, crystal and fragments
|
||||
minetest.register_alias("default:mese", "default:mese_block")
|
||||
minetest.register_alias("default:mese", "default:mese_block")
|
||||
|
@ -22,9 +22,16 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pinewood 4',
|
||||
output = 'default:pine_wood 4',
|
||||
recipe = {
|
||||
{'default:pinetree'},
|
||||
{'default:pine_tree'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:acacia_wood 4',
|
||||
recipe = {
|
||||
{'default:acacia_tree'},
|
||||
}
|
||||
})
|
||||
|
||||
@ -435,15 +442,6 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:sword_nyan",
|
||||
recipe = {
|
||||
{"default:nyancat"},
|
||||
{"default:nyancat"},
|
||||
{"group:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_diamond',
|
||||
recipe = {
|
||||
@ -462,6 +460,15 @@ minetest.register_craft({ -- Ultimate Warrior weapon
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:sword_nyan",
|
||||
recipe = {
|
||||
{"default:nyancat"},
|
||||
{"default:nyancat"},
|
||||
{"group:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:rail 16',
|
||||
recipe = {
|
||||
@ -1018,7 +1025,7 @@ minetest.register_craft({
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:sapling",
|
||||
recipe = "group:sapling",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
@ -1040,12 +1047,6 @@ minetest.register_craft({
|
||||
burntime = 370,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:junglesapling",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:grass_1",
|
||||
@ -1054,7 +1055,7 @@ minetest.register_craft({
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:pine_sapling",
|
||||
burntime = 10,
|
||||
recipe = "default:dry_grass_1",
|
||||
burntime = 2,
|
||||
})
|
||||
|
||||
|
@ -165,42 +165,22 @@ local del1 = 0
|
||||
local count = 0
|
||||
|
||||
default.cool_lava_source = function(pos)
|
||||
local del2 = tonumber(os.clock())
|
||||
if del2-del1 < 0.1
|
||||
and count > 1 then
|
||||
cool_wf_vm(pos, "default:lava_source", "default:obsidian_cooled")
|
||||
count = 0
|
||||
else
|
||||
minetest.set_node(pos, {name = "default:obsidian_cooled"})
|
||||
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.2})
|
||||
if del2-del1 < 0.1 then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
del1 = del2
|
||||
minetest.set_node(pos, {name = "default:obsidian"})
|
||||
minetest.sound_play("default_cool_lava",
|
||||
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
||||
end
|
||||
|
||||
default.cool_lava_flowing = function(pos)
|
||||
local del2 = tonumber(os.clock())
|
||||
if del2-del1 < 0.1
|
||||
and count > 1 then
|
||||
cool_wf_vm(pos, "default:lava_flowing", "default:cobble_cooled")
|
||||
count = 0
|
||||
else
|
||||
minetest.set_node(pos, {name = "default:cobble_cooled"})
|
||||
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.2})
|
||||
if del2-del1 < 0.1 then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
del1 = del2
|
||||
minetest.set_node(pos, {name = "default:stone"})
|
||||
minetest.sound_play("default_cool_lava",
|
||||
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:lava_flowing"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
interval = 1,
|
||||
chance = 2,
|
||||
action = function(...)
|
||||
default.cool_lava_flowing(...)
|
||||
end,
|
||||
@ -209,8 +189,8 @@ minetest.register_abm({
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:lava_source"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
interval = 1,
|
||||
chance = 2,
|
||||
action = function(...)
|
||||
default.cool_lava_source(...)
|
||||
end,
|
||||
@ -224,12 +204,11 @@ minetest.register_abm({
|
||||
-- wrapping the functions in abm action is necessary to make overriding them possible
|
||||
|
||||
function default.grow_cactus(pos, node)
|
||||
if node.param2 >= 4 then
|
||||
if node.param2 ~= 0 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y - 1
|
||||
local name = minetest.get_node(pos).name --MFF
|
||||
if minetest.get_item_group(name, "sand") == 0 and name ~= "watershed:drygrass" then --MFF
|
||||
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y + 1
|
||||
@ -249,7 +228,7 @@ end
|
||||
function default.grow_papyrus(pos, node)
|
||||
pos.y = pos.y - 1
|
||||
local name = minetest.get_node(pos).name
|
||||
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" and name ~= "default:sand" and name ~= "default:desert_sand" then --MFF
|
||||
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then
|
||||
return
|
||||
end
|
||||
if not minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||
@ -406,6 +385,7 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
|
||||
if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then
|
||||
return
|
||||
end
|
||||
minetest.remove_node(pos, newnode)
|
||||
minetest.set_node(pos, oldnode)
|
||||
minetest.add_item(pos, "default:torch")
|
||||
end)
|
||||
@ -436,9 +416,9 @@ minetest.register_abm({
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt_with_grass"},
|
||||
interval = 30,
|
||||
chance = 2,
|
||||
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
|
||||
interval = 2,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local name = minetest.get_node(above).name
|
||||
|
@ -2,7 +2,6 @@
|
||||
-- Aliases for map generator outputs
|
||||
--
|
||||
|
||||
|
||||
minetest.register_alias("mapgen_stone", "default:stone")
|
||||
minetest.register_alias("mapgen_dirt", "default:dirt")
|
||||
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
|
||||
@ -19,15 +18,19 @@ minetest.register_alias("mapgen_snow", "default:snow")
|
||||
minetest.register_alias("mapgen_ice", "default:ice")
|
||||
minetest.register_alias("mapgen_sandstone", "default:sandstone")
|
||||
|
||||
-- Flora
|
||||
|
||||
minetest.register_alias("mapgen_tree", "default:tree")
|
||||
minetest.register_alias("mapgen_leaves", "default:leaves")
|
||||
minetest.register_alias("mapgen_apple", "default:apple")
|
||||
minetest.register_alias("mapgen_jungletree", "default:jungletree")
|
||||
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
|
||||
minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
|
||||
minetest.register_alias("mapgen_pinetree", "default:pinetree")
|
||||
minetest.register_alias("mapgen_pine_tree", "default:pine_tree")
|
||||
minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
|
||||
|
||||
-- Dungeons
|
||||
|
||||
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
|
||||
minetest.register_alias("mapgen_mese", "default:mese")
|
||||
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
|
||||
@ -43,11 +46,14 @@ minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebr
|
||||
-- Register ores
|
||||
--
|
||||
|
||||
|
||||
-- All mapgens except singlenode
|
||||
-- Blob ore first to avoid other ores inside blobs
|
||||
|
||||
function default.register_ores()
|
||||
minetest.register_ore({
|
||||
|
||||
-- Clay
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:clay",
|
||||
wherein = {"default:sand"},
|
||||
@ -66,7 +72,9 @@ function default.register_ores()
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
-- Sand
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:sand",
|
||||
wherein = {"default:stone"},
|
||||
@ -85,6 +93,8 @@ function default.register_ores()
|
||||
},
|
||||
})
|
||||
|
||||
-- Dirt
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:dirt",
|
||||
@ -104,6 +114,8 @@ function default.register_ores()
|
||||
},
|
||||
})
|
||||
|
||||
-- Gravel
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:gravel",
|
||||
@ -123,6 +135,8 @@ function default.register_ores()
|
||||
},
|
||||
})
|
||||
|
||||
-- Coal
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:stone_with_coal",
|
||||
@ -157,6 +171,8 @@ function default.register_ores()
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
-- Iron
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:stone_with_iron",
|
||||
@ -203,6 +219,8 @@ function default.register_ores()
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
--Mese
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:stone_with_mese",
|
||||
@ -321,6 +339,8 @@ function default.register_ores()
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
-- Gold
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:stone_with_gold",
|
||||
@ -345,6 +365,8 @@ function default.register_ores()
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
-- Diamond
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:stone_with_diamond",
|
||||
@ -369,6 +391,8 @@ function default.register_ores()
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
-- Copper
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:stone_with_copper",
|
||||
@ -609,12 +633,155 @@ end
|
||||
-- Register biomes
|
||||
--
|
||||
|
||||
-- All mapgens except mgv6 and singlenode
|
||||
|
||||
function default.register_biomes()
|
||||
minetest.clear_registered_biomes()
|
||||
|
||||
-- Permanent ice
|
||||
|
||||
minetest.register_biome({
|
||||
name = "default:grassland",
|
||||
name = "glacier",
|
||||
node_dust = "default:snowblock",
|
||||
node_top = "default:snowblock",
|
||||
depth_top = 1,
|
||||
node_filler = "default:snowblock",
|
||||
depth_filler = 3,
|
||||
node_stone = "default:ice",
|
||||
node_water_top = "default:ice",
|
||||
depth_water_top = 10,
|
||||
--node_water = "",
|
||||
y_min = -8,
|
||||
y_max = 31000,
|
||||
heat_point = -5,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "glacier_ocean",
|
||||
node_dust = "default:snowblock",
|
||||
node_top = "default:gravel",
|
||||
depth_top = 1,
|
||||
node_filler = "default:gravel",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = -9,
|
||||
heat_point = -5,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
-- Cold
|
||||
|
||||
minetest.register_biome({
|
||||
name = "tundra",
|
||||
node_dust = "default:snow",
|
||||
node_top = "default:dirt_with_snow",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 0,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
heat_point = 20,
|
||||
humidity_point = 30,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "tundra_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 1,
|
||||
heat_point = 20,
|
||||
humidity_point = 30,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "taiga",
|
||||
node_dust = "default:snow",
|
||||
node_top = "default:snowblock",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
heat_point = 20,
|
||||
humidity_point = 70,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "taiga_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 1,
|
||||
heat_point = 20,
|
||||
humidity_point = 70,
|
||||
})
|
||||
|
||||
-- Cool
|
||||
|
||||
minetest.register_biome({
|
||||
name = "stone_grassland",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt_with_grass",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 0,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 45,
|
||||
humidity_point = 30,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "stone_grassland_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 45,
|
||||
humidity_point = 30,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "coniferous_forest",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt_with_grass",
|
||||
depth_top = 1,
|
||||
@ -624,8 +791,235 @@ function default.register_biomes()
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -31000,
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 45,
|
||||
humidity_point = 70,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "coniferous_forest_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 45,
|
||||
humidity_point = 70,
|
||||
})
|
||||
|
||||
-- Warm
|
||||
|
||||
minetest.register_biome({
|
||||
name = "sandstone_grassland",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt_with_grass",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 0,
|
||||
node_stone = "default:sandstone",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 70,
|
||||
humidity_point = 30,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "sandstone_grassland_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
node_stone = "default:sandstone",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 70,
|
||||
humidity_point = 30,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "deciduous_forest",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt_with_grass",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
heat_point = 70,
|
||||
humidity_point = 70,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "deciduous_forest_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 5,
|
||||
heat_point = 70,
|
||||
humidity_point = 70,
|
||||
})
|
||||
|
||||
-- Hot
|
||||
|
||||
minetest.register_biome({
|
||||
name = "desert",
|
||||
--node_dust = "",
|
||||
node_top = "default:desert_sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:desert_sand",
|
||||
depth_filler = 1,
|
||||
node_stone = "default:desert_stone",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
heat_point = 95,
|
||||
humidity_point = 10,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "desert_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
node_stone = "default:desert_stone",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 0,
|
||||
heat_point = 95,
|
||||
humidity_point = 10,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "savanna",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt_with_dry_grass",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 1,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 5,
|
||||
y_max = 31000,
|
||||
heat_point = 95,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "savanna_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = 4,
|
||||
heat_point = 95,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "rainforest",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt_with_grass",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
heat_point = 95,
|
||||
humidity_point = 90,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "rainforest_swamp",
|
||||
--node_dust = "",
|
||||
node_top = "default:dirt",
|
||||
depth_top = 1,
|
||||
node_filler = "default:dirt",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = 0,
|
||||
y_max = 0,
|
||||
heat_point = 95,
|
||||
humidity_point = 90,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "rainforest_ocean",
|
||||
--node_dust = "",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 2,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -112,
|
||||
y_max = -1,
|
||||
heat_point = 95,
|
||||
humidity_point = 90,
|
||||
})
|
||||
|
||||
-- Underground
|
||||
|
||||
minetest.register_biome({
|
||||
name = "underground",
|
||||
--node_dust = "",
|
||||
--node_top = "",
|
||||
depth_top = 0,
|
||||
--node_filler = "",
|
||||
depth_filler = -4,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
y_min = -31000,
|
||||
y_max = -113,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
node_underwater = "default:sand",
|
||||
@ -637,11 +1031,13 @@ end
|
||||
|
||||
|
||||
--
|
||||
-- Register mgv6 decorations
|
||||
-- Register decorations
|
||||
--
|
||||
|
||||
-- Mgv6
|
||||
|
||||
function default.register_mgv6_decorations()
|
||||
minetest.clear_registered_decorations()
|
||||
|
||||
-- Papyrus
|
||||
|
||||
@ -661,7 +1057,7 @@ function default.register_mgv6_decorations()
|
||||
y_max = 1,
|
||||
decoration = "default:papyrus",
|
||||
height = 2,
|
||||
height_max = 4,
|
||||
height_max = 4,
|
||||
spawn_by = "default:water_source",
|
||||
num_spawn_by = 1,
|
||||
})
|
||||
@ -687,7 +1083,7 @@ function default.register_mgv6_decorations()
|
||||
height_max = 4,
|
||||
})
|
||||
|
||||
-- Grasses
|
||||
-- Long grasses
|
||||
|
||||
for length = 1, 5 do
|
||||
minetest.register_decoration({
|
||||
@ -745,91 +1141,96 @@ function default.register_mgv6_decorations()
|
||||
})
|
||||
end
|
||||
|
||||
-- All mapgens except mgv6 and singlenode
|
||||
|
||||
--
|
||||
-- Register decorations
|
||||
--
|
||||
|
||||
|
||||
function default.register_decorations()
|
||||
|
||||
-- Flowers
|
||||
|
||||
local function register_grass_decoration(offset, scale, length)
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
place_on = {"default:dirt_with_grass", "default:sand"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
scale = 0.03,
|
||||
offset = offset,
|
||||
scale = scale,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 436,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {
|
||||
"stone_grassland", "stone_grassland_ocean",
|
||||
"sandstone_grassland", "sandstone_grassland_ocean",
|
||||
"deciduous_forest", "deciduous_forest_ocean",
|
||||
"coniferous_forest", "coniferous_forest_ocean",
|
||||
},
|
||||
y_min = 5,
|
||||
y_max = 31000,
|
||||
decoration = "flowers:rose",
|
||||
decoration = "default:grass_"..length,
|
||||
})
|
||||
end
|
||||
|
||||
local function register_dry_grass_decoration(offset, scale, length)
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
place_on = {"default:dirt_with_dry_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
scale = 0.03,
|
||||
offset = offset,
|
||||
scale = scale,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 19822,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
biomes = {"savana"},
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
decoration = "flowers:tulip",
|
||||
decoration = "default:dry_grass_"..length,
|
||||
})
|
||||
end
|
||||
|
||||
function default.register_decorations()
|
||||
minetest.clear_registered_decorations()
|
||||
|
||||
-- Apple tree
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
scale = 0.03,
|
||||
offset = offset,
|
||||
scale = scale,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 1220999,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
persist = 0.66
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {"deciduous_forest"},
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
decoration = "flowers:dandelion_yellow",
|
||||
schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
scale = 0.03,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 36662,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
decoration = "flowers:geranium",
|
||||
})
|
||||
-- Jungle tree
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_grass", "default:dirt"},
|
||||
sidelen = 80,
|
||||
fill_ratio = 0.09,
|
||||
biomes = {"rainforest", "rainforest_swamp"},
|
||||
y_min = 0,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
-- Taiga and temperate forest pine tree
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:snowblock", "default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
@ -837,38 +1238,43 @@ function default.register_decorations()
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 1133,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
persist = 0.66
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {"taiga", "coniferous_forest"},
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
decoration = "flowers:viola",
|
||||
schematic = minetest.get_modpath("default").."/schematics/pine_tree.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
-- Acacia tree
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_dry_grass"},
|
||||
sidelen = 80,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
scale = 0.03,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 73133,
|
||||
offset = 0,
|
||||
scale = 0.003,
|
||||
spread = {x=250, y=250, z=250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
persist = 0.66
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {"savanna"},
|
||||
y_min = 6,
|
||||
y_max = 31000,
|
||||
decoration = "flowers:dandelion_white",
|
||||
schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
rotation = "random",
|
||||
})
|
||||
|
||||
-- Grasses
|
||||
-- Large cactus
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:desert_sand"},
|
||||
sidelen = 80,
|
||||
noise_params = {
|
||||
offset = 0.04,
|
||||
scale = 0.08,
|
||||
@ -877,114 +1283,113 @@ function default.register_decorations()
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {"desert"},
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
decoration = "default:grass_1",
|
||||
schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts",
|
||||
flags = "place_center_x",
|
||||
rotation = "random",
|
||||
})
|
||||
|
||||
-- Cactus
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
place_on = {"default:desert_sand"},
|
||||
sidelen = 80,
|
||||
noise_params = {
|
||||
offset = 0.02,
|
||||
scale = 0.08,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 66440,
|
||||
offset = -0.0005,
|
||||
scale = 0.0015,
|
||||
spread = {x=200, y=200, z=200},
|
||||
seed = 230,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {"desert"},
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
decoration = "default:grass_2",
|
||||
decoration = "default:cactus",
|
||||
height = 2,
|
||||
height_max = 5,
|
||||
})
|
||||
|
||||
-- Papyrus
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:sand"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.3,
|
||||
scale = 0.7,
|
||||
spread = {x=200, y=200, z=200},
|
||||
seed = 354,
|
||||
octaves = 3,
|
||||
persist = 0.7
|
||||
},
|
||||
biomes = {"savanna_ocean", "desert_ocean"},
|
||||
y_min = 0,
|
||||
y_max = 0,
|
||||
schematic = minetest.get_modpath("default").."/schematics/papyrus.mts",
|
||||
})
|
||||
|
||||
-- Grasses
|
||||
|
||||
register_grass_decoration(-0.03, 0.09, 5)
|
||||
register_grass_decoration(-0.015, 0.075, 4)
|
||||
register_grass_decoration(0, 0.06, 3)
|
||||
register_grass_decoration(0.015, 0.045, 2)
|
||||
register_grass_decoration(0.03, 0.03, 1)
|
||||
|
||||
-- Dry grasses
|
||||
|
||||
register_dry_grass_decoration(0.01, 0.05, 5)
|
||||
register_dry_grass_decoration(0.03, 0.03, 4)
|
||||
register_dry_grass_decoration(0.05, 0.01, 3)
|
||||
register_dry_grass_decoration(0.07, -0.01, 2)
|
||||
register_dry_grass_decoration(0.09, -0.03, 1)
|
||||
|
||||
-- Junglegrass
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 80,
|
||||
fill_ratio = 0.1,
|
||||
biomes = {"rainforest"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
decoration = "default:junglegrass",
|
||||
})
|
||||
|
||||
-- Dry shrub
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:desert_sand", "default:dirt_with_snow"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.08,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 66440,
|
||||
scale = 0.02,
|
||||
spread = {x=200, y=200, z=200},
|
||||
seed = 329,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
biomes = {"desert", "tundra"},
|
||||
y_min = 2,
|
||||
y_max = 31000,
|
||||
decoration = "default:grass_3",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.02,
|
||||
scale = 0.08,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 66440,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
decoration = "default:grass_4",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.04,
|
||||
scale = 0.08,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 66440,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"default:grassland"},
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
decoration = "default:grass_5",
|
||||
decoration = "default:dry_shrub",
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Detect mapgen to select functions
|
||||
-- Generate nyan cats
|
||||
--
|
||||
|
||||
-- All mapgens except singlenode
|
||||
|
||||
-- Mods using singlenode mapgen can call these functions to enable
|
||||
-- the use of minetest.generate_ores or minetest.generate_decorations
|
||||
|
||||
local mg_params = minetest.get_mapgen_params()
|
||||
if mg_params.mgname == "v5" then
|
||||
default.register_biomes()
|
||||
default.register_ores()
|
||||
elseif mg_params.mgname == "v6" then
|
||||
default.register_mgv6_decorations()
|
||||
default.register_ores()
|
||||
elseif mg_params.mgname == "v7" then
|
||||
default.register_biomes()
|
||||
default.register_decorations()
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Generate nyan cats in all mapgens
|
||||
--
|
||||
|
||||
|
||||
-- facedir: 0/1/2/3 (head node facedir value)
|
||||
-- length: length of rainbow tail
|
||||
function default.make_nyancat(pos, facedir, length)
|
||||
local tailvec = {x = 0, y = 0, z = 0}
|
||||
if facedir == 0 then
|
||||
@ -996,7 +1401,6 @@ function default.make_nyancat(pos, facedir, length)
|
||||
elseif facedir == 3 then
|
||||
tailvec.x = -1
|
||||
else
|
||||
--print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
|
||||
facedir = 0
|
||||
tailvec.z = 1
|
||||
end
|
||||
@ -1009,9 +1413,7 @@ function default.make_nyancat(pos, facedir, length)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function default.generate_nyancats(minp, maxp, seed)
|
||||
if minp.y < -19600 then return end -- no generate in nether
|
||||
local height_min = -30000
|
||||
local height_max = 30000
|
||||
if maxp.y < height_min or minp.y > height_max then
|
||||
@ -1034,4 +1436,21 @@ function default.generate_nyancats(minp, maxp, seed)
|
||||
end
|
||||
|
||||
|
||||
minetest.register_on_generated(default.generate_nyancats)
|
||||
--
|
||||
-- Detect mapgen to select functions
|
||||
--
|
||||
|
||||
-- Mods using singlenode mapgen can call these functions to enable
|
||||
-- the use of minetest.generate_ores or minetest.generate_decorations
|
||||
|
||||
local mg_params = minetest.get_mapgen_params()
|
||||
if mg_params.mgname == "v6" then
|
||||
default.register_ores()
|
||||
default.register_mgv6_decorations()
|
||||
minetest.register_on_generated(default.generate_nyancats)
|
||||
elseif mg_params.mgname ~= "singlenode" then
|
||||
default.register_ores()
|
||||
default.register_biomes()
|
||||
default.register_decorations()
|
||||
minetest.register_on_generated(default.generate_nyancats)
|
||||
end
|
||||
|
@ -1,5 +1,15 @@
|
||||
-- mods/default/nodes.lua
|
||||
|
||||
|
||||
--[[ Node name convention:
|
||||
|
||||
Although many node names are in combined-word form, the required form for new
|
||||
node names is words separated by underscores. If both forms are used in written
|
||||
language (for example pinewood and pine wood) the underscore form should be used.
|
||||
|
||||
--]]
|
||||
|
||||
|
||||
--[[ Index:
|
||||
|
||||
Stone
|
||||
@ -28,6 +38,7 @@ Soft / Non-Stone
|
||||
|
||||
default:dirt
|
||||
default:dirt_with_grass
|
||||
default:dirt_with_dry_grass
|
||||
default:dirt_with_grass_footsteps
|
||||
default:dirt_with_snow
|
||||
|
||||
@ -59,11 +70,16 @@ default:junglewood
|
||||
default:jungleleaves
|
||||
default:junglesapling
|
||||
|
||||
default:pinetree
|
||||
default:pinewood
|
||||
default:pine_tree
|
||||
default:pine_wood
|
||||
default:pine_needles
|
||||
default:pine_sapling
|
||||
|
||||
default:acacia_tree
|
||||
default:acacia_wood
|
||||
default:acacia_leaves
|
||||
default:acacia_sapling
|
||||
|
||||
default:cherry_tree
|
||||
default:cherry_log
|
||||
default:cherry_plank
|
||||
@ -104,12 +120,19 @@ default:cactus
|
||||
default:papyrus
|
||||
default:dry_shrub
|
||||
default:junglegrass
|
||||
|
||||
default:grass_1
|
||||
default:grass_2
|
||||
default:grass_3
|
||||
default:grass_4
|
||||
default:grass_5
|
||||
|
||||
default:dry_grass_1
|
||||
default:dry_grass_2
|
||||
default:dry_grass_3
|
||||
default:dry_grass_4
|
||||
default:dry_grass_5
|
||||
|
||||
Liquids
|
||||
-------
|
||||
(1. Source 2. Flowing)
|
||||
@ -331,6 +354,19 @@ minetest.register_node("default:dirt_with_grass", {
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("default:dirt_with_dry_grass", {
|
||||
description = "Dirt with Dry Grass",
|
||||
tiles = {"default_dry_grass.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_dry_grass_side.png"
|
||||
},
|
||||
groups = {crumbly = 3, soil = 1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("default:dirt_with_grass_footsteps", {
|
||||
description = "Dirt with Grass and Footsteps",
|
||||
tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
|
||||
@ -455,19 +491,19 @@ minetest.register_node("default:snow", {
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
||||
},
|
||||
},
|
||||
groups = {crumbly=3,falling_node=1, melts = 1, float = 1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_snow_footstep", gain=0.25},
|
||||
dug = {name="default_snow_footstep", gain=0.75},
|
||||
footstep = {name = "default_snow_footstep", gain = 0.25},
|
||||
dug = {name = "default_snow_footstep", gain = 0.75},
|
||||
}),
|
||||
|
||||
on_construct = function(pos)
|
||||
pos.y = pos.y - 1
|
||||
if minetest.get_node(pos).name == "default:dirt_with_grass" then
|
||||
minetest.set_node(pos, {name="default:dirt_with_snow"})
|
||||
minetest.set_node(pos, {name = "default:dirt_with_snow"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
@ -553,6 +589,7 @@ minetest.register_node("default:leaves", {
|
||||
waving = 1,
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_leaves.png"},
|
||||
special_tiles = {"default_leaves_simple.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
is_ground_content = false,
|
||||
@ -633,6 +670,7 @@ minetest.register_node("default:jungleleaves", {
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 1,
|
||||
tiles = {"default_jungleleaves.png"},
|
||||
special_tiles = {"default_jungleleaves_simple.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
@ -676,22 +714,23 @@ minetest.register_node("default:junglesapling", {
|
||||
|
||||
|
||||
|
||||
minetest.register_node("default:pinetree", {
|
||||
minetest.register_node("default:pine_tree", {
|
||||
description = "Pine Tree",
|
||||
tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"},
|
||||
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
|
||||
"default_pine_tree.png"},
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
|
||||
minetest.register_node("default:pinewood", {
|
||||
description = "Pinewood Planks",
|
||||
tiles = {"default_pinewood.png"},
|
||||
minetest.register_node("default:pine_wood", {
|
||||
description = "Pine Wood Planks",
|
||||
tiles = {"default_pine_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
@ -703,20 +742,12 @@ minetest.register_node("default:pine_needles",{
|
||||
waving = 1,
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
-- player will get sapling with 1/20 chance
|
||||
items = {"default:pine_sapling"},
|
||||
rarity = 20,
|
||||
},
|
||||
{
|
||||
-- player will get leaves only if he get no saplings,
|
||||
-- this is because max_items is 1
|
||||
items = {"default:pine_needles"},
|
||||
}
|
||||
{items = {"default:pine_sapling"}, rarity = 20},
|
||||
{items = {"default:pine_needles"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
@ -732,13 +763,74 @@ minetest.register_node("default:pine_sapling", {
|
||||
inventory_image = "default_pine_sapling.png",
|
||||
wield_image = "default_pine_sapling.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
||||
},
|
||||
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
|
||||
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
|
||||
attached_node = 1, sapling = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("default:acacia_tree", {
|
||||
description = "Acacia Tree",
|
||||
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
|
||||
"default_acacia_tree.png"},
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
|
||||
minetest.register_node("default:acacia_wood", {
|
||||
description = "Acacia Wood Planks",
|
||||
tiles = {"default_acacia_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("default:acacia_leaves", {
|
||||
description = "Acacia Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_acacia_leaves.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"default:acacia_sapling"}, rarity = 20},
|
||||
{items = {"default:acacia_leaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.register_node("default:acacia_sapling", {
|
||||
description = "Acacia Tree Sapling",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {"default_acacia_sapling.png"},
|
||||
inventory_image = "default_acacia_sapling.png",
|
||||
wield_image = "default_acacia_sapling.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
||||
},
|
||||
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
|
||||
attached_node = 1, sapling = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
@ -1208,6 +1300,54 @@ for i=2,5 do
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node("default:dry_grass_1", {
|
||||
description = "Dry Grass",
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
tiles = {"default_dry_grass_1.png"},
|
||||
inventory_image = "default_dry_grass_3.png",
|
||||
wield_image = "default_dry_grass_3.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random dry grass node
|
||||
local stack = ItemStack("default:dry_grass_"..math.random(1,5))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("default:dry_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
})
|
||||
|
||||
for i=2,5 do
|
||||
minetest.register_node("default:dry_grass_"..i, {
|
||||
description = "Dry Grass",
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
tiles = {"default_dry_grass_"..i..".png"},
|
||||
inventory_image = "default_dry_grass_"..i..".png",
|
||||
wield_image = "default_dry_grass_"..i..".png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
|
||||
drop = "default:dry_grass_1",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
--
|
||||
-- Liquids
|
||||
--
|
||||
|
BIN
minetestforfun_game/mods/default/schematics/acacia_tree.mts
Normal file
BIN
minetestforfun_game/mods/default/schematics/apple_tree.mts
Normal file
BIN
minetestforfun_game/mods/default/schematics/jungle_tree.mts
Normal file
BIN
minetestforfun_game/mods/default/schematics/large_cactus.mts
Normal file
BIN
minetestforfun_game/mods/default/schematics/papyrus.mts
Normal file
BIN
minetestforfun_game/mods/default/schematics/pine_tree.mts
Normal file
After Width: | Height: | Size: 444 B |
After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 682 B |
After Width: | Height: | Size: 731 B |
After Width: | Height: | Size: 261 B |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 42 KiB |
BIN
minetestforfun_game/mods/default/textures/default_dry_grass.png
Normal file
After Width: | Height: | Size: 303 B |
After Width: | Height: | Size: 219 B |
After Width: | Height: | Size: 265 B |
After Width: | Height: | Size: 295 B |
After Width: | Height: | Size: 316 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 430 B |
After Width: | Height: | Size: 817 B |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
BIN
minetestforfun_game/mods/default/textures/default_pine_tree_top.png
Executable file
After Width: | Height: | Size: 802 B |
BIN
minetestforfun_game/mods/default/textures/default_pine_wood.png
Executable file
After Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 293 B |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 20 KiB |
@ -1,7 +1,9 @@
|
||||
--
|
||||
-- Grow trees
|
||||
-- Grow trees from saplings
|
||||
--
|
||||
|
||||
-- 'Can grow' function
|
||||
|
||||
local random = math.random
|
||||
|
||||
local function can_grow(pos)
|
||||
@ -17,10 +19,12 @@ local function can_grow(pos)
|
||||
return true
|
||||
end
|
||||
|
||||
-- Sapling ABMs
|
||||
|
||||
-- Sapling ABM
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:sapling"},
|
||||
nodenames = {"default:sapling", "default:junglesapling",
|
||||
"default:pine_sapling", "default:acacia_sapling"},
|
||||
interval = 10,
|
||||
chance = 50,
|
||||
action = function(pos, node)
|
||||
@ -28,43 +32,45 @@ minetest.register_abm({
|
||||
return
|
||||
end
|
||||
|
||||
minetest.log("action", "A sapling grows into a tree at "..
|
||||
local mapgen = minetest.get_mapgen_params().mgname
|
||||
if node.name == "default:sapling" then
|
||||
minetest.log("action", "A sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
default.grow_tree(pos, random(1, 4) == 1)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:junglesapling"},
|
||||
interval = 11,
|
||||
chance = 50,
|
||||
action = function(pos, node)
|
||||
if not can_grow(pos) then
|
||||
return
|
||||
if mapgen == "v6" then
|
||||
default.grow_tree(pos, random(1, 4) == 1)
|
||||
else
|
||||
default.grow_new_apple_tree(pos)
|
||||
end
|
||||
elseif node.name == "default:junglesapling" then
|
||||
minetest.log("action", "A jungle sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
if mapgen == "v6" then
|
||||
default.grow_jungle_tree(pos)
|
||||
else
|
||||
default.grow_new_jungle_tree(pos)
|
||||
end
|
||||
elseif node.name == "default:pine_sapling" then
|
||||
minetest.log("action", "A pine sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
if mapgen == "v6" then
|
||||
default.grow_pine_tree(pos)
|
||||
else
|
||||
default.grow_new_pine_tree(pos)
|
||||
end
|
||||
elseif node.name == "default:acacia_sapling" then
|
||||
minetest.log("action", "An acacia sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
default.grow_new_acacia_tree(pos)
|
||||
end
|
||||
|
||||
minetest.log("action", "A jungle sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
default.grow_jungle_tree(pos)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:pine_sapling"},
|
||||
interval = 12,
|
||||
chance = 50,
|
||||
action = function(pos, node)
|
||||
if not can_grow(pos) then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.log("action", "A pine sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
default.grow_pine_tree(pos)
|
||||
end
|
||||
})
|
||||
--
|
||||
-- Tree generation
|
||||
--
|
||||
|
||||
-- Appletree, jungletree function
|
||||
-- Apple tree and jungle tree trunk and leaves function
|
||||
|
||||
local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
||||
height, size, iters, is_apple_tree)
|
||||
@ -74,11 +80,11 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
||||
local c_apple = minetest.get_content_id("default:apple")
|
||||
|
||||
-- Trunk
|
||||
for y_dist = 0, height - 1 do
|
||||
local vi = a:index(x, y + y_dist, z)
|
||||
data[a:index(x, y, z)] = tree_cid -- Force-place lowest trunk node to replace sapling
|
||||
for yy = y + 1, y + height - 1 do
|
||||
local vi = a:index(x, yy, z)
|
||||
local node_id = data[vi]
|
||||
if y_dist == 0 or node_id == c_air or node_id == c_ignore
|
||||
or node_id == leaves_cid then
|
||||
if node_id == c_air or node_id == c_ignore or node_id == leaves_cid then
|
||||
data[vi] = tree_cid
|
||||
end
|
||||
end
|
||||
@ -123,7 +129,8 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
|
||||
end
|
||||
end
|
||||
|
||||
-- Appletree
|
||||
|
||||
-- Apple tree
|
||||
|
||||
function default.grow_tree(pos, is_apple_tree, bad)
|
||||
--[[
|
||||
@ -155,7 +162,8 @@ function default.grow_tree(pos, is_apple_tree, bad)
|
||||
vm:update_map()
|
||||
end
|
||||
|
||||
-- Jungletree
|
||||
|
||||
-- Jungle tree
|
||||
|
||||
function default.grow_jungle_tree(pos, bad)
|
||||
--[[
|
||||
@ -206,16 +214,19 @@ function default.grow_jungle_tree(pos, bad)
|
||||
vm:update_map()
|
||||
end
|
||||
|
||||
-- Pinetree from mg mapgen mod, design by sfan5, pointy top added by paramat
|
||||
|
||||
-- Pine tree from mg mapgen mod, design by sfan5, pointy top added by paramat
|
||||
|
||||
local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles)
|
||||
if data[vi] == c_air or data[vi] == c_ignore or data[vi] == c_snow then
|
||||
local node_id = data[vi]
|
||||
if node_id == c_air or node_id == c_ignore or node_id == c_snow then
|
||||
data[vi] = c_pine_needles
|
||||
end
|
||||
end
|
||||
|
||||
local function add_snow(data, vi, c_air, c_ignore, c_snow)
|
||||
if data[vi] == c_air or data[vi] == c_ignore then
|
||||
local node_id = data[vi]
|
||||
if node_id == c_air or node_id == c_ignore then
|
||||
data[vi] = c_snow
|
||||
end
|
||||
end
|
||||
@ -226,7 +237,7 @@ function default.grow_pine_tree(pos)
|
||||
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_ignore = minetest.get_content_id("ignore")
|
||||
local c_pinetree = minetest.get_content_id("default:pinetree")
|
||||
local c_pine_tree = minetest.get_content_id("default:pine_tree")
|
||||
local c_pine_needles = minetest.get_content_id("default:pine_needles")
|
||||
local c_snow = minetest.get_content_id("default:snow")
|
||||
local c_snowblock = minetest.get_content_id("default:snowblock")
|
||||
@ -240,16 +251,14 @@ function default.grow_pine_tree(pos)
|
||||
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
||||
local data = vm:get_data()
|
||||
|
||||
-- Scan for snow nodes near sapling
|
||||
-- Scan for snow nodes near sapling to enable snow on branches
|
||||
local snow = false
|
||||
for yy = y - 1, y + 1 do
|
||||
for zz = z - 1, z + 1 do
|
||||
local vi = a:index(x - 1, yy, zz)
|
||||
for xx = x - 1, x + 1 do
|
||||
local nodid = data[vi]
|
||||
if nodid == c_snow
|
||||
or nodid == c_snowblock
|
||||
or nodid == c_dirtsnow then
|
||||
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
|
||||
snow = true
|
||||
end
|
||||
vi = vi + 1
|
||||
@ -266,7 +275,7 @@ function default.grow_pine_tree(pos)
|
||||
for xx = x - dev, x + dev do
|
||||
if random() < 0.95 - dev * 0.05 then
|
||||
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
|
||||
c_pine_needles)
|
||||
c_pine_needles)
|
||||
if snow then
|
||||
add_snow(data, via, c_air, c_ignore, c_snow)
|
||||
end
|
||||
@ -280,9 +289,9 @@ function default.grow_pine_tree(pos)
|
||||
|
||||
-- Centre top nodes
|
||||
add_pine_needles(data, a:index(x, maxy + 1, z), c_air, c_ignore, c_snow,
|
||||
c_pine_needles)
|
||||
c_pine_needles)
|
||||
add_pine_needles(data, a:index(x, maxy + 2, z), c_air, c_ignore, c_snow,
|
||||
c_pine_needles) -- Paramat added a pointy top node
|
||||
c_pine_needles) -- Paramat added a pointy top node
|
||||
if snow then
|
||||
add_snow(data, a:index(x, maxy + 3, z), c_air, c_ignore, c_snow)
|
||||
end
|
||||
@ -301,7 +310,7 @@ function default.grow_pine_tree(pos)
|
||||
local via = a:index(xi, yy + 1, zz)
|
||||
for xx = xi, xi + 1 do
|
||||
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
|
||||
c_pine_needles)
|
||||
c_pine_needles)
|
||||
if snow then
|
||||
add_snow(data, via, c_air, c_ignore, c_snow)
|
||||
end
|
||||
@ -319,7 +328,7 @@ function default.grow_pine_tree(pos)
|
||||
for xx = x - dev, x + dev do
|
||||
if random() < 0.95 - dev * 0.05 then
|
||||
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
|
||||
c_pine_needles)
|
||||
c_pine_needles)
|
||||
if snow then
|
||||
add_snow(data, via, c_air, c_ignore, c_snow)
|
||||
end
|
||||
@ -332,9 +341,14 @@ function default.grow_pine_tree(pos)
|
||||
end
|
||||
|
||||
-- Trunk
|
||||
for yy = y, maxy do
|
||||
data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling
|
||||
for yy = y + 1, maxy do
|
||||
local vi = a:index(x, yy, z)
|
||||
data[vi] = c_pinetree
|
||||
local node_id = data[vi]
|
||||
if node_id == c_air or node_id == c_ignore or
|
||||
node_id == c_pine_needles or node_id == c_snow then
|
||||
data[vi] = c_pine_tree
|
||||
end
|
||||
end
|
||||
|
||||
vm:set_data(data)
|
||||
@ -342,24 +356,49 @@ function default.grow_pine_tree(pos)
|
||||
vm:update_map()
|
||||
end
|
||||
|
||||
-- New apple tree
|
||||
|
||||
function default.grow_new_apple_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New jungle tree
|
||||
|
||||
function default.grow_new_jungle_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New pine tree
|
||||
|
||||
function default.grow_new_pine_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/pine_tree.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New acacia tree
|
||||
|
||||
function default.grow_new_acacia_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts"
|
||||
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
|
||||
path, random, nil, false)
|
||||
end
|
||||
|
||||
-- From BFD:
|
||||
|
||||
minetest.register_node("default:mg_cherry_sapling", {
|
||||
description = "Impossible to get node.",
|
||||
visual_scale = 1.0,
|
||||
inventory_image = "default_cherry_sapling.png",
|
||||
wield_image = "default_cherry_sapling.png",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
tiles = {"default_cherry_sapling.png"},
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
||||
},
|
||||
groups = {snappy=2, dig_immediate=3, not_in_creative_inventory=1, attached_node=1},
|
||||
drop = "default:cherry_sapling",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
tiles = {"xfences_space.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
local c_mg_cherry_sapling = minetest.get_content_id("default:mg_cherry_sapling")
|
||||
|
@ -129,7 +129,7 @@ function doors.register_door(name, def)
|
||||
|
||||
local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
|
||||
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
|
||||
end
|
||||
local p2 = minetest.get_node(pos).param2
|
||||
|
@ -14,3 +14,9 @@ http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
License of media (textures and sounds)
|
||||
--------------------------------------
|
||||
WTFPL
|
||||
|
||||
Gambit (WTFPL):
|
||||
flowers_mushroom_*.png
|
||||
|
||||
DanDuncombe (WTFPL):
|
||||
flowers_spores_*.png
|
||||
|
@ -1,21 +1,33 @@
|
||||
-- Minetest 0.4 mod: default
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
|
||||
-- Namespace for functions
|
||||
|
||||
flowers = {}
|
||||
|
||||
|
||||
-- Map Generation
|
||||
dofile(minetest.get_modpath("flowers").."/mapgen.lua")
|
||||
|
||||
dofile(minetest.get_modpath("flowers") .. "/mapgen.lua")
|
||||
|
||||
|
||||
--
|
||||
-- Flowers
|
||||
--
|
||||
|
||||
-- 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_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_dandelion_white", "flowers:dandelion_white")
|
||||
|
||||
|
||||
-- Flower registration
|
||||
|
||||
-- Flower registration function
|
||||
local function add_simple_flower(name, desc, box, f_groups)
|
||||
-- Common flowers' groups
|
||||
f_groups.snappy = 3
|
||||
@ -24,10 +36,10 @@ local function add_simple_flower(name, desc, box, f_groups)
|
||||
f_groups.flora = 1
|
||||
f_groups.attached_node = 1
|
||||
|
||||
minetest.register_node("flowers:"..name.."", {
|
||||
minetest.register_node("flowers:" .. name, {
|
||||
description = desc,
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flowers_" .. name .. ".png" },
|
||||
tiles = {"flowers_" .. name .. ".png"},
|
||||
inventory_image = "flowers_" .. name .. ".png",
|
||||
wield_image = "flowers_" .. name .. ".png",
|
||||
sunlight_propagates = true,
|
||||
@ -43,14 +55,13 @@ local function add_simple_flower(name, desc, box, f_groups)
|
||||
})
|
||||
end
|
||||
|
||||
-- Registrations using the function above
|
||||
flowers.datas = {
|
||||
{"dandelion_yellow", "Yellow Dandelion", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_yellow=1}},
|
||||
{"geranium", "Blue Geranium", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_blue=1}},
|
||||
{"rose", "Rose", { -0.15, -0.5, -0.15, 0.15, 0.3, 0.15 }, {color_red=1}},
|
||||
{"tulip", "Orange Tulip", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_orange=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}}
|
||||
{"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1}},
|
||||
{"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1}},
|
||||
{"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1}},
|
||||
{"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 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
|
||||
@ -81,6 +92,8 @@ minetest.register_node("flowers:lily_pad", {
|
||||
},
|
||||
})
|
||||
|
||||
-- Flower spread
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:flora"},
|
||||
neighbors = {"default:dirt_with_grass", "default:desert_sand"},
|
||||
@ -91,7 +104,7 @@ minetest.register_abm({
|
||||
local under = minetest.get_node(pos)
|
||||
pos.y = pos.y + 1
|
||||
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
|
||||
return
|
||||
end
|
||||
@ -101,8 +114,8 @@ minetest.register_abm({
|
||||
return
|
||||
end
|
||||
|
||||
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 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}
|
||||
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
|
||||
return
|
||||
end
|
||||
@ -121,8 +134,127 @@ minetest.register_abm({
|
||||
return
|
||||
end
|
||||
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,
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- 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
|
||||
})
|
||||
|
@ -1,4 +1,8 @@
|
||||
local function register_flower(name)
|
||||
--
|
||||
-- Mgv6
|
||||
--
|
||||
|
||||
local function register_mgv6_flower(name)
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
@ -17,15 +21,102 @@ local function register_flower(name)
|
||||
})
|
||||
end
|
||||
|
||||
function flowers.register_mgv6_decorations()
|
||||
register_flower("rose")
|
||||
register_flower("tulip")
|
||||
register_flower("dandelion_yellow")
|
||||
register_flower("geranium")
|
||||
register_flower("viola")
|
||||
register_flower("dandelion_white")
|
||||
local function register_mgv6_mushroom(name)
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
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
|
||||
|
||||
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({
|
||||
deco_type = "simple",
|
||||
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()
|
||||
if mg_params.mgname == "v6" then
|
||||
flowers.register_mgv6_decorations()
|
||||
elseif mg_params.mgname ~= "singlenode" then
|
||||
flowers.register_decorations()
|
||||
end
|
||||
|
||||
|
After Width: | Height: | Size: 155 B |
After Width: | Height: | Size: 167 B |
After Width: | Height: | Size: 94 B |
After Width: | Height: | Size: 92 B |
@ -1 +1,2 @@
|
||||
default
|
||||
farming
|
||||
|
@ -1,14 +1,25 @@
|
||||
-- Minetest 0.4 mod: stairs
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
|
||||
-- Global namespace for functions
|
||||
|
||||
stairs = {}
|
||||
|
||||
|
||||
-- Get setting for replace ABM
|
||||
|
||||
local replace = minetest.setting_getbool("enable_stairs_replace_abm")
|
||||
|
||||
|
||||
-- Register stairs.
|
||||
-- Node will be called stairs:stair_<subname>
|
||||
|
||||
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":stairs:stair_" .. subname, {
|
||||
description = description,
|
||||
drawtype = "mesh",
|
||||
mesh = "stairs.obj",
|
||||
mesh = "stairs_stair.obj",
|
||||
tiles = images,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
@ -48,7 +59,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
|
||||
param2 = minetest.dir_to_facedir(dir)
|
||||
end
|
||||
|
||||
if p0.y-1 == p1.y then
|
||||
if p0.y - 1 == p1.y then
|
||||
param2 = param2 + 20
|
||||
if param2 == 21 then
|
||||
param2 = 23
|
||||
@ -62,10 +73,12 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":stairs:stair_" .. subname.."upside_down", {
|
||||
replace_name = "stairs:stair_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
if replace then
|
||||
minetest.register_node(":stairs:stair_" .. subname .. "upside_down", {
|
||||
replace_name = "stairs:stair_" .. subname,
|
||||
groups = {slabs_replace = 1},
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'stairs:stair_' .. subname .. ' 6',
|
||||
@ -87,7 +100,10 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Register slabs.
|
||||
-- Node will be called stairs:slab_<subname>
|
||||
|
||||
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":stairs:slab_" .. subname, {
|
||||
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
|
||||
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
|
||||
slabnode = n0
|
||||
elseif n1.name == "stairs:slab_" .. subname then
|
||||
@ -136,7 +153,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||
|
||||
pointed_thing.above = slabpos
|
||||
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 success then
|
||||
itemstack:set_count(fakestack:get_count())
|
||||
@ -148,7 +166,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||
end
|
||||
|
||||
-- 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
|
||||
if n0_is_upside_down then
|
||||
-- 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
|
||||
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 success then
|
||||
itemstack:set_count(fakestack:get_count())
|
||||
@ -175,7 +194,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||
end
|
||||
|
||||
-- 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
|
||||
end
|
||||
|
||||
@ -184,10 +203,12 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":stairs:slab_" .. subname.."upside_down", {
|
||||
replace_name = "stairs:slab_"..subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
if replace then
|
||||
minetest.register_node(":stairs:slab_" .. subname .. "upside_down", {
|
||||
replace_name = "stairs:slab_".. subname,
|
||||
groups = {slabs_replace = 1},
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'stairs:slab_' .. subname .. ' 6',
|
||||
@ -197,127 +218,180 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||
})
|
||||
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>
|
||||
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_slab(subname, recipeitem, groups, images, desc_slab, sounds)
|
||||
end
|
||||
|
||||
|
||||
-- Register default stairs and slabs
|
||||
|
||||
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"},
|
||||
"Wooden Stair",
|
||||
"Wooden Slab",
|
||||
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",
|
||||
{cracky=3},
|
||||
{cracky = 3},
|
||||
{"default_stone.png"},
|
||||
"Stone Stair",
|
||||
"Stone Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("cobble", "default:cobble",
|
||||
{cracky=3},
|
||||
{cracky = 3},
|
||||
{"default_cobble.png"},
|
||||
"Cobblestone Stair",
|
||||
"Cobblestone Slab",
|
||||
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",
|
||||
{cracky=3},
|
||||
{cracky = 3},
|
||||
{"default_desert_stone.png"},
|
||||
"Desertstone Stair",
|
||||
"Desertstone Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("desert_cobble", "default:desert_cobble",
|
||||
{cracky=3},
|
||||
{cracky = 3},
|
||||
{"default_desert_cobble.png"},
|
||||
"Desert Cobblestone Stair",
|
||||
"Desert Cobblestone Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick",
|
||||
{cracky=3},
|
||||
{cracky = 3},
|
||||
{"default_desert_stone_brick.png"},
|
||||
"Desert Stone Brick Stair",
|
||||
"Desert Stone Brick Slab",
|
||||
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",
|
||||
{crumbly=1,cracky=3},
|
||||
{crumbly = 2, cracky = 2},
|
||||
{"default_sandstone.png"},
|
||||
"Sandstone Stair",
|
||||
"Sandstone Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick",
|
||||
{crumbly=2,cracky=2},
|
||||
{crumbly = 2, cracky = 2},
|
||||
{"default_sandstone_brick.png"},
|
||||
"Sandstone Brick Stair",
|
||||
"Sandstone Brick Slab",
|
||||
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",
|
||||
{cracky=1,level=2},
|
||||
{cracky = 1, level = 2},
|
||||
{"default_obsidian.png"},
|
||||
"Obsidian Stair",
|
||||
"Obsidian Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick",
|
||||
{cracky=1,level=2},
|
||||
{cracky = 1, level = 2},
|
||||
{"default_obsidian_brick.png"},
|
||||
"Obsidian Brick Stair",
|
||||
"Obsidian Brick Slab",
|
||||
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:
|
||||
|
||||
stairs.register_stair_and_slab("cherry_wood", "default:cherry_plank",
|
||||
|
@ -185,7 +185,7 @@ xpanes.register_pane("bar", {
|
||||
textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"},
|
||||
inventory_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(),
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
|