Add files via upload
parent
01e1e30410
commit
6847d44e93
|
@ -0,0 +1,306 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- bone item
|
||||
minetest.register_craftitem("lib_ecology:bone", {
|
||||
description = S("Bone"),
|
||||
inventory_image = "bone.png",
|
||||
})
|
||||
|
||||
-- bonemeal recipes
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'lib_ecology:bonemeal 2',
|
||||
recipe = {'lib_ecology:bone'},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'lib_ecology:bonemeal 4',
|
||||
recipe = {'bones:bones'},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:white 2",
|
||||
recipe = {"lib_ecology:bonemeal"},
|
||||
})
|
||||
|
||||
-- have animalmaterials bone craft into bonemeal if found
|
||||
if minetest.get_modpath('animalmaterials') then
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'lib_ecology:bonemeal 2',
|
||||
recipe = {'animalmaterials:bone'},
|
||||
})
|
||||
end
|
||||
|
||||
-- add bones to dirt
|
||||
minetest.override_item("default:dirt", {
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
items = {'lib_ecology:bone', 'default:dirt'},
|
||||
rarity = 30,
|
||||
},
|
||||
{
|
||||
items = {'default:dirt'},
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
local plants = {
|
||||
"flowers:dandelion_white",
|
||||
"flowers:dandelion_yellow",
|
||||
"flowers:geranium",
|
||||
"flowers:rose",
|
||||
"flowers:tulip",
|
||||
"flowers:viola",
|
||||
}
|
||||
|
||||
|
||||
local crops = {
|
||||
{"farming:cotton_", 8},
|
||||
{"farming:wheat_", 8},
|
||||
{"farming:tomato_", 8},
|
||||
{"farming:corn_", 8},
|
||||
{"farming:melon_", 8},
|
||||
{"farming:pumpkin_", 8},
|
||||
{"farming:beanpole_", 5},
|
||||
{"farming:blueberry_", 4},
|
||||
{"farming:raspberry_", 4},
|
||||
{"farming:carrot_", 8},
|
||||
{"farming:cocoa_", 3},
|
||||
{"farming:coffee_", 5},
|
||||
{"farming:cucumber_", 4},
|
||||
{"farming:potato_", 4},
|
||||
{"farming:grapes_", 8},
|
||||
{"farming:rhubarb_", 3},
|
||||
{"lib_ecology:strawberry_", 8},
|
||||
{"lib_ecology:onion_", 5},
|
||||
{"farming:barley_", 7},
|
||||
}
|
||||
|
||||
-- check if sapling has enough height room to grow
|
||||
local function enough_height(pos, height)
|
||||
|
||||
local nod = minetest.line_of_sight(
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y + height, z = pos.z})
|
||||
|
||||
if not nod then
|
||||
return false -- obstructed
|
||||
else
|
||||
return true -- can grow
|
||||
end
|
||||
end
|
||||
|
||||
-- growing routine
|
||||
local function growth(pointed_thing)
|
||||
|
||||
local pos = pointed_thing.under
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
if node.name == "ignore" then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.add_particlespawner({
|
||||
amount = 4,
|
||||
time = 0.15,
|
||||
minpos = pos,
|
||||
maxpos = pos,
|
||||
minvel = {x = -1, y = 2, z = -1},
|
||||
maxvel = {x = 1, y = 4, z = 1},
|
||||
minacc = {x = -1, y = -1, z = -1},
|
||||
maxacc = {x = 1, y = 1, z = 1},
|
||||
minexptime = 1,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 3,
|
||||
texture = "bonemeal_particle.png",
|
||||
})
|
||||
|
||||
-- 50/50 chance of growing a sapling
|
||||
if minetest.get_item_group(node.name, "sapling") > 0
|
||||
or minetest.get_item_group(node.name, "lib_ecology_sapling") > 0 then
|
||||
|
||||
if math.random(1, 2) == 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local under = minetest.get_node({
|
||||
x = pos.x,
|
||||
y = pos.y - 1,
|
||||
z = pos.z
|
||||
})
|
||||
|
||||
local height = minetest.registered_nodes[node.name].grown_height
|
||||
|
||||
-- do we have enough height to grow sapling into tree?
|
||||
if height and not enough_height(pos, height) then
|
||||
return
|
||||
end
|
||||
|
||||
-- specific check for palm tree's, so they grow on sand
|
||||
if node.name == "lib_ecology:palm_sapling"
|
||||
and under.name == "default:sand" then
|
||||
lib_ecology.grow_palm_tree(pos)
|
||||
return
|
||||
end
|
||||
|
||||
-- check for soil under sapling
|
||||
if minetest.get_item_group(under.name, "soil") == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- grow lib_ecology tree
|
||||
if node.name == "lib_ecology:palm_sapling" then
|
||||
lib_ecology.grow_palm_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:yellow_tree_sapling" then
|
||||
lib_ecology.grow_yellow_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:big_tree_sapling" then
|
||||
lib_ecology.grow_big_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:banana_tree_sapling" then
|
||||
lib_ecology.grow_banana_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:frost_tree_sapling" then
|
||||
lib_ecology.grow_frost_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:mushroom_sapling" then
|
||||
lib_ecology.grow_mushroom_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:willow_sapling" then
|
||||
lib_ecology.grow_willow_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:redwood_sapling" then
|
||||
lib_ecology.grow_redwood_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:orange_tree_sapling" then
|
||||
lib_ecology.grow_orange_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:bamboo_sprout" then
|
||||
lib_ecology.grow_bamboo_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:birch_sapling" then
|
||||
lib_ecology.grow_birch_tree(pos)
|
||||
|
||||
-- grow default tree
|
||||
elseif node.name == "default:sapling"
|
||||
and enough_height(pos, 7) then
|
||||
default.grow_new_apple_tree(pos)
|
||||
|
||||
elseif node.name == "default:junglesapling"
|
||||
and enough_height(pos, 15) then
|
||||
default.grow_new_jungle_tree(pos)
|
||||
|
||||
elseif node.name == "default:pine_sapling"
|
||||
and enough_height(pos, 11) then
|
||||
|
||||
if minetest.find_node_near(pos, 1,
|
||||
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
|
||||
|
||||
default.grow_new_snowy_pine_tree(pos)
|
||||
else
|
||||
default.grow_new_pine_tree(pos)
|
||||
end
|
||||
|
||||
elseif node.name == "default:acacia_sapling"
|
||||
and enough_height(pos, 7) then
|
||||
default.grow_new_acacia_tree(pos)
|
||||
|
||||
elseif node.name == "default:aspen_sapling"
|
||||
and enough_height(pos, 11) then
|
||||
default.grow_new_aspen_tree(pos)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local stage = ""
|
||||
|
||||
-- grow registered crops
|
||||
for n = 1, #crops do
|
||||
|
||||
if string.find(node.name, crops[n][1]) then
|
||||
|
||||
stage = tonumber( node.name:split("_")[2] )
|
||||
stage = math.min(stage + math.random(1, 4), crops[n][2])
|
||||
|
||||
minetest.set_node(pos, {name = crops[n][1] .. stage})
|
||||
|
||||
return
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- grow grass and flowers
|
||||
if minetest.get_item_group(node.name, "soil") > 0 then
|
||||
|
||||
local dirt = minetest.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
{x = pos.x + 2, y = pos.y + 1, z = pos.z + 2},
|
||||
{"group:soil"})
|
||||
|
||||
for _,n in pairs(dirt) do
|
||||
|
||||
local pos2 = n
|
||||
|
||||
pos2.y = pos2.y + 1
|
||||
|
||||
if math.random(0, 5) > 3 then
|
||||
|
||||
minetest.swap_node(pos2,
|
||||
{name = plants[math.random(1, #plants)]})
|
||||
else
|
||||
|
||||
if node.name == "default:dirt_with_dry_grass" then
|
||||
minetest.swap_node(pos2,
|
||||
{name = "default:dry_grass_" .. math.random(1, 5)})
|
||||
else
|
||||
minetest.swap_node(pos2,
|
||||
{name = "default:grass_" .. math.random(1, 5)})
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- bonemeal item
|
||||
minetest.register_craftitem("lib_ecology:bonemeal", {
|
||||
description = S("Bone Meal"),
|
||||
inventory_image = "bonemeal.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type == "node" then
|
||||
|
||||
-- Check if node protected
|
||||
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
local item = user:get_wielded_item()
|
||||
|
||||
item:take_item()
|
||||
user:set_wielded_item(item)
|
||||
end
|
||||
|
||||
growth(pointed_thing)
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -0,0 +1,246 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Crystal Spike (Hurts if you touch it - thanks to ZonerDarkRevention for his DokuCraft DeviantArt crystal texture)
|
||||
minetest.register_node("lib_ecology:crystal_spike", {
|
||||
description = S("Crystal Spike"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "crystal_spike.png" },
|
||||
inventory_image = "crystal_spike.png",
|
||||
wield_image = "crystal_spike.png",
|
||||
paramtype = "light",
|
||||
light_source = 7,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
damage_per_second = 1,
|
||||
groups = {cracky = 1, falling_node = 1, puts_out_fire = 1, cools_lava = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.41, 5 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
-- Crystal Ingot
|
||||
minetest.register_craftitem("lib_ecology:crystal_ingot", {
|
||||
description = S("Crystal Ingot"),
|
||||
inventory_image = "crystal_ingot.png",
|
||||
wield_image = "crystal_ingot.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:crystal_ingot",
|
||||
recipe = {
|
||||
{"default:mese_crystal", "lib_ecology:crystal_spike"},
|
||||
{"lib_ecology:crystal_spike", "default:mese_crystal"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:crystal_ingot",
|
||||
recipe = {
|
||||
{"lib_ecology:crystal_spike", "default:mese_crystal"},
|
||||
{"default:mese_crystal", "lib_ecology:crystal_spike"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Crystal Block
|
||||
minetest.register_node("lib_ecology:crystal_block", {
|
||||
description = S("Crystal Block"),
|
||||
tiles = {"crystal_block.png"},
|
||||
light_source = 9,
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 1, level = 2, puts_out_fire = 1, cools_lava = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:crystal_block",
|
||||
recipe = {
|
||||
{"lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot"},
|
||||
{"lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot"},
|
||||
{"lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:crystal_ingot 9",
|
||||
recipe = {
|
||||
{"lib_ecology:crystal_block"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Crystal Sword (Powerful wee beastie)
|
||||
minetest.register_tool("lib_ecology:sword_crystal", {
|
||||
description = S("Crystal Sword"),
|
||||
inventory_image = "crystal_sword.png",
|
||||
wield_image = "crystal_sword.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.6,
|
||||
max_drop_level = 1,
|
||||
groupcaps = {
|
||||
snappy = {
|
||||
times = {[1] = 1.70, [2] = 0.70, [3] = 0.25},
|
||||
uses = 50,
|
||||
maxlevel = 3
|
||||
},
|
||||
},
|
||||
damage_groups = {fleshy = 10},
|
||||
},
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:sword_crystal",
|
||||
recipe = {
|
||||
{"lib_ecology:crystal_ingot"},
|
||||
{"lib_ecology:crystal_ingot"},
|
||||
{"default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Crystal Axe
|
||||
minetest.register_tool("lib_ecology:axe_crystal", {
|
||||
description = S("Crystal Axe"),
|
||||
inventory_image = "crystal_axe.png",
|
||||
wield_image = "crystal_axe.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.8,
|
||||
max_drop_level = 1,
|
||||
groupcaps = {
|
||||
choppy = {
|
||||
times = {[1] = 2.00, [2] = 0.80, [3] = 0.40},
|
||||
uses = 40,
|
||||
maxlevel = 3
|
||||
},
|
||||
},
|
||||
damage_groups = {fleshy = 7},
|
||||
},
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'lib_ecology:axe_crystal',
|
||||
recipe = {
|
||||
{'lib_ecology:crystal_ingot', 'lib_ecology:crystal_ingot'},
|
||||
{'lib_ecology:crystal_ingot', 'default:steel_ingot'},
|
||||
{'', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'lib_ecology:axe_crystal',
|
||||
recipe = {
|
||||
{'lib_ecology:crystal_ingot', 'lib_ecology:crystal_ingot'},
|
||||
{'default:steel_ingot', 'lib_ecology:crystal_ingot'},
|
||||
{'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
-- Crystal Pick (This will last a while)
|
||||
minetest.register_tool("lib_ecology:pick_crystal", {
|
||||
description = S("Crystal Pickaxe"),
|
||||
inventory_image = "crystal_pick.png",
|
||||
wield_image = "crystal_pick.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.7,
|
||||
max_drop_level = 3,
|
||||
groupcaps={
|
||||
cracky = {
|
||||
times = {[1] = 1.8, [2] = 0.8, [3] = 0.40},
|
||||
uses = 40,
|
||||
maxlevel = 3
|
||||
},
|
||||
},
|
||||
damage_groups = {fleshy = 6},
|
||||
},
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:pick_crystal",
|
||||
recipe = {
|
||||
{"lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot", "lib_ecology:crystal_ingot"},
|
||||
{"", "default:steel_ingot", ""},
|
||||
{"", "default:steel_ingot", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- Crystal Shovel (with Soft Touch so player can dig up dirt with grass intact)
|
||||
minetest.register_tool("lib_ecology:shovel_crystal", {
|
||||
description = S("Crystal (soft touch) Shovel"),
|
||||
inventory_image = "crystal_shovel.png",
|
||||
wield_image = "crystal_shovel.png^[transformR90",
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if node protected
|
||||
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = pointed_thing.under
|
||||
local nn = minetest.get_node(pos).name
|
||||
|
||||
-- Is node dirt, sand or gravel
|
||||
if minetest.get_item_group(nn, "crumbly") > 0 then
|
||||
|
||||
local inv = user:get_inventory()
|
||||
|
||||
minetest.remove_node(pointed_thing.under)
|
||||
|
||||
nodeupdate(pos)
|
||||
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
|
||||
if not inv:contains_item("main", {name = nn}) then
|
||||
inv:add_item("main", {name = nn})
|
||||
end
|
||||
else
|
||||
|
||||
inv:add_item("main", {name = nn})
|
||||
itemstack:add_wear(65535 / 100) -- 111 uses
|
||||
end
|
||||
|
||||
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.4})
|
||||
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:shovel_crystal",
|
||||
recipe = {
|
||||
{"lib_ecology:crystal_ingot"},
|
||||
{"default:steel_ingot"},
|
||||
{"default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Crystal Gilly Staff (replenishes air supply when used)
|
||||
minetest.register_tool("lib_ecology:crystal_gilly_staff", {
|
||||
description = S("Crystal Gilly Staff"),
|
||||
inventory_image = "crystal_gilly_staff.png",
|
||||
wield_image = "crystal_gilly_staff.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
if user:get_breath() < 10 then
|
||||
user:set_breath(10)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "lib_ecology:crystal_gilly_staff",
|
||||
recipe = {
|
||||
"lib_ecology:green_moss", "lib_ecology:gray_moss", "lib_ecology:fiery_moss",
|
||||
"lib_ecology:crystal_moss", "lib_ecology:crystal_ingot", "lib_ecology:mushroom_moss",
|
||||
"lib_ecology:crystal_ingot"
|
||||
},
|
||||
})
|
|
@ -0,0 +1,492 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- override default dirt (to stop caves cutting away dirt)
|
||||
minetest.override_item("default:dirt", {is_ground_content = lib_ecology.cavedirt})
|
||||
|
||||
-- green dirt
|
||||
minetest.register_node("lib_ecology:green_dirt", {
|
||||
description = S("Green Dirt"),
|
||||
tiles = {
|
||||
"default_grass.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png"
|
||||
},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
groups = {crumbly = 3, soil = 1, lib_ecology_grass = 1},
|
||||
soil = {
|
||||
base = "lib_ecology:green_dirt",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
},
|
||||
drop = "default:dirt",
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
-- dry dirt
|
||||
minetest.register_node("lib_ecology:dry_dirt", {
|
||||
description = S("Dried Dirt"),
|
||||
tiles = {"ethereal_dry_dirt.png"},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
groups = {crumbly = 3},
|
||||
sounds = default.node_sound_dirt_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "lib_ecology:dry_dirt",
|
||||
recipe = "default:dirt",
|
||||
cooktime = 3,
|
||||
})
|
||||
|
||||
local dirts = {
|
||||
"Bamboo", "Jungle", "Grove", "Prairie", "Cold",
|
||||
"Crystal", "Mushroom", "Fiery", "Gray"
|
||||
}
|
||||
|
||||
for n = 1, #dirts do
|
||||
|
||||
local desc = dirts[n]
|
||||
local name = desc:lower()
|
||||
|
||||
minetest.register_node("lib_ecology:"..name.."_dirt", {
|
||||
description = S(desc.." Dirt"),
|
||||
tiles = {
|
||||
"ethereal_grass_"..name.."_top.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^ethereal_grass_"..name.."_side.png"
|
||||
},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
groups = {crumbly = 3, soil = 1, lib_ecology_grass = 1},
|
||||
soil = {
|
||||
base = "lib_ecology:"..name.."_dirt",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
},
|
||||
drop = "default:dirt",
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
for n = 1, #dirts do
|
||||
|
||||
local desc = dirts[n]
|
||||
local name = desc:lower()
|
||||
|
||||
minetest.register_node(":ethereal:" .. name .. "_dirt", {
|
||||
description = S("Ethereal " .. desc .. " Dirt"),
|
||||
tiles = {
|
||||
"ethereal_grass_"..name.."_top.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^ethereal_grass_"..name.."_side.png"
|
||||
},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
groups = {crumbly = 3, soil = 1, lib_ecology_grass = 1},
|
||||
soil = {
|
||||
base = "lib_ecology:"..name.."_dirt",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
},
|
||||
drop = "default:dirt",
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
-- re-register dirt types for abm
|
||||
dirts = {
|
||||
"lib_ecology:bamboo_dirt", "lib_ecology:jungle_dirt", "lib_ecology:grove_dirt", "lib_ecology:prairie_dirt", "lib_ecology:cold_dirt", "lib_ecology:crystal_dirt", "lib_ecology:mushroom_dirt", "lib_ecology:fiery_dirt", "lib_ecology:gray_dirt", "default:dirt_with_grass", "default:dirt_with_dry_grass", "lib_ecology:green_dirt", "default:dirt_with_snow", "default:dirt_with_dry_grass", ":ethereal:bamboo_dirt", ":ethereal:jungle_dirt", ":ethereal:grove_dirt", ":ethereal:prairie_dirt", ":ethereal:cold_dirt", ":ethereal:crystal_dirt", ":ethereal:mushroom_dirt", ":ethereal:fiery_dirt", ":ethereal:gray_dirt", ":ethereal:green_dirt"
|
||||
}
|
||||
|
||||
-- check surrounding grass and change dirt to same colour
|
||||
local grass_spread = function(pos, node)
|
||||
|
||||
-- not enough light
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
|
||||
if (minetest.get_node_light(above) or 0) < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
-- water above grass
|
||||
local name = minetest.get_node(above).name
|
||||
local def = minetest.registered_nodes[name]
|
||||
|
||||
if name == "ignore" or not def or def.liquidtype ~= "none" then
|
||||
return
|
||||
end
|
||||
|
||||
local curr_max, curr_type, num = 0, ""
|
||||
|
||||
-- find all default and lib_ecology grasses in area around dirt
|
||||
local positions, grasses = minetest.find_nodes_in_area(
|
||||
{x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
|
||||
{x = pos.x + 1, y = pos.y + 2, z = pos.z + 1},
|
||||
{"group:lib_ecology_grass", "default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass", "default:dirt_with_snow"})
|
||||
|
||||
-- count new grass nodes
|
||||
for n = 1, #dirts do
|
||||
|
||||
num = grasses[ dirts[n] ] or 0
|
||||
|
||||
if num > curr_max then
|
||||
curr_max = num
|
||||
curr_type = dirts[n]
|
||||
end
|
||||
end
|
||||
|
||||
-- no grass nearby, keep as dirt
|
||||
if curr_type == "" then
|
||||
return
|
||||
end
|
||||
|
||||
-- change default green grass to lib_ecology green grass
|
||||
if curr_type == "default:dirt_with_grass" then
|
||||
--curr_type = "lib_ecology:green_dirt"
|
||||
end
|
||||
|
||||
if curr_type == "lib_ecology:green_dirt" then
|
||||
curr_type = "default:dirt_with_grass"
|
||||
end
|
||||
|
||||
minetest.swap_node(pos, {name = curr_type})
|
||||
end
|
||||
|
||||
-- any grass with a block above will turn into dirt
|
||||
local grass_devoid = function(pos, node)
|
||||
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local name = minetest.get_node(above).name
|
||||
local nodedef = minetest.registered_nodes[name]
|
||||
|
||||
if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or
|
||||
nodedef.paramtype == "light") and
|
||||
nodedef.liquidtype == "none") then
|
||||
|
||||
minetest.swap_node(pos, {name = "default:dirt"})
|
||||
end
|
||||
end
|
||||
|
||||
-- flower spread, also crystal and fire flower regeneration
|
||||
local flower_spread = function(pos, node)
|
||||
|
||||
if (minetest.get_node_light(pos) or 0) < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
local pos0 = {x = pos.x - 4, y = pos.y - 2, z = pos.z - 4}
|
||||
local pos1 = {x = pos.x + 4, y = pos.y + 2, z = pos.z + 4}
|
||||
|
||||
local num = #minetest.find_nodes_in_area_under_air(pos0, pos1, "group:flora")
|
||||
|
||||
-- stop flowers spreading too much just below top of map block
|
||||
if minetest.find_node_near(pos, 2, "ignore") then
|
||||
return
|
||||
end
|
||||
|
||||
if num > 3
|
||||
and node.name == "lib_ecology:crystalgrass" then
|
||||
|
||||
local grass = minetest.find_nodes_in_area_under_air(
|
||||
pos0, pos1, {"lib_ecology:crystalgrass"})
|
||||
|
||||
if #grass > 4
|
||||
and not minetest.find_node_near(pos, 4, {"lib_ecology:crystal_spike"}) then
|
||||
|
||||
pos = grass[math.random(#grass)]
|
||||
|
||||
pos.y = pos.y - 1
|
||||
|
||||
if minetest.get_node(pos).name == "lib_ecology:crystal_dirt" then
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
minetest.swap_node(pos, {name = "lib_ecology:crystal_spike"})
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
elseif num > 3
|
||||
and node.name == "lib_ecology:dry_shrub" then
|
||||
|
||||
local grass = minetest.find_nodes_in_area_under_air(
|
||||
pos0, pos1, {"lib_ecology:dry_shrub"})
|
||||
|
||||
if #grass > 8
|
||||
and not minetest.find_node_near(pos, 4, {"lib_ecology:fire_flower"}) then
|
||||
|
||||
pos = grass[math.random(#grass)]
|
||||
|
||||
pos.y = pos.y - 1
|
||||
|
||||
if minetest.get_node(pos).name == "lib_ecology:fiery_dirt" then
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
minetest.swap_node(pos, {name = "lib_ecology:fire_flower"})
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
elseif num > 3 then
|
||||
return
|
||||
end
|
||||
|
||||
local seedling = minetest.find_nodes_in_area_under_air(
|
||||
pos0, pos1, {"group:soil"})
|
||||
|
||||
if #seedling > 0 then
|
||||
|
||||
pos = seedling[math.random(#seedling)]
|
||||
|
||||
-- default farming has desert sand as soil, so dont spread on this
|
||||
if minetest.get_node(pos).name == "default:desert_sand" then
|
||||
return
|
||||
end
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
if (minetest.get_node_light(pos) or 0) < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.swap_node(pos, {name = node.name})
|
||||
end
|
||||
end
|
||||
|
||||
-- grow papyrus up to 4 high and bamboo up to 8 high
|
||||
local grow_papyrus = function(pos, node)
|
||||
|
||||
local oripos = pos.y
|
||||
local high = 4
|
||||
|
||||
pos.y = pos.y - 1
|
||||
|
||||
local nod = minetest.get_node_or_nil(pos)
|
||||
|
||||
if not nod
|
||||
or minetest.get_item_group(nod.name, "soil") < 1
|
||||
or minetest.find_node_near(pos, 3, {"group:water"}) == nil then
|
||||
return
|
||||
end
|
||||
|
||||
if node.name == "lib_ecology:bamboo" then
|
||||
high = 8
|
||||
end
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
local height = 0
|
||||
|
||||
while height < high
|
||||
and minetest.get_node(pos).name == node.name do
|
||||
height = height + 1
|
||||
pos.y = pos.y + 1
|
||||
end
|
||||
|
||||
nod = minetest.get_node_or_nil(pos)
|
||||
|
||||
if nod
|
||||
and nod.name == "air"
|
||||
and height < high then
|
||||
|
||||
if node.name == "lib_ecology:bamboo"
|
||||
and height == (high - 1) then
|
||||
|
||||
lib_ecology.grow_bamboo_tree({x = pos.x, y = oripos, z = pos.z})
|
||||
else
|
||||
minetest.swap_node(pos, {name = node.name})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- loop through active abm's
|
||||
for _, ab in pairs(minetest.registered_abms) do
|
||||
|
||||
local label = ab.label or ""
|
||||
local node1 = ab.nodenames and ab.nodenames[1] or ""
|
||||
local node2 = ab.nodenames and ab.nodenames[2] or ""
|
||||
local neigh = ab.neighbors and ab.neighbors[1] or ""
|
||||
|
||||
-- find dirt to grass abm and replace with spread function
|
||||
if label == "Grass spread"
|
||||
or (node1 == "default:dirt"
|
||||
and neigh == "default:dirt_with_grass") then
|
||||
|
||||
--ab.interval = 2
|
||||
--ab.chance = 1
|
||||
ab.nodenames = {"default:dirt_with_grass", "default:dirt"}
|
||||
ab.neighbors = {"air"}
|
||||
ab.action = grass_spread
|
||||
|
||||
-- find grass devoid of light to dirt abm and change to devoid function
|
||||
elseif label == "Grass covered"
|
||||
or (node1 == "default:dirt_with_grass"
|
||||
and node2 == "default:dirt_with_dry_grass") then
|
||||
|
||||
--ab.interval = 2
|
||||
--ab.chance = 1
|
||||
ab.nodenames = {
|
||||
"default:dirt_with_grass", "default:dirt_with_dry_grass",
|
||||
"default:dirt_with_snow", "group:lib_ecology_grass"
|
||||
}
|
||||
ab.action = grass_devoid
|
||||
|
||||
-- find flower spread abm and change to spread function
|
||||
elseif label == "Flower spread"
|
||||
or node1 == "group:flora" then
|
||||
|
||||
--ab.interval = 1
|
||||
--ab.chance = 1
|
||||
ab.nodenames = {"group:flora"}
|
||||
ab.neighbors = {"group:soil"}
|
||||
ab.action = flower_spread
|
||||
|
||||
-- find grow papyrus abm and change to grow_papyrus function
|
||||
elseif label == "Grow papyrus"
|
||||
or node1 == "default:papyrus" then
|
||||
|
||||
--ab.interval = 2
|
||||
--ab.chance = 1
|
||||
ab.nodenames = {"default:papyrus", "lib_ecology:bamboo"}
|
||||
ab.neighbors = {"group:soil"}
|
||||
ab.action = grow_papyrus
|
||||
end
|
||||
end
|
||||
|
||||
-- If Baked Clay mod not active, make Red, Orange and Grey nodes
|
||||
if not minetest.get_modpath("bakedclay") then
|
||||
|
||||
minetest.register_node(":bakedclay:red", {
|
||||
description = S("Red Baked Clay"),
|
||||
tiles = {"baked_clay_red.png"},
|
||||
groups = {cracky = 3},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node(":bakedclay:orange", {
|
||||
description = S("Orange Baked Clay"),
|
||||
tiles = {"baked_clay_orange.png"},
|
||||
groups = {cracky = 3},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node(":bakedclay:grey", {
|
||||
description = S("Grey Baked Clay"),
|
||||
tiles = {"baked_clay_grey.png"},
|
||||
groups = {cracky = 3},
|
||||
is_ground_content = lib_ecology.cavedirt,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
-- Quicksand (old style, sinking inside shows black instead of yellow effect,
|
||||
-- works ok with noclip enabled though)
|
||||
minetest.register_node("lib_ecology:quicksand", {
|
||||
description = S("Quicksand"),
|
||||
tiles = {"default_sand.png"},
|
||||
drop = "default:sand",
|
||||
liquid_viscosity = 15,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "lib_ecology:quicksand",
|
||||
liquid_alternative_source = "lib_ecology:quicksand",
|
||||
liquid_renewable = false,
|
||||
liquid_range = 0,
|
||||
drowning = 1,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
post_effect_color = {r = 230, g = 210, b = 160, a = 245},
|
||||
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
-- Quicksand (new style, sinking inside shows yellow effect with or without noclip,
|
||||
-- but old quicksand is shown as black until block placed nearby to update light)
|
||||
minetest.register_node("lib_ecology:quicksand2", {
|
||||
description = S("Quicksand"),
|
||||
tiles = {"default_sand.png"},
|
||||
drawtype = "glasslike",
|
||||
paramtype = "light",
|
||||
drop = "default:sand",
|
||||
liquid_viscosity = 15,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "lib_ecology:quicksand2",
|
||||
liquid_alternative_source = "lib_ecology:quicksand2",
|
||||
liquid_renewable = false,
|
||||
liquid_range = 0,
|
||||
drowning = 1,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
post_effect_color = {r = 230, g = 210, b = 160, a = 245},
|
||||
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
-- Quicksand (old style, sinking inside shows black instead of yellow effect,
|
||||
-- works ok with noclip enabled though)
|
||||
minetest.register_node(":ethereal:quicksand", {
|
||||
description = S("Quicksand"),
|
||||
tiles = {"default_sand.png"},
|
||||
drop = "default:sand",
|
||||
liquid_viscosity = 15,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = ":ethereal:quicksand",
|
||||
liquid_alternative_source = ":ethereal:quicksand",
|
||||
liquid_renewable = false,
|
||||
liquid_range = 0,
|
||||
drowning = 1,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
post_effect_color = {r = 230, g = 210, b = 160, a = 245},
|
||||
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
-- Quicksand (new style, sinking inside shows yellow effect with or without noclip,
|
||||
-- but old quicksand is shown as black until block placed nearby to update light)
|
||||
minetest.register_node(":ethereal:quicksand2", {
|
||||
description = S("Quicksand"),
|
||||
tiles = {"default_sand.png"},
|
||||
drawtype = "glasslike",
|
||||
paramtype = "light",
|
||||
drop = "default:sand",
|
||||
liquid_viscosity = 15,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = ":ethereal:quicksand2",
|
||||
liquid_alternative_source = ":ethereal:quicksand2",
|
||||
liquid_renewable = false,
|
||||
liquid_range = 0,
|
||||
drowning = 1,
|
||||
walkable = false,
|
||||
climbable = false,
|
||||
post_effect_color = {r = 230, g = 210, b = 160, a = 245},
|
||||
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
-- craft quicksand
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:quicksand2",
|
||||
recipe = {
|
||||
{"group:sand", "group:sand", "group:sand"},
|
||||
{"group:sand", "group:water_bucket", "group:sand"},
|
||||
{"group:sand", "group:sand", "group:sand"},
|
||||
},
|
||||
replacements = {
|
||||
{"group:water_bucket", "bucket:bucket_empty"}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,308 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Bamboo Flooring
|
||||
minetest.register_node("lib_ecology:bamboo_floor", {
|
||||
description = S("Bamboo Floor"),
|
||||
drawtype = 'nodebox',
|
||||
tiles = { "bamboo_floor.png" },
|
||||
wield_image = "bamboo_floor.png",
|
||||
inventory_image = "bamboo_floor.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
node_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
|
||||
wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
|
||||
wall_side = {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
|
||||
},
|
||||
selection_box = {type = "wallmounted"},
|
||||
groups = {snappy = 3, choppy = 3 , flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- Craft Bamboo into Bamboo Flooring
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:bamboo_floor 2",
|
||||
recipe = {
|
||||
{"lib_ecology:bamboo", "lib_ecology:bamboo", "lib_ecology:bamboo"},
|
||||
{"lib_ecology:bamboo", "lib_ecology:bamboo", "lib_ecology:bamboo"},
|
||||
{"lib_ecology:bamboo", "lib_ecology:bamboo", "lib_ecology:bamboo"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Craft Bamboo into Paper
|
||||
minetest.register_craft({
|
||||
output = "default:paper 6",
|
||||
recipe = {
|
||||
{"lib_ecology:bamboo", "lib_ecology:bamboo"},
|
||||
{"lib_ecology:bamboo", "lib_ecology:bamboo"},
|
||||
{"lib_ecology:bamboo", "lib_ecology:bamboo"},
|
||||
}
|
||||
})
|
||||
|
||||
if lib_ecology.xcraft == true then
|
||||
|
||||
-- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b')
|
||||
local cheat = {
|
||||
{"default:cobble", "default:gravel", 5},
|
||||
{"default:gravel", "default:dirt", 5},
|
||||
{"default:dirt", "default:sand", 5},
|
||||
{"default:ice", "default:snow", 20},
|
||||
{"lib_ecology:dry_dirt", "default:desert_sand", 5},
|
||||
}
|
||||
|
||||
for n = 1, #cheat do
|
||||
|
||||
minetest.register_craft({
|
||||
output = cheat[n][2] .. " " .. cheat[n][3],
|
||||
recipe = {
|
||||
{cheat[n][1], "", cheat[n][1]},
|
||||
{"", cheat[n][1], ""},
|
||||
{cheat[n][1], "", cheat[n][1]},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
end -- END if
|
||||
|
||||
-- Paper (2x3 string = 4 paper)
|
||||
minetest.register_craft({
|
||||
output = "default:paper 4",
|
||||
recipe = {
|
||||
{"farming:string", "farming:string"},
|
||||
{"farming:string", "farming:string"},
|
||||
{"farming:string", "farming:string"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Palm Wax
|
||||
minetest.register_craftitem("lib_ecology:palm_wax", {
|
||||
description = S("Palm Wax"),
|
||||
inventory_image = "palm_wax.png",
|
||||
wield_image = "palm_wax.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "lib_ecology:palm_wax",
|
||||
recipe = "lib_ecology:palmleaves"
|
||||
})
|
||||
|
||||
-- Candle from Wax and String/Cotton
|
||||
minetest.register_node("lib_ecology:candle", {
|
||||
description = S("Candle"),
|
||||
drawtype = "plantlike",
|
||||
inventory_image = "candle_static.png",
|
||||
wield_image = "candle_static.png",
|
||||
tiles = {
|
||||
{
|
||||
name = "candle.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w = 32,
|
||||
aspect_h = 32,
|
||||
length = 1.0
|
||||
}
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = 11,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 3, attached_node = 1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:candle 2",
|
||||
recipe = {
|
||||
{"farming:cotton"},
|
||||
{"lib_ecology:palm_wax"},
|
||||
{"lib_ecology:palm_wax"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Wooden Bowl
|
||||
minetest.register_craftitem("lib_ecology:bowl", {
|
||||
description = S("Bowl"),
|
||||
inventory_image = "bowl.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:bowl",
|
||||
recipe = {
|
||||
{"group:wood", "", "group:wood"},
|
||||
{"", "group:wood", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- stone Ladder
|
||||
minetest.register_node("lib_ecology:stone_ladder", {
|
||||
description = S("Stone Ladder"),
|
||||
drawtype = "signlike",
|
||||
tiles = {"stone_ladder.png"},
|
||||
inventory_image = "stone_ladder.png",
|
||||
wield_image = "stone_ladder.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:stone_ladder 4",
|
||||
recipe = {
|
||||
{"group:stone", "", "group:stone"},
|
||||
{"group:stone", "group:stone", "group:stone"},
|
||||
{"group:stone", "", "group:stone"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Paper Wall
|
||||
minetest.register_node("lib_ecology:paper_wall", {
|
||||
drawtype = "nodebox",
|
||||
description = S("Paper Wall"),
|
||||
tiles = {"paper_wall.png"},
|
||||
inventory_image_image = "paper_wall.png",
|
||||
wield_image = "paper_wall.png",
|
||||
paramtype = "light",
|
||||
groups = {snappy = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
walkable = true,
|
||||
is_ground_content = false,
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "facedir",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, 5/11, 0.5, 0.5, 8/16 }
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.5, -0.5, 5/11, 0.5, 0.5, 8/16 }
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:paper_wall",
|
||||
recipe = {
|
||||
{"default:stick", "default:paper", "default:stick"},
|
||||
{"default:stick", "default:paper", "default:stick"},
|
||||
{"default:stick", "default:paper", "default:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Glostone (A little bit of light decoration)
|
||||
minetest.register_node("lib_ecology:glostone", {
|
||||
description = S("Glo Stone"),
|
||||
tiles = {"glostone.png"},
|
||||
groups = {cracky = 3},
|
||||
light_source = 13,
|
||||
drop = "lib_ecology:glostone",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "lib_ecology:glostone",
|
||||
recipe = {"default:torch", "default:stone", "dye:yellow"}
|
||||
})
|
||||
|
||||
-- Charcoal Lump
|
||||
minetest.register_craftitem("lib_ecology:charcoal_lump", {
|
||||
description = S("Lump of Charcoal"),
|
||||
inventory_image = "charcoal_lump.png",
|
||||
wield_image = "charcoal_lump.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:charcoal_lump 2",
|
||||
recipe = {
|
||||
{"lib_ecology:scorched_tree"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:charcoal_lump 2",
|
||||
type = "cooking",
|
||||
recipe = "group:tree",
|
||||
cooktime = 4
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "lib_ecology:charcoal_lump",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
-- Make Torch from Charcoal Lump
|
||||
minetest.register_craft({
|
||||
output = "default:torch 4",
|
||||
recipe = {
|
||||
{"lib_ecology:charcoal_lump"},
|
||||
{"default:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Staff of Light (by Xanthin)
|
||||
minetest.register_tool("lib_ecology:light_staff", {
|
||||
description = S("Staff of Light"),
|
||||
inventory_image = "light_staff.png",
|
||||
wield_image = "light_staff.png",
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
stack_max = 1,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = pointed_thing.under
|
||||
local pname = user:get_player_name()
|
||||
|
||||
if minetest.is_protected(pos, pname) then
|
||||
minetest.record_protection_violation(pos, pname)
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pos).name
|
||||
|
||||
if node == "default:stone"
|
||||
or node == "default:desert_stone" then
|
||||
|
||||
minetest.swap_node(pos, {name = "lib_ecology:glostone"})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535 / 149) -- 150 uses
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:light_staff",
|
||||
recipe = {
|
||||
{"lib_ecology:illumishroom", "default:mese_crystal", "lib_ecology:illumishroom"},
|
||||
{"lib_ecology:illumishroom2", "default:steel_ingot", "lib_ecology:illumishroom2"},
|
||||
{"lib_ecology:illumishroom3", "default:steel_ingot", "lib_ecology:illumishroom3"}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,124 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Raw Fish (Thanks to Altairas for her Fish image on DeviantArt)
|
||||
minetest.register_craftitem("lib_ecology:fish_raw", {
|
||||
description = S("Raw Fish"),
|
||||
inventory_image = "fish_raw.png",
|
||||
wield_image = "fish_raw.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
-- Cooked Fish
|
||||
minetest.register_craftitem("lib_ecology:fish_cooked", {
|
||||
description = S("Cooked Fish"),
|
||||
inventory_image = "fish_cooked.png",
|
||||
wield_image = "fish_cooked.png",
|
||||
on_use = minetest.item_eat(5),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "lib_ecology:fish_cooked",
|
||||
recipe = "lib_ecology:fish_raw",
|
||||
cooktime = 2,
|
||||
})
|
||||
|
||||
-- Sashimi (Thanks to Natalia Grosner for letting me use the sashimi image)
|
||||
minetest.register_craftitem("lib_ecology:sashimi", {
|
||||
description = S("Sashimi"),
|
||||
inventory_image = "sashimi.png",
|
||||
wield_image = "sashimi.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:sashimi 2",
|
||||
recipe = {
|
||||
{'lib_ecology:seaweed','lib_ecology:fish_raw','lib_ecology:seaweed'},
|
||||
}
|
||||
})
|
||||
|
||||
-- Worm
|
||||
minetest.register_craftitem("lib_ecology:worm", {
|
||||
description = S("Worm"),
|
||||
inventory_image = "worm.png",
|
||||
wield_image = "worm.png",
|
||||
})
|
||||
|
||||
-- Fishing Rod
|
||||
minetest.register_craftitem("lib_ecology:fishing_rod", {
|
||||
description = S("Fishing Rod"),
|
||||
inventory_image = "fishing_rod.png",
|
||||
wield_image = "fishing_rod.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:fishing_rod",
|
||||
recipe = {
|
||||
{"","","default:stick"},
|
||||
{"", "default:stick", "farming:string"},
|
||||
{"default:stick", "", "farming:string"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Sift through 2 Dirt Blocks to find Worm
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:worm",
|
||||
recipe = {
|
||||
{"default:dirt","default:dirt"},
|
||||
}
|
||||
})
|
||||
|
||||
-- default lib_ecology fish
|
||||
local fish = {
|
||||
{"lib_ecology:fish_raw"},
|
||||
}
|
||||
|
||||
-- xanadu server additional fish
|
||||
if minetest.get_modpath("xanadu") then
|
||||
fish[2] = {"mobs:clownfish_raw"}
|
||||
fish[3] = {"mobs:bluefish_raw"}
|
||||
end
|
||||
|
||||
-- Fishing Rod (Baited)
|
||||
minetest.register_craftitem("lib_ecology:fishing_rod_baited", {
|
||||
description = S("Baited Fishing Rod"),
|
||||
inventory_image = "fishing_rod_baited.png",
|
||||
wield_image = "fishing_rod_wield.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
|
||||
on_use = function (itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
if (node == "default:water_source"
|
||||
or node == "default:river_water_source")
|
||||
and math.random(1, 100) < 5 then
|
||||
|
||||
local type = fish[math.random(1, #fish)][1]
|
||||
local inv = user:get_inventory()
|
||||
|
||||
if inv:room_for_item("main", {name = type}) then
|
||||
|
||||
inv:add_item("main", {name = type})
|
||||
|
||||
return ItemStack("lib_ecology:fishing_rod")
|
||||
else
|
||||
minetest.chat_send_player(user:get_player_name(),
|
||||
S("Inventory full, Fish Got Away!"))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "lib_ecology:fishing_rod_baited",
|
||||
recipe = {"lib_ecology:fishing_rod", "lib_ecology:worm"},
|
||||
})
|
|
@ -0,0 +1,199 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Banana (Heals one heart when eaten)
|
||||
minetest.register_node("lib_ecology:banana", {
|
||||
description = S("Banana"),
|
||||
drawtype = "torchlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {"banana_single.png"},
|
||||
inventory_image = "banana_single.png",
|
||||
wield_image = "banana_single.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
|
||||
},
|
||||
groups = {
|
||||
fleshy = 3, dig_immediate = 3, flammable = 2,
|
||||
leafdecay = 1, leafdecay_drop = 1
|
||||
},
|
||||
drop = "lib_ecology:banana",
|
||||
on_use = minetest.item_eat(2),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
if placer:is_player() then
|
||||
minetest.set_node(pos, {name = "lib_ecology:banana", param2 = 1})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Banana Dough
|
||||
minetest.register_craftitem("lib_ecology:banana_dough", {
|
||||
description = S("Banana Dough"),
|
||||
inventory_image = "banana_dough.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "lib_ecology:banana_dough",
|
||||
recipe = {"farming:flour", "lib_ecology:banana"}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 14,
|
||||
output = "lib_ecology:banana_bread",
|
||||
recipe = "lib_ecology:banana_dough"
|
||||
})
|
||||
|
||||
-- Orange (Heals 2 hearts when eaten)
|
||||
minetest.register_node("lib_ecology:orange", {
|
||||
description = S("Orange"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {"farming_orange.png"},
|
||||
inventory_image = "farming_orange.png",
|
||||
wield_image = "farming_orange.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
|
||||
},
|
||||
groups = {
|
||||
fleshy = 3, dig_immediate = 3, flammable = 2,
|
||||
leafdecay = 3, leafdecay_drop = 1
|
||||
},
|
||||
drop = "lib_ecology:orange",
|
||||
on_use = minetest.item_eat(4),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
if placer:is_player() then
|
||||
minetest.set_node(pos, {name = "lib_ecology:orange", param2 = 1})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Pine Nuts (Heals 1/2 heart when eaten)
|
||||
minetest.register_craftitem("lib_ecology:pine_nuts", {
|
||||
description = S("Pine Nuts"),
|
||||
inventory_image = "pine_nuts.png",
|
||||
wield_image = "pine_nuts.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
-- Banana Loaf (Heals 3 hearts when eaten)
|
||||
minetest.register_craftitem("lib_ecology:banana_bread", {
|
||||
description = S("Banana Loaf"),
|
||||
inventory_image = "banana_bread.png",
|
||||
wield_image = "banana_bread.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
||||
|
||||
-- Coconut (Gives 4 coconut slices, each heal 1/2 heart)
|
||||
minetest.register_node(":ethereal:coconut", {
|
||||
description = S("Coconut"),
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"moretrees_coconut.png"},
|
||||
inventory_image = "moretrees_coconut.png",
|
||||
wield_image = "moretrees_coconut.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.31, -0.43, -0.31, 0.31, 0.44, 0.31}
|
||||
},
|
||||
groups = {
|
||||
snappy = 1, oddly_breakable_by_hand = 1, cracky = 1,
|
||||
choppy = 1, flammable = 1, leafdecay = 3, leafdecay_drop = 1
|
||||
},
|
||||
drop = "lib_ecology:coconut_slice 4",
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- Coconut Slice (Heals half heart when eaten)
|
||||
minetest.register_craftitem("lib_ecology:coconut_slice", {
|
||||
description = S("Coconut Slice"),
|
||||
inventory_image = "moretrees_coconut_slice.png",
|
||||
wield_image = "moretrees_coconut_slice.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
-- Golden Apple (Found on Healing Tree, heals all 10 hearts)
|
||||
minetest.register_node(":ethereal:golden_apple", {
|
||||
description = S("Golden Apple"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {"default_apple_gold.png"},
|
||||
inventory_image = "default_apple_gold.png",
|
||||
wield_image = "default_apple_gold.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
|
||||
},
|
||||
groups = {
|
||||
fleshy = 3, dig_immediate = 3,
|
||||
leafdecay = 3,leafdecay_drop = 1
|
||||
},
|
||||
drop = ":ethereal:golden_apple",
|
||||
on_use = minetest.item_eat(20),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
if placer:is_player() then
|
||||
minetest.set_node(pos, {name = "lib_ecology:golden_apple", param2 = 1})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Hearty Stew (Heals 5 hearts - thanks to ZonerDarkRevention for his DokuCraft DeviantArt bowl texture)
|
||||
minetest.register_craftitem("lib_ecology:hearty_stew", {
|
||||
description = S("Hearty Stew"),
|
||||
inventory_image = "hearty_stew.png",
|
||||
wield_image = "hearty_stew.png",
|
||||
on_use = minetest.item_eat(10, "lib_ecology:bowl"),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:hearty_stew",
|
||||
recipe = {
|
||||
{"lib_ecology:wild_onion_plant","lib_ecology:mushroom_plant", "lib_ecology:fern_tubers"},
|
||||
{"","lib_ecology:mushroom_plant", ""},
|
||||
{"","lib_ecology:bowl", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- Extra recipe for hearty stew
|
||||
if farming and farming.mod and farming.mod == "redo" then
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:hearty_stew",
|
||||
recipe = {
|
||||
{"lib_ecology:wild_onion_plant","lib_ecology:mushroom_plant", "farming:beans"},
|
||||
{"","lib_ecology:mushroom_plant", ""},
|
||||
{"","lib_ecology:bowl", ""},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Bucket of Cactus Pulp
|
||||
minetest.register_craftitem("lib_ecology:bucket_cactus", {
|
||||
description = S("Bucket of Cactus Pulp"),
|
||||
inventory_image = "bucket_cactus.png",
|
||||
wield_image = "bucket_cactus.png",
|
||||
stack_max = 1,
|
||||
on_use = minetest.item_eat(2, "bucket:bucket_empty"),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:bucket_cactus",
|
||||
recipe = {
|
||||
{"bucket:bucket_empty","default:cactus"},
|
||||
}
|
||||
})
|
|
@ -0,0 +1,364 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- set leaftype (value inside init.lua)
|
||||
local leaftype = "plantlike"
|
||||
|
||||
if lib_ecology.leaftype ~= 0 then
|
||||
leaftype = "allfaces_optional"
|
||||
end
|
||||
|
||||
-- default apple tree leaves
|
||||
minetest.override_item("default:leaves", {
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
inventory_image = "default_leaves.png",
|
||||
wield_image = "default_leaves.png",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
})
|
||||
|
||||
-- default jungle tree leaves
|
||||
minetest.override_item("default:jungleleaves", {
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
inventory_image = "default_jungleleaves.png",
|
||||
wield_image = "default_jungleleaves.png",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
})
|
||||
|
||||
-- default pine tree leaves
|
||||
minetest.override_item("default:pine_needles", {
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
inventory_image = "default_pine_needles.png",
|
||||
wield_image = "default_pine_needles.png",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"default:pine_sapling"}, rarity = 20},
|
||||
{items = {"lib_ecology:pine_nuts"}, rarity = 5},
|
||||
{items = {"default:pine_needles"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- default acacia tree leaves
|
||||
minetest.override_item("default:acacia_leaves", {
|
||||
drawtype = leaftype,
|
||||
-- tiles = {"moretrees_acacia_leaves.png"},
|
||||
inventory_image = "default_acacia_leaves.png",
|
||||
wield_image = "default_acacia_leaves.png",
|
||||
visual_scale = 1.2,
|
||||
walkable = lib_ecology.leafwalk,
|
||||
})
|
||||
|
||||
-- default aspen tree leaves
|
||||
minetest.override_item("default:aspen_leaves", {
|
||||
drawtype = leaftype,
|
||||
inventory_image = "default_aspen_leaves.png",
|
||||
wield_image = "default_aspen_leaves.png",
|
||||
visual_scale = 1.2,
|
||||
walkable = lib_ecology.leafwalk,
|
||||
})
|
||||
|
||||
-- willow twig
|
||||
minetest.register_node(":ethereal:willow_twig", {
|
||||
description = S("Willow Twig"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"willow_twig.png"},
|
||||
inventory_image = "willow_twig.png",
|
||||
wield_image = "willow_twig.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
visual_scale = 1.2,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:willow_sapling"}, rarity = 50},
|
||||
{items = {"lib_ecology:willow_twig"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- redwood leaves
|
||||
minetest.register_node(":ethereal:redwood_leaves", {
|
||||
description = S("Redwood Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"redwood_leaves.png"},
|
||||
inventory_image = "redwood_leaves.png",
|
||||
wield_image = "redwood_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:redwood_sapling"}, rarity = 50},
|
||||
{items = {"lib_ecology:redwood_leaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- orange tree leaves
|
||||
minetest.register_node("lib_ecology:orange_leaves", {
|
||||
description = S("Orange Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"orange_leaves.png"},
|
||||
inventory_image = "orange_leaves.png",
|
||||
wield_image = "orange_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:orange_tree_sapling"}, rarity = 15},
|
||||
{items = {"lib_ecology:orange_leaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- banana tree leaves
|
||||
minetest.register_node("lib_ecology:bananaleaves", {
|
||||
description = S("Banana Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"banana_leaf.png"},
|
||||
inventory_image = "banana_leaf.png",
|
||||
wield_image = "banana_leaf.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:banana_tree_sapling"}, rarity = 10},
|
||||
{items = {"lib_ecology:bananaleaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- healing tree leaves
|
||||
minetest.register_node(":ethereal:yellowleaves", {
|
||||
description = S("Healing Tree Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"yellow_leaves.png"},
|
||||
inventory_image = "yellow_leaves.png",
|
||||
wield_image = "yellow_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:yellow_tree_sapling"}, rarity = 50},
|
||||
{items = {"lib_ecology:yellowleaves"}}
|
||||
}
|
||||
},
|
||||
-- one leaf heals half a heart when eaten
|
||||
on_use = minetest.item_eat(1),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
light_source = 9,
|
||||
})
|
||||
|
||||
-- palm tree leaves
|
||||
minetest.register_node(":ethereal:palmleaves", {
|
||||
description = S("Palm Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"moretrees_palm_leaves.png"},
|
||||
inventory_image = "moretrees_palm_leaves.png",
|
||||
wield_image = "moretrees_palm_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:palm_sapling"}, rarity = 10},
|
||||
{items = {"lib_ecology:palmleaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- birch tree leaves
|
||||
minetest.register_node("lib_ecology:birch_leaves", {
|
||||
description = S("Birch Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"moretrees_birch_leaves.png"},
|
||||
inventory_image = "moretrees_birch_leaves.png",
|
||||
wield_image = "moretrees_birch_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:birch_sapling"}, rarity = 20},
|
||||
{items = {"lib_ecology:birch_leaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- frost tree leaves
|
||||
minetest.register_node(":ethereal:frost_leaves", {
|
||||
description = S("Frost Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"ethereal_frost_leaves.png"},
|
||||
inventory_image = "ethereal_frost_leaves.png",
|
||||
wield_image = "ethereal_frost_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, puts_out_fire = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:frost_tree_sapling"}, rarity = 15},
|
||||
{items = {"lib_ecology:frost_leaves"}}
|
||||
}
|
||||
},
|
||||
light_source = 9,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- bamboo stalk leaves
|
||||
minetest.register_node("lib_ecology:bamboo_leaves", {
|
||||
description = S("Bamboo Leaves"),
|
||||
drawtype = leaftype,
|
||||
visual_scale = 1.2,
|
||||
tiles = {"bamboo_leaves.png"},
|
||||
inventory_image = "bamboo_leaves.png",
|
||||
wield_image = "bamboo_leaves.png",
|
||||
paramtype = "light",
|
||||
walkable = lib_ecology.leafwalk,
|
||||
waving = 1,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:bamboo_sprout"}, rarity = 10},
|
||||
{items = {"lib_ecology:bamboo_leaves"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
-- mushroom tops
|
||||
minetest.register_node(":ethereal:mushroom", {
|
||||
description = S("Mushroom Cap"),
|
||||
tiles = {"mushroom_block.png"},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:mushroom_sapling"}, rarity = 20},
|
||||
{items = {"lib_ecology:mushroom"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "lib_ecology:mushroom",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
-- mushroom pore (spongelike material found inside giant shrooms)
|
||||
minetest.register_node(":ethereal:mushroom_pore", {
|
||||
description = S("Mushroom Pore"),
|
||||
tiles = {"mushroom_pore.png"},
|
||||
groups = {
|
||||
snappy = 3, cracky = 3, choppy = 3, oddly_breakable_by_hand = 3,
|
||||
flammable = 2, disable_jump = 1, fall_damage_add_percent = -100
|
||||
},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
-- hedge block
|
||||
minetest.register_node("lib_ecology:bush", {
|
||||
description = S("Bush"),
|
||||
tiles = {"ethereal_bush.png"},
|
||||
walkable = true,
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:bush",
|
||||
recipe = {
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
{"group:leaves", "lib_ecology:bamboo_leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
}
|
||||
})
|
||||
|
||||
-- bush block #2
|
||||
minetest.register_node("lib_ecology:bush2", {
|
||||
drawtype = "allfaces_optional",
|
||||
description = S("Bush #2"),
|
||||
tiles = {"default_aspen_leaves.png"},
|
||||
paramtype = "light",
|
||||
walkable = true,
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:bush2",
|
||||
recipe = {
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
{"group:leaves", "default:aspen_leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
}
|
||||
})
|
||||
|
||||
-- bush block #3
|
||||
minetest.register_node("lib_ecology:bush3", {
|
||||
drawtype = "allfaces_optional",
|
||||
description = S("Bush #3"),
|
||||
tiles = {"default_pine_needles.png"},
|
||||
paramtype = "light",
|
||||
walkable = true,
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:bush3",
|
||||
recipe = {
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
{"group:leaves", "default:pine_needles", "group:leaves"},
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
}
|
||||
})
|
|
@ -0,0 +1,666 @@
|
|||
|
||||
-- clear default mapgen biomes, decorations and ores
|
||||
--minetest.clear_registered_biomes()
|
||||
--minetest.clear_registered_decorations()
|
||||
--minetest.clear_registered_ores()
|
||||
|
||||
--local path = minetest.get_modpath("ethereal")
|
||||
|
||||
--dofile(path .. "/ores.lua")
|
||||
|
||||
--spath = lib_ecology.path .. "/schematics"
|
||||
|
||||
local dpath = minetest.get_modpath("default") .. "/schematics/"
|
||||
|
||||
-- tree schematics
|
||||
dofile(lib_ecology.path .. "/schematics/orange_tree.lua")
|
||||
dofile(lib_ecology.path .. "/schematics/banana_tree.lua")
|
||||
dofile(lib_ecology.path .. "/schematics/bamboo_tree.lua")
|
||||
dofile(lib_ecology.path .. "/schematics/birch_tree.lua")
|
||||
dofile(lib_ecology.path .. "/schematics/bush.lua")
|
||||
dofile(lib_ecology.path .. "/schematics/waterlily.lua")
|
||||
|
||||
--= Biomes (Minetest 0.4.13 and above)
|
||||
|
||||
local add_biome = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
|
||||
|
||||
if p ~= 1 then return end
|
||||
|
||||
minetest.register_biome({
|
||||
name = a,
|
||||
node_dust = b,
|
||||
node_top = c,
|
||||
depth_top = d,
|
||||
node_filler = e,
|
||||
depth_filler = f,
|
||||
node_stone = g,
|
||||
node_water_top = h,
|
||||
depth_water_top = i,
|
||||
node_water = j,
|
||||
node_river_water = k,
|
||||
y_min = l,
|
||||
y_max = m,
|
||||
heat_point = n,
|
||||
humidity_point = o,
|
||||
})
|
||||
end
|
||||
|
||||
add_biome("underground", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
||||
-31000, -192, 50, 50, 1)
|
||||
|
||||
add_biome("mountain", nil, "default:snow", 1, "default:snowblock", 2,
|
||||
nil, nil, nil, nil, nil, 140, 31000, 50, 50, 1)
|
||||
|
||||
add_biome("desert", nil, "default:desert_sand", 1, "default:desert_sand", 3,
|
||||
"default:desert_stone", nil, nil, nil, nil, 3, 23, 35, 20, lib_ecology.desert)
|
||||
|
||||
add_biome("desert_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
"default:desert_stone", nil, nil, nil, nil, -192, 3, 35, 20, lib_ecology.desert)
|
||||
|
||||
if lib_ecology.glacier == 1 then
|
||||
minetest.register_biome({
|
||||
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 = "",
|
||||
node_river_water = "default:ice",
|
||||
node_riverbed = "default:gravel",
|
||||
depth_riverbed = 2,
|
||||
y_min = -8,
|
||||
y_max = 31000,
|
||||
heat_point = 0,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "glacier_ocean",
|
||||
node_dust = "default:snowblock",
|
||||
node_top = "default:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "default:sand",
|
||||
depth_filler = 3,
|
||||
--node_stone = "",
|
||||
--node_water_top = "",
|
||||
--depth_water_top = ,
|
||||
--node_water = "",
|
||||
--node_river_water = "",
|
||||
y_min = -112,
|
||||
y_max = -9,
|
||||
heat_point = 0,
|
||||
humidity_point = 50,
|
||||
})
|
||||
end
|
||||
|
||||
add_biome("clearing", nil, "lib_ecology:green_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 71, 45, 65, 1) -- ADDED
|
||||
|
||||
add_biome("bamboo", nil, "lib_ecology:bamboo_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 71, 45, 75, lib_ecology.bamboo)
|
||||
|
||||
add_biome("bamboo_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 2, 45, 75, lib_ecology.bamboo)
|
||||
|
||||
add_biome("mesa", nil, "bakedclay:orange", 1, "bakedclay:orange", 15,
|
||||
nil, nil, nil, nil, nil, 1, 71, 25, 28, lib_ecology.mesa)
|
||||
|
||||
add_biome("mesa_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 25, 28, lib_ecology.mesa)
|
||||
|
||||
add_biome("alpine", nil, "default:dirt_with_snow", 1, "default:dirt", 2,
|
||||
nil, nil, nil, nil, nil, 40, 140, 10, 40, lib_ecology.alpine)
|
||||
|
||||
add_biome("snowy", nil, "lib_ecology:cold_dirt", 1, "default:dirt", 2,
|
||||
nil, nil, nil, nil, nil, 4, 40, 10, 40, lib_ecology.snowy)
|
||||
|
||||
add_biome("frost", nil, "lib_ecology:crystal_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 1, 71, 10, 40, lib_ecology.frost)
|
||||
|
||||
add_biome("frost_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 10, 40, lib_ecology.frost)
|
||||
|
||||
add_biome("grassy", nil, "lib_ecology:green_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 91, 13, 40, lib_ecology.grassy)
|
||||
|
||||
add_biome("grassy_ocean", nil, "defaut:sand", 2, "default:gravel", 1,
|
||||
nil, nil, nil, nil, nil, -31000, 3, 13, 40, lib_ecology.grassy)
|
||||
|
||||
add_biome("caves", nil, "default:desert_stone", 3, "lib_ecology:red_clay", 8,
|
||||
nil, nil, nil, nil, nil, 4, 41, 15, 25, lib_ecology.caves)
|
||||
|
||||
add_biome("grayness", nil, "lib_ecology:gray_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 2, 41, 15, 30, lib_ecology.grayness)
|
||||
|
||||
add_biome("grayness_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 15, 30, lib_ecology.grayness)
|
||||
|
||||
add_biome("grassytwo", nil, "lib_ecology:green_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 1, 91, 15, 40, lib_ecology.grassytwo)
|
||||
|
||||
add_biome("grassytwo_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 15, 40, lib_ecology.grassytwo)
|
||||
|
||||
add_biome("prairie", nil, "lib_ecology:prairie_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 26, 20, 40, lib_ecology.prairie)
|
||||
|
||||
add_biome("prairie_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 20, 40, lib_ecology.prairie)
|
||||
|
||||
add_biome("jumble", nil, "lib_ecology:green_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 1, 71, 25, 50, lib_ecology.jumble)
|
||||
|
||||
add_biome("jumble_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 25, 50, lib_ecology.jumble)
|
||||
|
||||
add_biome("junglee", nil, "lib_ecology:jungle_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 1, 71, 30, 60, lib_ecology.junglee)
|
||||
|
||||
add_biome("junglee_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 30, 60, lib_ecology.junglee)
|
||||
|
||||
add_biome("grove", nil, "lib_ecology:grove_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 23, 45, 35, lib_ecology.grove)
|
||||
|
||||
add_biome("grove_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 2, 45, 35, lib_ecology.grove)
|
||||
|
||||
add_biome("mushroom", nil, "lib_ecology:mushroom_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 50, 45, 55, lib_ecology.mushroom)
|
||||
|
||||
add_biome("mushroom_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 2, 45, 55, lib_ecology.mushroom)
|
||||
|
||||
add_biome("sandstone", nil, "default:sandstone", 1, "default:sandstone", 1,
|
||||
"default:sandstone", nil, nil, nil, nil, 3, 23, 50, 20, lib_ecology.sandstone)
|
||||
|
||||
add_biome("sandstone_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 2, 50, 20, lib_ecology.sandstone)
|
||||
|
||||
add_biome("quicksand", nil, "lib_ecology:quicksand2", 3, "default:gravel", 1,
|
||||
nil, nil, nil, nil, nil, 1, 1, 50, 38, lib_ecology.quicksand)
|
||||
|
||||
add_biome("plains", nil, "lib_ecology:dry_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 25, 65, 25, lib_ecology.plains)
|
||||
|
||||
add_biome("plains_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 2, 55, 25, lib_ecology.plains)
|
||||
|
||||
add_biome("savannah", nil, "default:dirt_with_dry_grass", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 3, 50, 55, 25, lib_ecology.savannah)
|
||||
|
||||
add_biome("savannah_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 55, 25, lib_ecology.savannah)
|
||||
|
||||
add_biome("fiery", nil, ":ethereal:fiery_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 5, 20, 75, 10, lib_ecology.fiery)
|
||||
|
||||
add_biome("fiery_ocean", nil, "default:sand", 1, "default:sand", 2,
|
||||
nil, nil, nil, nil, nil, -192, 4, 75, 10, lib_ecology.fiery)
|
||||
|
||||
add_biome("sandclay", nil, "default:sand", 3, "default:clay", 2,
|
||||
nil, nil, nil, nil, nil, 1, 11, 65, 2, lib_ecology.sandclay)
|
||||
|
||||
add_biome("swamp", nil, "lib_ecology:green_dirt", 1, "default:dirt", 3,
|
||||
nil, nil, nil, nil, nil, 1, 7, 80, 90, lib_ecology.swamp)
|
||||
|
||||
add_biome("swamp_ocean", nil, "default:sand", 2, "default:clay", 2,
|
||||
nil, nil, nil, nil, nil, -192, 1, 80, 90, lib_ecology.swamp)
|
||||
|
||||
--= schematic decorations
|
||||
|
||||
local add_schem = function(a, b, c, d, e, f, g)
|
||||
|
||||
if g ~= 1 then return end
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = a,
|
||||
sidelen = 80,
|
||||
fill_ratio = b,
|
||||
biomes = c,
|
||||
y_min = d,
|
||||
y_max = e,
|
||||
schematic = f,
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
end
|
||||
|
||||
-- redwood tree
|
||||
add_schem({"bakedclay:orange"}, 0.0025, {"mesa"}, 1, 100, lib_ecology.path .. "/schematics/redwood.mts", lib_ecology.mesa)
|
||||
|
||||
-- banana tree
|
||||
add_schem({"lib_ecology:grove_dirt"}, 0.015, {"grove"}, 1, 100, lib_ecology.bananatree, lib_ecology.grove)
|
||||
|
||||
-- healing tree
|
||||
add_schem({"default:dirt_with_snow"}, 0.01, {"alpine"}, 120, 140, lib_ecology.path .. "/schematics/yellowtree.mts", lib_ecology.alpine)
|
||||
|
||||
-- crystal frost tree
|
||||
add_schem({"lib_ecology:crystal_dirt"}, 0.01, {"frost"}, 1, 100, lib_ecology.path .. "/schematics/frosttrees.mts", lib_ecology.frost)
|
||||
|
||||
-- giant mushroom
|
||||
add_schem({"lib_ecology:mushroom_dirt"}, 0.02, {"mushroom"}, 1, 100, lib_ecology.path .. "/schematics/mushroomone.mts", lib_ecology.mushroom)
|
||||
|
||||
-- -- -- small cinder cone
|
||||
-- -- add_schem({"lib_ecology:fiery_dirt"}, 0.01, {"fiery"}, 1, 100, lib_ecology.path .. "/schematics/volcanom.mts", lib_ecology.fiery)
|
||||
|
||||
-- -- -- large lava crater
|
||||
-- -- add_schem({"lib_ecology:fiery_dirt"}, 0.01, {"fiery"}, 1, 100, lib_ecology.path .. "/schematics/volcanol.mts", lib_ecology.fiery)
|
||||
|
||||
-- small lava crater
|
||||
add_schem({":ethereal:fiery_dirt"}, 0.01, {"fiery"}, 1, 100, lib_ecology.path .. "/schematics/volcanom.mts", lib_ecology.fiery)
|
||||
|
||||
-- large lava crater
|
||||
add_schem({":ethereal:fiery_dirt"}, 0.01, {"fiery"}, 1, 100, lib_ecology.path .. "/schematics/volcanol.mts", lib_ecology.fiery)
|
||||
|
||||
-- default jungle tree
|
||||
add_schem({"lib_ecology:jungle_dirt"}, 0.08, {"junglee"}, 1, 100, lib_ecology.path .. "/schematics/jungle_tree.mts", lib_ecology.junglee)
|
||||
|
||||
-- willow tree
|
||||
add_schem({"lib_ecology:gray_dirt"}, 0.02, {"grayness"}, 1, 100, lib_ecology.path .. "/schematics/willow.mts", lib_ecology.grayness)
|
||||
|
||||
-- pine tree (default for lower elevation and lib_ecology for higher)
|
||||
add_schem({"lib_ecology:cold_dirt"}, 0.025, {"snowy"}, 10, 40, lib_ecology.path .. "/schematics/pine_tree.mts", lib_ecology.snowy)
|
||||
add_schem({"default:dirt_with_snow"}, 0.025, {"alpine"}, 40, 140, lib_ecology.path .. "/schematics/pinetree.mts", lib_ecology.alpine)
|
||||
|
||||
-- default apple tree
|
||||
add_schem({"lib_ecology:green_dirt"}, 0.02, {"jumble"}, 1, 100, lib_ecology.path .. "/schematics/apple_tree.mts", lib_ecology.grassy)
|
||||
add_schem({"lib_ecology:green_dirt"}, 0.03, {"grassy"}, 1, 100, lib_ecology.path .. "/schematics/apple_tree.mts", lib_ecology.grassy)
|
||||
|
||||
-- big old tree
|
||||
add_schem({"lib_ecology:green_dirt"}, 0.001, {"jumble"}, 1, 100, lib_ecology.path .. "/schematics/bigtree.mts", lib_ecology.jumble)
|
||||
|
||||
-- aspen tree
|
||||
add_schem({"lib_ecology:green_dirt"}, 0.02, {"grassytwo"}, 1, 50, lib_ecology.path .. "/schematics/aspen_tree.mts", lib_ecology.jumble)
|
||||
|
||||
-- birch tree
|
||||
add_schem({"lib_ecology:green_dirt"}, 0.02, {"grassytwo"}, 50, 100, lib_ecology.birchtree, lib_ecology.grassytwo)
|
||||
|
||||
-- orange tree
|
||||
add_schem({"lib_ecology:prairie_dirt"}, 0.01, {"prairie"}, 1, 100, lib_ecology.orangetree, lib_ecology.prairie)
|
||||
|
||||
-- default acacia tree
|
||||
add_schem({"default:dirt_with_dry_grass"}, 0.004, {"savannah"}, 1, 100, lib_ecology.path .. "/schematics/acacia_tree.mts", lib_ecology.savannah)
|
||||
|
||||
-- large cactus (by Paramat)
|
||||
if lib_ecology.desert == 1 then
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:desert_sand"},
|
||||
sidelen = 80,
|
||||
noise_params = {
|
||||
offset = -0.0005,
|
||||
scale = 0.0015,
|
||||
spread = {x = 200, y = 200, z = 200},
|
||||
seed = 230,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
biomes = {"desert"},
|
||||
y_min = 5,
|
||||
y_max = 31000,
|
||||
schematic = dpath.."large_cactus.mts",
|
||||
flags = "place_center_x", --, place_center_z",
|
||||
rotation = "random",
|
||||
})
|
||||
end
|
||||
|
||||
-- palm tree
|
||||
add_schem({"default:sand"}, 0.0025, {"desert_ocean"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.desert)
|
||||
add_schem({"default:sand"}, 0.0025, {"plains_ocean"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.plains)
|
||||
add_schem({"default:sand"}, 0.0025, {"sandclay"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.sandclay)
|
||||
add_schem({"default:sand"}, 0.0025, {"sandstone_ocean"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.sandstone)
|
||||
add_schem({"default:sand"}, 0.0025, {"mesa_ocean"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.mesa)
|
||||
add_schem({"default:sand"}, 0.0025, {"grove_ocean"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.grove)
|
||||
add_schem({"default:sand"}, 0.0025, {"grassy_ocean"}, 1, 1, lib_ecology.path .. "/schematics/palmtree.mts", lib_ecology.grassy)
|
||||
|
||||
-- bamboo tree
|
||||
add_schem({"lib_ecology:bamboo_dirt"}, 0.025, {"bamboo"}, 1, 100, lib_ecology.bambootree, lib_ecology.bamboo)
|
||||
|
||||
-- bush
|
||||
add_schem({"lib_ecology:bamboo_dirt"}, 0.08, {"bamboo"}, 1, 100, lib_ecology.bush, lib_ecology.bamboo)
|
||||
|
||||
-- vine tree
|
||||
add_schem({"lib_ecology:green_dirt"}, 0.02, {"swamp"}, 1, 100, lib_ecology.path .. "/schematics/vinetree.mts", lib_ecology.swamp)
|
||||
|
||||
--= simple decorations
|
||||
|
||||
local add_node = function(a, b, c, d, e, f, g, h, i, j)
|
||||
|
||||
if j ~= 1 then return end
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = a,
|
||||
sidelen = 80,
|
||||
fill_ratio = b,
|
||||
biomes = c,
|
||||
y_min = d,
|
||||
y_max = e,
|
||||
decoration = f,
|
||||
height_max = g,
|
||||
spawn_by = h,
|
||||
num_spawn_by = i,
|
||||
})
|
||||
end
|
||||
|
||||
-- scorched tree
|
||||
add_node({"lib_ecology:dry_dirt"}, 0.006, {"plains"}, 1, 100, {"lib_ecology:scorched_tree"}, 6, nil, nil, lib_ecology.plains)
|
||||
|
||||
-- dry shrub
|
||||
add_node({"lib_ecology:dry_dirt"}, 0.015, {"plains"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, lib_ecology.plains)
|
||||
add_node({"default:sand"}, 0.015, {"grassy_ocean"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, lib_ecology.grassy)
|
||||
add_node({"default:desert_sand"}, 0.015, {"desert"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, lib_ecology.desert)
|
||||
add_node({"default:sandstone"}, 0.015, {"sandstone"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, lib_ecology.sandstone)
|
||||
add_node({"bakedclay:red", "bakedclay:orange"}, 0.015, {"mesa"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, lib_ecology.mesa)
|
||||
|
||||
-- dry grass
|
||||
add_node({"default:dirt_with_dry_grass"}, 0.25, {"savannah"}, 1, 100, {"default:dry_grass_2",
|
||||
"default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"}, nil, nil, nil, lib_ecology.savannah)
|
||||
|
||||
-- flowers & strawberry
|
||||
add_node({"lib_ecology:green_dirt"}, 0.025, {"grassy"}, 1, 100, {"flowers:dandelion_white",
|
||||
"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
|
||||
"flowers:viola", "lib_ecology:strawberry_7"}, nil, nil, nil, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.025, {"grassytwo"}, 1, 100, {"flowers:dandelion_white",
|
||||
"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
|
||||
"flowers:viola", "lib_ecology:strawberry_7"}, nil, nil, nil, lib_ecology.grassytwo)
|
||||
|
||||
-- prairie flowers & strawberry
|
||||
add_node({"lib_ecology:prairie_dirt"}, 0.035, {"prairie"}, 1, 100, {"flowers:dandelion_white",
|
||||
"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
|
||||
"flowers:viola", "lib_ecology:strawberry_7"}, nil, nil, nil, lib_ecology.prairie)
|
||||
|
||||
-- crystal spike & crystal grass
|
||||
add_node({"lib_ecology:crystal_dirt"}, 0.02, {"frost"}, 1, 100, {"lib_ecology:crystal_spike",
|
||||
"lib_ecology:crystalgrass"}, nil, nil, nil, lib_ecology.frost)
|
||||
|
||||
-- red shrub
|
||||
add_node({"lib_ecology:fiery_dirt"}, 0.10, {"fiery"}, 1, 100, {"lib_ecology:dry_shrub"}, nil, nil, nil, lib_ecology.fiery)
|
||||
|
||||
-- fire flower
|
||||
--add_node({"lib_ecology:fiery_dirt"}, 0.02, {"fiery"}, 1, 100, {"lib_ecology:fire_flower"}, nil, nil, nil, lib_ecology.fiery)
|
||||
|
||||
-- snowy grass
|
||||
add_node({"lib_ecology:gray_dirt"}, 0.05, {"grayness"}, 1, 100, {"lib_ecology:snowygrass"}, nil, nil, nil, lib_ecology.grayness)
|
||||
add_node({"lib_ecology:cold_dirt"}, 0.05, {"snowy"}, 1, 100, {"lib_ecology:snowygrass"}, nil, nil, nil, lib_ecology.snowy)
|
||||
|
||||
-- cactus
|
||||
add_node({"default:sandstone"}, 0.0025, {"sandstone"}, 1, 100, {"default:cactus"}, 3, nil, nil, lib_ecology.sandstone)
|
||||
add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100, {"default:cactus"}, 4, nil, nil, lib_ecology.desert)
|
||||
|
||||
-- wild red mushroom
|
||||
add_node({"lib_ecology:mushroom_dirt"}, 0.01, {"mushroom"}, 1, 100, {"flowers:mushroom_fertile_red"}, nil, nil, nil, lib_ecology.mushroom)
|
||||
|
||||
local list = {
|
||||
{"junglee", "lib_ecology:jungle_dirt", lib_ecology.junglee},
|
||||
{"grassy", "lib_ecology:green_dirt", lib_ecology.grassy},
|
||||
{"grassytwo", "lib_ecology:green_dirt", lib_ecology.grassytwo},
|
||||
{"prairie", "lib_ecology:prairie_dirt", lib_ecology.prairie},
|
||||
{"mushroom", "lib_ecology:mushroom_dirt", lib_ecology.mushroom},
|
||||
{"swamp", "lib_ecology:green_dirt", lib_ecology.swamp},
|
||||
}
|
||||
|
||||
-- wild red and brown mushrooms
|
||||
for _, row in pairs(list) do
|
||||
|
||||
if row[3] == 1 then
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {row[2]},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.009,
|
||||
spread = {x = 200, y = 200, z = 200},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
persist = 0.66
|
||||
},
|
||||
biomes = {row[1]},
|
||||
y_min = 1,
|
||||
y_max = 120,
|
||||
decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"},
|
||||
})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- jungle grass
|
||||
add_node({"lib_ecology:jungle_dirt"}, 0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, lib_ecology.junglee)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.15, {"jumble"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, lib_ecology.jumble)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.25, {"swamp"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, lib_ecology.swamp)
|
||||
|
||||
-- grass
|
||||
add_node({"lib_ecology:green_dirt"}, 0.35, {"grassy"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.35, {"grassytwo"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.grassytwo)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.35, {"jumble"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.jumble)
|
||||
add_node({"lib_ecology:jungle_dirt"}, 0.35, {"junglee"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.junglee)
|
||||
add_node({"lib_ecology:prairie_dirt"}, 0.35, {"prairie"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.prairie)
|
||||
add_node({"lib_ecology:grove_dirt"}, 0.35, {"grove"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.grove)
|
||||
add_node({"lib_ecology:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 100, {"default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5"}, nil, nil, nil, lib_ecology.bamboo)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.35, {"clearing", "swamp"}, 1, 100, {"default:grass_3",
|
||||
"default:grass_4"}, nil, nil, nil, 1)
|
||||
|
||||
-- grass on sand
|
||||
add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:grass_2", "default:grass_3"}, nil, nil, nil, lib_ecology.sandclay)
|
||||
|
||||
-- ferns
|
||||
add_node({"lib_ecology:grove_dirt"}, 0.2, {"grove"}, 1, 100, {"lib_ecology:fern"}, nil, nil, nil, lib_ecology.grove)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.1, {"swamp"}, 1, 100, {"lib_ecology:fern"}, nil, nil, nil, lib_ecology.swamp)
|
||||
|
||||
-- snow
|
||||
add_node({"lib_ecology:cold_dirt"}, 0.8, {"snowy"}, 4, 40, {"default:snow"}, nil, nil, nil, lib_ecology.snowy)
|
||||
add_node({"default:dirt_with_snow"}, 0.8, {"alpine"}, 40, 140, {"default:snow"}, nil, nil, nil, lib_ecology.alpine)
|
||||
|
||||
-- wild onion
|
||||
add_node({"lib_ecology:green_dirt"}, 0.25, {"grassy"}, 1, 100, {"lib_ecology:onion_4"}, nil, nil, nil, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.25, {"grassytwo"}, 1, 100, {"lib_ecology:onion_4"}, nil, nil, nil, lib_ecology.grassytwo)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.25, {"jumble"}, 1, 100, {"lib_ecology:onion_4"}, nil, nil, nil, lib_ecology.jumble)
|
||||
add_node({"lib_ecology:prairie_dirt"}, 0.25, {"prairie"}, 1, 100, {"lib_ecology:onion_4"}, nil, nil, nil, lib_ecology.prairie)
|
||||
|
||||
-- papyrus
|
||||
add_node({"lib_ecology:green_dirt"}, 0.1, {"grassy"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:jungle_dirt"}, 0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, lib_ecology.junglee)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.1, {"swamp"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, lib_ecology.swamp)
|
||||
|
||||
--= Farming Redo plants
|
||||
|
||||
if farming and farming.mod and farming.mod == "redo" then
|
||||
|
||||
print ("[MOD] lib_ecology - Farming Redo detected and in use")
|
||||
|
||||
-- potato
|
||||
add_node({"lib_ecology:jungle_dirt"}, 0.035, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil, lib_ecology.junglee)
|
||||
|
||||
-- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb
|
||||
add_node({"lib_ecology:green_dirt"}, 0.05, {"grassytwo"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
|
||||
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
|
||||
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, lib_ecology.grassytwo)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.05, {"grassy"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
|
||||
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
|
||||
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.05, {"jumble"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
|
||||
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
|
||||
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, lib_ecology.jumble)
|
||||
add_node({"lib_ecology:prairie_dirt"}, 0.05, {"prairie"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
|
||||
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
|
||||
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, lib_ecology.prairie)
|
||||
|
||||
-- melon and pumpkin
|
||||
add_node({"lib_ecology:jungle_dirt"}, 0.015, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, lib_ecology.junglee)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.015, {"grassy"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.015, {"grassytwo"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, lib_ecology.grassytwo)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.015, {"jumble"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, lib_ecology.jumble)
|
||||
|
||||
-- green beans
|
||||
add_node({"lib_ecology:green_dirt"}, 0.035, {"grassytwo"}, 1, 100, {"farming:beanbush"}, nil, nil, nil, lib_ecology.grassytwo)
|
||||
|
||||
-- grape bushel
|
||||
add_node({"lib_ecology:green_dirt"}, 0.025, {"grassytwo"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, lib_ecology.grassytwo)
|
||||
add_node({"lib_ecology:green_dirt"}, 0.025, {"grassy"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, lib_ecology.grassy)
|
||||
add_node({"lib_ecology:prairie_dirt"}, 0.025, {"prairie"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, lib_ecology.prairie)
|
||||
|
||||
end
|
||||
|
||||
-- place waterlily in beach areas
|
||||
local list = {
|
||||
{"desert_ocean", lib_ecology.desert},
|
||||
{"plains_ocean", lib_ecology.plains},
|
||||
{"sandclay", lib_ecology.sandclay},
|
||||
{"sandstone_ocean", lib_ecology.sandstone},
|
||||
{"mesa_ocean", lib_ecology.mesa},
|
||||
{"grove_ocean", lib_ecology.grove},
|
||||
{"grassy_ocean", lib_ecology.grassy},
|
||||
{"swamp_ocean", lib_ecology.swamp},
|
||||
}
|
||||
|
||||
for _, row in pairs(list) do
|
||||
|
||||
if row[2] == 1 then
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:sand"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.12,
|
||||
scale = 0.3,
|
||||
spread = {x = 200, y = 200, z = 200},
|
||||
seed = 33,
|
||||
octaves = 3,
|
||||
persist = 0.7
|
||||
},
|
||||
biomes = {row[1]},
|
||||
y_min = 0,
|
||||
y_max = 0,
|
||||
schematic = lib_ecology.waterlily,
|
||||
rotation = "random",
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Generate Illumishroom in caves next to coal
|
||||
minetest.register_on_generated(function(minp, maxp)
|
||||
|
||||
if minp.y > -30 or maxp.y < -3000 then
|
||||
return
|
||||
end
|
||||
|
||||
local bpos
|
||||
local coal = minetest.find_nodes_in_area_under_air(minp, maxp, "default:stone_with_coal")
|
||||
|
||||
for n = 1, #coal do
|
||||
|
||||
bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z }
|
||||
|
||||
if math.random(1, 2) == 1 then
|
||||
|
||||
if bpos.y > -3000 and bpos.y < -2000 then
|
||||
minetest.swap_node(bpos, {name = "lib_ecology:illumishroom3"})
|
||||
|
||||
elseif bpos.y > -2000 and bpos.y < -1000 then
|
||||
minetest.swap_node(bpos, {name = "lib_ecology:illumishroom2"})
|
||||
|
||||
elseif bpos.y > -1000 and bpos.y < -30 then
|
||||
minetest.swap_node(bpos, {name = "lib_ecology:illumishroom"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- is baked clay mod active? add new flowers if so
|
||||
if minetest.get_modpath("bakedclay") then
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:prairie_grass", "lib_ecology:green_dirt",
|
||||
"lib_ecology:grove_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.004,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 7133,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
y_min = 10,
|
||||
y_max = 90,
|
||||
decoration = "bakedclay:delphinium",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:prairie_grass", "lib_ecology:green_dirt",
|
||||
"lib_ecology:grove_dirt", "lib_ecology:bamboo_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.004,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 7134,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
y_min = 15,
|
||||
y_max = 90,
|
||||
decoration = "bakedclay:thistle",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"lib_ecology:jungle_dirt"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.01,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 7135,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
y_min = 1,
|
||||
y_max = 90,
|
||||
decoration = "bakedclay:lazarus",
|
||||
spawn_by = "default:jungletree",
|
||||
num_spawn_by = 1,
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"lib_ecology:green_dirt", "default:sand"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.009,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 7136,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
y_min = 1,
|
||||
y_max = 15,
|
||||
decoration = "bakedclay:mannagrass",
|
||||
spawn_by = "group:water",
|
||||
num_spawn_by = 1,
|
||||
})
|
||||
|
||||
end
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- mushroom soup (Heals 1 heart)
|
||||
minetest.register_craftitem("lib_ecology:mushroom_soup", {
|
||||
description = S("Mushroom Soup"),
|
||||
inventory_image = "mushroom_soup.png",
|
||||
on_use = minetest.item_eat(5, "lib_ecology:bowl"),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:mushroom_soup",
|
||||
recipe = {
|
||||
{"flowers:mushroom_brown"},
|
||||
{"flowers:mushroom_brown"},
|
||||
{"lib_ecology:bowl"},
|
||||
}
|
||||
})
|
||||
|
||||
-- 4x red mushrooms make mushroom block
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:mushroom",
|
||||
recipe = {
|
||||
{"flowers:mushroom_red", "flowers:mushroom_red"},
|
||||
{"flowers:mushroom_red", "flowers:mushroom_red"},
|
||||
}
|
||||
})
|
|
@ -0,0 +1,103 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- wild onion
|
||||
minetest.register_craftitem("lib_ecology:wild_onion_plant", {
|
||||
description = S("Wild Onion"),
|
||||
inventory_image = "wild_onion.png",
|
||||
wield_image = "wild_onion.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "lib_ecology:wild_onion_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
-- Define Onion growth stages
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"ethereal_wild_onion_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
growing = 1, not_in_creative_inventory = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
}
|
||||
|
||||
--stage 1
|
||||
minetest.register_node("lib_ecology:onion_1", table.copy(crop_def))
|
||||
|
||||
--stage 2
|
||||
crop_def.tiles = {"ethereal_wild_onion_2.png"}
|
||||
minetest.register_node("lib_ecology:onion_2", table.copy(crop_def))
|
||||
|
||||
--stage 3
|
||||
crop_def.tiles = {"ethereal_wild_onion_3.png"}
|
||||
minetest.register_node("lib_ecology:onion_3", table.copy(crop_def))
|
||||
|
||||
--stage 4
|
||||
crop_def.tiles = {"ethereal_wild_onion_4.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"lib_ecology:wild_onion_plant"}, rarity = 1},
|
||||
{items = {"lib_ecology:wild_onion_plant 2"}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("lib_ecology:onion_4", table.copy(crop_def))
|
||||
|
||||
--stage 5
|
||||
crop_def.tiles = {"ethereal_wild_onion_5.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"lib_ecology:wild_onion_plant 2"}, rarity = 1},
|
||||
{items = {"lib_ecology:wild_onion_plant 3"}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("lib_ecology:onion_5", table.copy(crop_def))
|
||||
|
||||
-- growing routine if farming redo isn't present
|
||||
if not farming or not farming.mod or farming.mod ~= "redo" then
|
||||
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology grow onion",
|
||||
nodenames = {"lib_ecology:onion_1", "lib_ecology:onion_2", "lib_ecology:onion_3", "lib_ecology:onion_4"},
|
||||
neighbors = {"farming:soil_wet"},
|
||||
interval = 9,
|
||||
chance = 20,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
-- are we on wet soil?
|
||||
pos.y = pos.y - 1
|
||||
if minetest.get_item_group(minetest.get_node(pos).name, "soil") < 3 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y + 1
|
||||
|
||||
-- do we have enough light?
|
||||
local light = minetest.get_node_light(pos)
|
||||
|
||||
if not light
|
||||
or light < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
-- grow to next stage
|
||||
local num = node.name:split("_")[2]
|
||||
|
||||
node.name = "lib_ecology:onion_" .. tonumber(num + 1)
|
||||
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
})
|
||||
|
||||
end -- END IF
|
|
@ -0,0 +1,321 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Fire Flower
|
||||
minetest.register_node("lib_ecology:fire_flower", {
|
||||
description = S("Fire Flower"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "ethereal_fire_flower.png" },
|
||||
inventory_image = "ethereal_fire_flower.png",
|
||||
wield_image = "ethereal_fire_flower.png",
|
||||
paramtype = "light",
|
||||
light_source = 5,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
damage_per_second = 2,
|
||||
groups = {snappy = 1, oddly_breakable_by_hand = 3, igniter = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 1 / 2, 5 / 16},
|
||||
},
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
puncher:punch(puncher, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 2}
|
||||
}, nil)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "lib_ecology:fire_flower",
|
||||
burntime = 20,
|
||||
})
|
||||
|
||||
-- Fire Dust
|
||||
minetest.register_craftitem("lib_ecology:fire_dust", {
|
||||
description = S("Fire Dust"),
|
||||
inventory_image = "fire_dust.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:fire_dust 2",
|
||||
recipe = {
|
||||
{'lib_ecology:fire_flower'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "lib_ecology:fire_dust",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
-- vines
|
||||
minetest.register_node(":ethereal:vine", {
|
||||
description = S("Vine"),
|
||||
drawtype = "signlike",
|
||||
tiles = {"vine.png"},
|
||||
inventory_image = "vine.png",
|
||||
wield_image = "vine.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:vine 2",
|
||||
recipe = {
|
||||
{"group:leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves"},
|
||||
}
|
||||
})
|
||||
|
||||
-- vines
|
||||
minetest.register_node("lib_ecology:vine", {
|
||||
description = S("Vine"),
|
||||
drawtype = "signlike",
|
||||
tiles = {"vine.png"},
|
||||
inventory_image = "vine.png",
|
||||
wield_image = "vine.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:vine 2",
|
||||
recipe = {
|
||||
{"group:leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves"},
|
||||
}
|
||||
})
|
||||
|
||||
-- light strings (glowing vine)
|
||||
minetest.register_node("lib_ecology:lightstring", {
|
||||
description = S("Light String Vine"),
|
||||
drawtype = "signlike",
|
||||
tiles = {"lightstring.png"},
|
||||
inventory_image = "lightstring.png",
|
||||
wield_image = "lightstring.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
light_source = 10,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:lightstring 8",
|
||||
recipe = {
|
||||
{"lib_ecology:vine", "lib_ecology:vine", "lib_ecology:vine"},
|
||||
{"lib_ecology:vine", "lib_ecology:fire_dust", "lib_ecology:vine"},
|
||||
{"lib_ecology:vine", "lib_ecology:vine", "lib_ecology:vine"},
|
||||
},
|
||||
})
|
||||
|
||||
-- Fern (boston)
|
||||
minetest.register_node("lib_ecology:fern", {
|
||||
description = S("Fern"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.2,
|
||||
tiles = {"fern.png"},
|
||||
inventory_image = "fern.png",
|
||||
wield_image = "fern.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"lib_ecology:fern_tubers"}, rarity = 6},
|
||||
{items = {"lib_ecology:fern"}}
|
||||
}
|
||||
},
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
-- Boston Ferns sometimes drop edible Tubers (heals 1/2 heart when eaten)
|
||||
minetest.register_craftitem("lib_ecology:fern_tubers", {
|
||||
description = S("Fern Tubers"),
|
||||
inventory_image = "fern_tubers.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
-- Red Shrub (not flammable)
|
||||
minetest.register_node("lib_ecology:dry_shrub", {
|
||||
description = S("Fiery Dry Shrub"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {"ethereal_dry_shrub.png"},
|
||||
inventory_image = "ethereal_dry_shrub.png",
|
||||
wield_image = "ethereal_dry_shrub.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
-- Grey Shrub (not Flammable - too cold to burn)
|
||||
minetest.register_node("lib_ecology:snowygrass", {
|
||||
description = S("Snowy Grass"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 0.9,
|
||||
tiles = {"ethereal_snowygrass.png"},
|
||||
inventory_image = "ethereal_snowygrass.png",
|
||||
wield_image = "ethereal_snowygrass.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
-- Crystal Shrub (not Flammable - too cold to burn)
|
||||
minetest.register_node("lib_ecology:crystalgrass", {
|
||||
description = S("Crystal Grass"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 0.9,
|
||||
tiles = {"ethereal_crystalgrass.png"},
|
||||
inventory_image = "ethereal_crystalgrass.png",
|
||||
wield_image = "ethereal_crystalgrass.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
-- Define Moss Types (Has grass textures on all sides)
|
||||
function lib_ecology.add_moss(typ, descr, texture, receipe_item)
|
||||
|
||||
minetest.register_node("lib_ecology:" .. typ .. "_moss", {
|
||||
description = S(descr .. " Moss"),
|
||||
tiles = {texture},
|
||||
groups = {crumbly = 3},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.4}})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "lib_ecology:"..typ.."_moss",
|
||||
recipe = {"default:dirt", receipe_item }
|
||||
})
|
||||
end
|
||||
|
||||
lib_ecology.add_moss( "crystal", "Crystal", "ethereal_grass_crystal_top.png", "lib_ecology:frost_leaves")
|
||||
lib_ecology.add_moss( "mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "lib_ecology:mushroom")
|
||||
lib_ecology.add_moss( "fiery", "Fiery", "ethereal_grass_fiery_top.png", "lib_ecology:dry_shrub")
|
||||
lib_ecology.add_moss( "gray", "Gray", "ethereal_grass_gray_top.png", "lib_ecology:snowygrass")
|
||||
lib_ecology.add_moss( "green", "Green", "default_grass.png", "default:jungleleaves")
|
||||
|
||||
-- Illuminated Cave Shrooms (Red, Green and Blue)
|
||||
minetest.register_node("lib_ecology:illumishroom", {
|
||||
description = S("Red Illumishroom"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "illumishroom.png" },
|
||||
inventory_image = "illumishroom.png",
|
||||
wield_image = "illumishroom.png",
|
||||
paramtype = "light",
|
||||
light_source = 5,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 3, attached_node = 1,flammable = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("lib_ecology:illumishroom2", {
|
||||
description = S("Green Illumishroom"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "illumishroom2.png" },
|
||||
inventory_image = "illumishroom2.png",
|
||||
wield_image = "illumishroom2.png",
|
||||
paramtype = "light",
|
||||
light_source = 5,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 3, attached_node = 1,flammable = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("lib_ecology:illumishroom3", {
|
||||
description = S("Cyan Illumishroom"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "illumishroom3.png" },
|
||||
inventory_image = "illumishroom3.png",
|
||||
wield_image = "illumishroom3.png",
|
||||
paramtype = "light",
|
||||
light_source = 5,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 3, attached_node = 1,flammable = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16},
|
||||
},
|
||||
})
|
|
@ -0,0 +1,192 @@
|
|||
|
||||
--= Register Biome Decoration Using Plants Mega Pack Lite
|
||||
|
||||
--= Desert Biome
|
||||
|
||||
-- Cactus
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:desert_sand", "default:sandstone"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"desert", "sandstone"},
|
||||
decoration = {
|
||||
"xanadu:cactus_echinocereus", "xanadu:cactus_matucana",
|
||||
"xanadu:cactus_baseball", "xanadu:cactus_golden"
|
||||
},
|
||||
})
|
||||
|
||||
-- Desert Plants
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:desert_sand", "default:sandstone", "default:sand"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.004,
|
||||
biomes = {"desert", "sandstone"},
|
||||
decoration = {
|
||||
"xanadu:desert_kangaroo", "xanadu:desert_brittle",
|
||||
"xanadu:desert_ocotillo", "xanadu:desert_whitesage"
|
||||
},
|
||||
})
|
||||
|
||||
--= Prairie Biome
|
||||
|
||||
-- Grass
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"lib_ecology:prairie_dirt", "lib_ecology:green_dirt"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"prairie", "grassy", "grassytwo"},
|
||||
decoration = {
|
||||
"xanadu:grass_prairie", "xanadu:grass_cord",
|
||||
"xanadu:grass_wheatgrass", "xanadu:desert_whitesage"
|
||||
},
|
||||
})
|
||||
|
||||
-- Flowers
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:prairie_grass", "lib_ecology:green_dirt",
|
||||
"lib_ecology:grove_dirt", "lib_ecology:bamboo_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"prairie", "grassy", "grassytwo", "bamboo"},
|
||||
decoration = {
|
||||
"xanadu:flower_jacobsladder", "xanadu:flower_thistle",
|
||||
"xanadu:flower_wildcarrot"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:prairie_grass", "lib_ecology:green_dirt",
|
||||
"lib_ecology:grove_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"prairie", "grassy", "grassytwo", "grove"},
|
||||
decoration = {
|
||||
"xanadu:flower_delphinium", "xanadu:flower_celosia",
|
||||
"xanadu:flower_daisy", "xanadu:flower_bluerose"
|
||||
},
|
||||
})
|
||||
|
||||
-- Shrubs
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:prairie_grass", "lib_ecology:green_dirt",
|
||||
"lib_ecology:grove_dirt", "lib_ecology:jungle_grass",
|
||||
"lib_ecology:gray_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {
|
||||
"prairie", "grassy", "grassytwo", "grove", "junglee",
|
||||
"grayness", "jumble"
|
||||
},
|
||||
decoration = {"xanadu:shrub_kerria", "xanadu:shrub_spicebush"},
|
||||
})
|
||||
|
||||
--= Jungle Biome
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"lib_ecology:jungle_dirt", "lib_ecology:green_dirt"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.007,
|
||||
biomes = {"junglee", "jumble"},
|
||||
decoration = {
|
||||
"xanadu:rainforest_guzmania", "xanadu:rainforest_devil",
|
||||
"xanadu:rainforest_lazarus", "xanadu:rainforest_lollipop",
|
||||
"xanadu:mushroom_woolly"
|
||||
},
|
||||
})
|
||||
|
||||
--= Cold Biomes
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"default:dirt_with_snow", "lib_ecology:cold_dirt",
|
||||
"lib_ecology:gray_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"snowy", "alpine", "grayness"},
|
||||
decoration = {
|
||||
"xanadu:mountain_edelweiss", "xanadu:mountain_armeria",
|
||||
"xanadu:mountain_bellflower", "xanadu:mountain_willowherb",
|
||||
"xanadu:mountain_bistort"
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
--= Mushroom Biome
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"lib_ecology:mushroom_dirt"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"mushroom"},
|
||||
decoration = {
|
||||
"xanadu:mushroom_powderpuff", "xanadu:mushroom_chanterelle",
|
||||
"xanadu:mushroom_parasol"
|
||||
},
|
||||
})
|
||||
|
||||
--= Lakeside
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:sand", "lib_ecology:green_dirt"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.015,
|
||||
biomes = {"sandclay", "grassy_ocean", "grassy", "grassytwo", "jumble", "swamp"},
|
||||
decoration = {
|
||||
"xanadu:wetlands_cattails", "xanadu:wetlands_pickerel",
|
||||
"xanadu:wetlands_mannagrass", "xanadu:wetlands_turtle"
|
||||
},
|
||||
spawn_by = "default:water_source",
|
||||
num_spawn_by = 1,
|
||||
})
|
||||
|
||||
--= Harsh Biomes
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:mushroom_dirt", "lib_ecology:green_dirt",
|
||||
"lib_ecology:gray_dirt", "lib_ecology:cold_dirt",
|
||||
"lib_ecology:dirt_with_snow", "lib_ecology:jungle_dirt",
|
||||
"lib_ecology:prairie_dirt", "lib_ecology:grove_dirt",
|
||||
"lib_ecology:dry_dirt", "lib_ecology:fiery_dirt", "default:sand",
|
||||
"default:desert_sand", "xanadu:red", "lib_ecology:bamboo_dirt"
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.004,
|
||||
biomes = {
|
||||
"mushroom", "prairie", "grayness", "plains", "desert",
|
||||
"junglee", "grassy", "grassytwo", "jumble", "snowy", "alpine",
|
||||
"fiery", "mesa", "bamboo"
|
||||
},
|
||||
decoration = {"xanadu:spooky_thornbush", "xanadu:spooky_baneberry"},
|
||||
})
|
||||
|
||||
--= Poppy's growing in Clearing Biome in memory of RealBadAngel
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"lib_ecology:green_dirt",
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.004,
|
||||
biomes = {"clearing"},
|
||||
decoration = {"xanadu:poppy"},
|
||||
})
|
|
@ -0,0 +1,234 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Bamboo Sprout
|
||||
minetest.register_node("lib_ecology:bamboo_sprout", {
|
||||
description = S("Bamboo Sprout"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"bamboo_sprout.png"},
|
||||
inventory_image = "bamboo_sprout.png",
|
||||
wield_image = "bamboo_sprout.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy = 3, attached_node = 1, flammable = 2,
|
||||
dig_immediate = 3, lib_ecology_sapling = 1
|
||||
},
|
||||
sounds = default.node_sound_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 0, 4 / 16}
|
||||
},
|
||||
on_use = minetest.item_eat(-2),
|
||||
grown_height = 11,
|
||||
})
|
||||
|
||||
-- Register Saplings
|
||||
lib_ecology.register_sapling = function(name, desc, texture, height)
|
||||
|
||||
minetest.register_node(name .. "_sapling", {
|
||||
description = S(desc .. " Tree Sapling"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles = {texture .. ".png"},
|
||||
inventory_image = texture .. ".png",
|
||||
wield_image = texture .. ".png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
groups = {
|
||||
snappy = 2, dig_immediate = 3, flammable = 2,
|
||||
lib_ecology_sapling = 1, attached_node = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
grown_height = height,
|
||||
})
|
||||
end
|
||||
|
||||
lib_ecology.register_sapling("lib_ecology:willow", "Willow", "willow_sapling", 14)
|
||||
lib_ecology.register_sapling("lib_ecology:yellow_tree", "Healing", "yellow_tree_sapling", 19)
|
||||
lib_ecology.register_sapling("lib_ecology:big_tree", "Big", "ethereal_big_tree_sapling", 7)
|
||||
lib_ecology.register_sapling("lib_ecology:banana_tree", "Banana", "banana_tree_sapling", 8)
|
||||
lib_ecology.register_sapling("lib_ecology:frost_tree", "Frost", "ethereal_frost_tree_sapling", 19)
|
||||
lib_ecology.register_sapling("lib_ecology:mushroom", "Mushroom", "ethereal_mushroom_sapling", 11)
|
||||
lib_ecology.register_sapling("lib_ecology:palm", "Palm", "moretrees_palm_sapling", 9)
|
||||
lib_ecology.register_sapling("lib_ecology:redwood", "Redwood", "redwood_sapling", 31)
|
||||
lib_ecology.register_sapling("lib_ecology:orange_tree", "Orange", "orange_tree_sapling", 6)
|
||||
lib_ecology.register_sapling("lib_ecology:birch", "Birch", "moretrees_birch_sapling", 7)
|
||||
|
||||
lib_ecology.add_tree = function (pos, ofx, ofy, ofz, schem)
|
||||
-- check for schematic
|
||||
if not schem then
|
||||
print (S("Schematic not found"))
|
||||
return
|
||||
end
|
||||
-- remove sapling and place schematic
|
||||
minetest.swap_node(pos, {name = "air"})
|
||||
minetest.place_schematic(
|
||||
{x = pos.x - ofx, y = pos.y - ofy, z = pos.z - ofz},
|
||||
schem, 0, nil, false)
|
||||
end
|
||||
|
||||
--local path = minetest.get_modpath("lib_ecology").."/schematics/"
|
||||
|
||||
-- grow tree functions
|
||||
function lib_ecology.grow_yellow_tree(pos)
|
||||
lib_ecology.add_tree(pos, 4, 0, 4, lib_ecology.path .. "/schematics/yellowtree.mts")
|
||||
end
|
||||
|
||||
function lib_ecology.grow_big_tree(pos)
|
||||
lib_ecology.add_tree(pos, 4, 0, 4, lib_ecology.path .. "/schematics/bigtree.mts")
|
||||
end
|
||||
|
||||
function lib_ecology.grow_banana_tree(pos)
|
||||
lib_ecology.add_tree(pos, 3, 0, 3, lib_ecology.bananatree)
|
||||
end
|
||||
|
||||
function lib_ecology.grow_frost_tree(pos)
|
||||
lib_ecology.add_tree(pos, 4, 0, 4, lib_ecology.path .. "/schematics/frosttrees.mts")
|
||||
end
|
||||
|
||||
function lib_ecology.grow_mushroom_tree(pos)
|
||||
lib_ecology.add_tree(pos, 4, 0, 4, lib_ecology.path .. "/schematics/mushroomone.mts")
|
||||
end
|
||||
|
||||
function lib_ecology.grow_palm_tree(pos)
|
||||
lib_ecology.add_tree(pos, 4, 0, 4, lib_ecology.path .. "/schematics/palmtree.mts")
|
||||
end
|
||||
|
||||
function lib_ecology.grow_willow_tree(pos)
|
||||
lib_ecology.add_tree(pos, 5, 0, 5, lib_ecology.path .. "/schematics/willow.mts")
|
||||
end
|
||||
|
||||
function lib_ecology.grow_redwood_tree(pos)
|
||||
if math.random(1, 2) == 1 then
|
||||
lib_ecology.add_tree(pos, 9, 3, 9, lib_ecology.path .. "/schematics/redwood.mts") -- shinji
|
||||
else
|
||||
lib_ecology.add_tree(pos, 8, 6, 8, lib_ecology.path .. "/schematics/redwood_tree.mts") -- iska
|
||||
end
|
||||
end
|
||||
|
||||
function lib_ecology.grow_orange_tree(pos)
|
||||
lib_ecology.add_tree(pos, 1, 0, 1, lib_ecology.orangetree)
|
||||
end
|
||||
|
||||
function lib_ecology.grow_bamboo_tree(pos)
|
||||
lib_ecology.add_tree(pos, 1, 0, 1, lib_ecology.bambootree)
|
||||
end
|
||||
|
||||
function lib_ecology.grow_birch_tree(pos)
|
||||
lib_ecology.add_tree(pos, 2, 0, 2, lib_ecology.birchtree)
|
||||
end
|
||||
|
||||
-- check if sapling has enough height room to grow
|
||||
local function enough_height(pos, height)
|
||||
|
||||
local nod = minetest.line_of_sight(
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y + height, z = pos.z})
|
||||
|
||||
if not nod then
|
||||
return false -- obstructed
|
||||
else
|
||||
return true -- can grow
|
||||
end
|
||||
end
|
||||
|
||||
lib_ecology.grow_sapling = function (pos, node)
|
||||
|
||||
local under = minetest.get_node({
|
||||
x = pos.x,
|
||||
y = pos.y - 1,
|
||||
z = pos.z
|
||||
}).name
|
||||
|
||||
if not minetest.registered_nodes[node.name] then
|
||||
return
|
||||
end
|
||||
|
||||
local height = minetest.registered_nodes[node.name].grown_height
|
||||
|
||||
-- do we have enough height to grow sapling into tree?
|
||||
if not height or not enough_height(pos, height) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if lib_ecology Sapling is growing on correct substrate
|
||||
if node.name == "lib_ecology:yellow_tree_sapling"
|
||||
and under == "default:dirt_with_snow" then
|
||||
lib_ecology.grow_yellow_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:big_tree_sapling"
|
||||
and under == "lib_ecology:green_dirt" then
|
||||
lib_ecology.grow_big_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:banana_tree_sapling"
|
||||
and under == "lib_ecology:grove_dirt" then
|
||||
lib_ecology.grow_banana_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:frost_tree_sapling"
|
||||
and under == "lib_ecology:crystal_dirt" then
|
||||
lib_ecology.grow_frost_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:mushroom_sapling"
|
||||
and under == "lib_ecology:mushroom_dirt" then
|
||||
lib_ecology.grow_mushroom_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:palm_sapling"
|
||||
and under == "default:sand" then
|
||||
lib_ecology.grow_palm_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:willow_sapling"
|
||||
and under == "lib_ecology:gray_dirt" then
|
||||
lib_ecology.grow_willow_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:redwood_sapling"
|
||||
and under == "bakedclay:red" then
|
||||
lib_ecology.grow_redwood_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:orange_tree_sapling"
|
||||
and under == "lib_ecology:prairie_dirt" then
|
||||
lib_ecology.grow_orange_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:bamboo_sprout"
|
||||
and under == "lib_ecology:bamboo_dirt" then
|
||||
lib_ecology.grow_bamboo_tree(pos)
|
||||
|
||||
elseif node.name == "lib_ecology:birch_sapling"
|
||||
and under == "lib_ecology:green_dirt" then
|
||||
lib_ecology.grow_birch_tree(pos)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Grow saplings
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology grow sapling",
|
||||
nodenames = {"group:lib_ecology_sapling"},
|
||||
interval = 10,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
local light_level = minetest.get_node_light(pos)
|
||||
|
||||
if not light_level or light_level < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
lib_ecology.grow_sapling(pos, node)
|
||||
end,
|
||||
})
|
||||
|
||||
-- burn saplings
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:lib_ecology_sapling",
|
||||
burntime = 10,
|
||||
})
|
|
@ -0,0 +1,187 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Seaweed
|
||||
minetest.register_node("lib_ecology:seaweed", {
|
||||
description = S("Seaweed"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaweed.png"},
|
||||
inventory_image = "seaweed.png",
|
||||
wield_image = "seaweed.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
|
||||
groups = {snappy = 3},
|
||||
on_use = minetest.item_eat(1),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_up(pos, node, digger)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:dark_green 3",
|
||||
recipe = {"lib_ecology:seaweed",},
|
||||
})
|
||||
|
||||
-- Blue Coral
|
||||
minetest.register_node("lib_ecology:coral2", {
|
||||
description = S("Blue Coral"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"coral2.png"},
|
||||
inventory_image = "coral2.png",
|
||||
wield_image = "coral2.png",
|
||||
paramtype = "light",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 1 / 4, 6 / 16},
|
||||
},
|
||||
light_source = 3,
|
||||
groups = {snappy = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:cyan 3",
|
||||
recipe = {"lib_ecology:coral2",},
|
||||
})
|
||||
|
||||
-- Orange Coral
|
||||
minetest.register_node("lib_ecology:coral3", {
|
||||
description = S("Orange Coral"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"coral3.png"},
|
||||
inventory_image = "coral3.png",
|
||||
wield_image = "coral3.png",
|
||||
paramtype = "light",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 1 / 4, 6 / 16},
|
||||
},
|
||||
light_source = 3,
|
||||
groups = {snappy = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:orange 3",
|
||||
recipe = {"lib_ecology:coral3",},
|
||||
})
|
||||
|
||||
-- Pink Coral
|
||||
minetest.register_node("lib_ecology:coral4", {
|
||||
description = S("Pink Coral"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"coral4.png"},
|
||||
inventory_image = "coral4.png",
|
||||
wield_image = "coral4.png",
|
||||
paramtype = "light",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 8 / 16, 6 / 16},
|
||||
},
|
||||
light_source = 3,
|
||||
groups = {snappy = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:pink 3",
|
||||
recipe = {"lib_ecology:coral4",},
|
||||
})
|
||||
|
||||
-- Green Coral
|
||||
minetest.register_node("lib_ecology:coral5", {
|
||||
description = S("Green Coral"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"coral5.png"},
|
||||
inventory_image = "coral5.png",
|
||||
wield_image = "coral5.png",
|
||||
paramtype = "light",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 3 / 16, 6 / 16},
|
||||
},
|
||||
light_source = 3,
|
||||
groups = {snappy = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "dye:green 3",
|
||||
recipe = {"lib_ecology:coral5",},
|
||||
})
|
||||
|
||||
-- Undersea Sand
|
||||
minetest.register_node(":ethereal:sandy", {
|
||||
description = S("Sandy"),
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
crumbly = 3, falling_node = 1, sand = 1, not_in_creative_inventory = 1
|
||||
},
|
||||
drop = "default:sand",
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
-- randomly generate coral or seaweed and have seaweed grow up to 14 high
|
||||
minetest.register_abm({
|
||||
label = "Grow coral/seaweed",
|
||||
nodenames = {":ethereal:sandy"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 15,
|
||||
chance = 10,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
local sel = math.random(1, 5)
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
local nod = minetest.get_node(pos).name
|
||||
|
||||
if nod == "default:water_source"
|
||||
and sel > 1 then
|
||||
|
||||
if minetest.get_node(pos).name == "default:water_source" then
|
||||
|
||||
minetest.swap_node(pos, {name = "lib_ecology:coral" .. sel})
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if nod == "lib_ecology:seaweed"
|
||||
or sel == 1 then
|
||||
|
||||
local height = 0
|
||||
local high = 14
|
||||
|
||||
while height < high
|
||||
and minetest.get_node(pos).name == "lib_ecology:seaweed" do
|
||||
height = height + 1
|
||||
pos.y = pos.y + 1
|
||||
end
|
||||
|
||||
if pos.y < 1
|
||||
and height < high
|
||||
and minetest.get_node(pos).name == "default:water_source" then
|
||||
|
||||
minetest.swap_node(pos, {name = "lib_ecology:seaweed"})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
|
@ -0,0 +1,126 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Strawberry (can also be planted as seed)
|
||||
minetest.register_craftitem("lib_ecology:strawberry", {
|
||||
description = S("Strawberry"),
|
||||
inventory_image = "strawberry.png",
|
||||
wield_image = "strawberry.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "lib_ecology:strawberry_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
-- Define Strawberry Bush growth stages
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"strawberry_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable =2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
}
|
||||
|
||||
--stage 1
|
||||
minetest.register_node("lib_ecology:strawberry_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"strawberry_2.png"}
|
||||
minetest.register_node("lib_ecology:strawberry_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"strawberry_3.png"}
|
||||
minetest.register_node("lib_ecology:strawberry_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"strawberry_4.png"}
|
||||
minetest.register_node("lib_ecology:strawberry_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"strawberry_5.png"}
|
||||
minetest.register_node("lib_ecology:strawberry_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"strawberry_6.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"lib_ecology:strawberry 1"},rarity = 2},
|
||||
{items = {"lib_ecology:strawberry 2"},rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("lib_ecology:strawberry_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"strawberry_7.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"lib_ecology:strawberry 1"},rarity = 1},
|
||||
{items = {"lib_ecology:strawberry 2"},rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("lib_ecology:strawberry_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8
|
||||
crop_def.tiles = {"strawberry_8.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"lib_ecology:strawberry 2"},rarity = 1},
|
||||
{items = {"lib_ecology:strawberry 3"},rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("lib_ecology:strawberry_8", table.copy(crop_def))
|
||||
|
||||
-- growing routine if farming redo isn't present
|
||||
if not farming or not farming.mod or farming.mod ~= "redo" then
|
||||
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology grow strawberry",
|
||||
nodenames = {
|
||||
"lib_ecology:strawberry_1", "lib_ecology:strawberry_2", "lib_ecology:strawberry_3",
|
||||
"lib_ecology:strawberry_4", "lib_ecology:strawberry_5", "lib_ecology:strawberry_6",
|
||||
"lib_ecology:strawberry_7"
|
||||
},
|
||||
neighbors = {"farming:soil_wet"},
|
||||
interval = 9,
|
||||
chance = 20,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
-- are we on wet soil?
|
||||
pos.y = pos.y - 1
|
||||
if minetest.get_item_group(minetest.get_node(pos).name, "soil") < 3 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y + 1
|
||||
|
||||
-- do we have enough light?
|
||||
local light = minetest.get_node_light(pos)
|
||||
|
||||
if not light
|
||||
or light < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
-- grow to next stage
|
||||
local num = node.name:split("_")[2]
|
||||
|
||||
node.name = "lib_ecology:strawberry_" .. tonumber(num + 1)
|
||||
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
})
|
||||
|
||||
end -- END IF
|
|
@ -0,0 +1,162 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- Ice Brick
|
||||
minetest.register_node("lib_ecology:icebrick", {
|
||||
description = S("Ice Brick"),
|
||||
tiles = {"brick_ice.png"},
|
||||
paramtype = "light",
|
||||
freezemelt = "default:water_source",
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'lib_ecology:icebrick 4',
|
||||
recipe = {
|
||||
{'default:ice', 'default:ice'},
|
||||
{'default:ice', 'default:ice'},
|
||||
}
|
||||
})
|
||||
|
||||
-- Snow Brick
|
||||
minetest.register_node("lib_ecology:snowbrick", {
|
||||
description = S("Snow Brick"),
|
||||
tiles = {"brick_snow.png"},
|
||||
paramtype = "light",
|
||||
freezemelt = "default:water_source",
|
||||
is_ground_content = false,
|
||||
groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||
dug = {name = "default_snow_footstep", gain = 0.2},
|
||||
dig = {name = "default_snow_footstep", gain = 0.2},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'lib_ecology:snowbrick 4',
|
||||
recipe = {
|
||||
{'default:snowblock', 'default:snowblock'},
|
||||
{'default:snowblock', 'default:snowblock'},
|
||||
}
|
||||
})
|
||||
|
||||
-- If Crystal Spike, Crystal Dirt, Snow near Water, change Water to Ice
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology freeze water",
|
||||
nodenames = {
|
||||
"lib_ecology:crystal_spike", "default:snow", "default:snowblock",
|
||||
"lib_ecology:snowbrick"
|
||||
},
|
||||
neighbors = {"default:water_source", "default:river_water_source"},
|
||||
interval = 15,
|
||||
chance = 4,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
local near = minetest.find_node_near(pos, 1,
|
||||
{"default:water_source", "default:river_water_source"})
|
||||
|
||||
if near then
|
||||
minetest.swap_node(near, {name = "default:ice"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- If Heat Source near Ice or Snow then melt
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology melt snow/ice",
|
||||
nodenames = {
|
||||
"default:ice", "default:snowblock", "default:snow",
|
||||
"default:dirt_with_snow", "lib_ecology:snowbrick", "lib_ecology:icebrick"
|
||||
},
|
||||
neighbors = {
|
||||
"fire:basic_fire", "default:lava_source", "default:lava_flowing",
|
||||
"default:furnace_active", "default:torch"
|
||||
},
|
||||
interval = 5,
|
||||
chance = 4,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
local water_node = "default:water"
|
||||
|
||||
if pos.y > 2 then
|
||||
water_node = "default:river_water"
|
||||
end
|
||||
|
||||
if node.name == "default:ice"
|
||||
or node.name == "default:snowblock"
|
||||
or node.name == "lib_ecology:icebrick"
|
||||
or node.name == "lib_ecology:snowbrick" then
|
||||
minetest.swap_node(pos, {name = water_node.."_source"})
|
||||
|
||||
elseif node.name == "default:snow" then
|
||||
minetest.swap_node(pos, {name = water_node.."_flowing"})
|
||||
|
||||
elseif node.name == "default:dirt_with_snow" then
|
||||
minetest.swap_node(pos, {name = "default:dirt_with_grass"})
|
||||
end
|
||||
|
||||
--nodeupdate(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
-- If Water Source near Dry Dirt, change to normal Dirt
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology wet dry dirt",
|
||||
nodenames = {"lib_ecology:dry_dirt", "default:dirt_with_dry_grass"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 15,
|
||||
chance = 2,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
if node == "lib_ecology:dry_dirt" then
|
||||
minetest.swap_node(pos, {name = "default:dirt"})
|
||||
else
|
||||
minetest.swap_node(pos, {name = "lib_ecology:green_dirt"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- If torch touching water then drop as item (when enabled)
|
||||
if lib_ecology.torchdrop == true then
|
||||
|
||||
minetest.register_abm({
|
||||
label = "lib_ecology drop torch",
|
||||
nodenames = {"default:torch", "default:torch_wall", "default:torch_ceiling"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 5,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
local num = #minetest.find_nodes_in_area(
|
||||
{x = pos.x - 1, y = pos.y, z = pos.z},
|
||||
{x = pos.x + 1, y = pos.y, z = pos.z},
|
||||
{"group:water"})
|
||||
if num == 0 then
|
||||
num = num + #minetest.find_nodes_in_area(
|
||||
{x = pos.x, y = pos.y, z = pos.z - 1},
|
||||
{x = pos.x, y = pos.y, z = pos.z + 1},
|
||||
{"group:water"})
|
||||
end
|
||||
if num == 0 then
|
||||
num = num + #minetest.find_nodes_in_area(
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{"group:water"})
|
||||
end
|
||||
if num > 0 then
|
||||
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
|
||||
minetest.add_item(pos, {name = "default:torch"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
|
@ -0,0 +1,321 @@
|
|||
|
||||
local S = lib_ecology.intllib
|
||||
|
||||
-- willow trunk
|
||||
minetest.register_node(":ethereal:willow_trunk", {
|
||||
description = S("Willow Trunk"),
|
||||
tiles = {
|
||||
"willow_trunk_top.png",
|
||||
"willow_trunk_top.png",
|
||||
"willow_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- willow wood
|
||||
minetest.register_node("lib_ecology:willow_wood", {
|
||||
description = S("Willow Wood"),
|
||||
tiles = {"willow_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:willow_wood 4",
|
||||
recipe = {{"lib_ecology:willow_trunk"}}
|
||||
})
|
||||
|
||||
-- redwood trunk
|
||||
minetest.register_node(":ethereal:redwood_trunk", {
|
||||
description = S("Redwood Trunk"),
|
||||
tiles = {
|
||||
"redwood_trunk_top.png",
|
||||
"redwood_trunk_top.png",
|
||||
"redwood_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- redwood wood
|
||||
minetest.register_node("lib_ecology:redwood_wood", {
|
||||
description = S("Redwood Wood"),
|
||||
tiles = {"redwood_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:redwood_wood 4",
|
||||
recipe = {{"lib_ecology:redwood_trunk"}},
|
||||
})
|
||||
|
||||
-- frost trunk
|
||||
minetest.register_node(":ethereal:frost_tree", {
|
||||
description = S("Frost Tree"),
|
||||
tiles = {
|
||||
"ethereal_frost_tree_top.png",
|
||||
"ethereal_frost_tree_top.png",
|
||||
"ethereal_frost_tree.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- frost wood
|
||||
minetest.register_node("lib_ecology:frost_wood", {
|
||||
description = S("Frost Wood"),
|
||||
tiles = {"frost_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:frost_wood 4",
|
||||
recipe = {{"lib_ecology:frost_tree"}}
|
||||
})
|
||||
|
||||
-- healing trunk
|
||||
minetest.register_node(":ethereal:yellow_trunk", {
|
||||
description = S("Healing Tree Trunk"),
|
||||
tiles = {
|
||||
"yellow_tree_top.png",
|
||||
"yellow_tree_top.png",
|
||||
"yellow_tree.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- healing wood
|
||||
minetest.register_node("lib_ecology:yellow_wood", {
|
||||
description = S("Healing Tree Wood"),
|
||||
tiles = {"yellow_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:yellow_wood 4",
|
||||
recipe = {{"lib_ecology:yellow_trunk"}}
|
||||
})
|
||||
|
||||
-- palm trunk (thanks to VanessaE for palm textures)
|
||||
minetest.register_node(":ethereal:palm_trunk", {
|
||||
description = S("Palm Trunk"),
|
||||
tiles = {
|
||||
"moretrees_palm_trunk_top.png",
|
||||
"moretrees_palm_trunk_top.png",
|
||||
"moretrees_palm_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- palm wood
|
||||
minetest.register_node("lib_ecology:palm_wood", {
|
||||
description = S("Palm Wood"),
|
||||
tiles = {"moretrees_palm_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:palm_wood 4",
|
||||
recipe = {{"lib_ecology:palm_trunk"}}
|
||||
})
|
||||
|
||||
-- banana trunk
|
||||
minetest.register_node("lib_ecology:banana_trunk", {
|
||||
description = S("Banana Trunk"),
|
||||
tiles = {
|
||||
"banana_trunk_top.png",
|
||||
"banana_trunk_top.png",
|
||||
"banana_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- banana wood
|
||||
minetest.register_node("lib_ecology:banana_wood", {
|
||||
description = S("Banana Wood"),
|
||||
tiles = {"banana_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:banana_wood 4",
|
||||
recipe = {{"lib_ecology:banana_trunk"}}
|
||||
})
|
||||
|
||||
-- scorched trunk
|
||||
minetest.register_node("lib_ecology:scorched_tree", {
|
||||
description = S("Scorched Tree"),
|
||||
tiles = {
|
||||
"scorched_tree_top.png",
|
||||
"scorched_tree_top.png",
|
||||
"scorched_tree.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:scorched_tree 8",
|
||||
recipe = {
|
||||
{"group:tree", "group:tree", "group:tree"},
|
||||
{"group:tree", "default:torch", "group:tree"},
|
||||
{"group:tree", "group:tree", "group:tree"},
|
||||
}
|
||||
})
|
||||
|
||||
-- mushroom trunk
|
||||
minetest.register_node(":ethereal:mushroom_trunk", {
|
||||
description = S("Mushroom"),
|
||||
tiles = {
|
||||
"mushroom_trunk_top.png",
|
||||
"mushroom_trunk_top.png",
|
||||
"mushroom_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- birch trunk (thanks to VanessaE for birch textures)
|
||||
minetest.register_node("lib_ecology:birch_trunk", {
|
||||
description = S("Birch Trunk"),
|
||||
tiles = {
|
||||
"moretrees_birch_trunk_top.png",
|
||||
"moretrees_birch_trunk_top.png",
|
||||
"moretrees_birch_trunk.png"
|
||||
},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
on_place = minetest.rotate_node,
|
||||
})
|
||||
|
||||
-- birch wood
|
||||
minetest.register_node("lib_ecology:birch_wood", {
|
||||
description = S("Birch Wood"),
|
||||
tiles = {"moretrees_birch_wood.png"},
|
||||
is_ground_content = false,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lib_ecology:birch_wood 4",
|
||||
recipe = {{"lib_ecology:birch_trunk"}}
|
||||
})
|
||||
|
||||
-- Bamboo (thanks to Nelo-slay on DeviantArt for the free Bamboo base image)
|
||||
minetest.register_node("lib_ecology:bamboo", {
|
||||
description = S("Bamboo"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {"bamboo.png^[transformR90^bamboo.png","bamboo.png^[transformR90^bamboo.png","bamboo.png","bamboo.png^[transformFX","bamboo.png^[transformFX","bamboo.png"},
|
||||
inventory_image = "bamboo.png",
|
||||
wield_image = "bamboo.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.25, 0.5, 0.25}, -- Stalk
|
||||
{-0.25, 0.3125, -0.0625, -0.1875, 0.4375, 0.125}, -- NodeBox2
|
||||
{-0.0625, 0.3125, -0.25, 0.125, 0.4375, -0.1875}, -- NodeBox3
|
||||
{0.25, 0.125, -0.0625, 0.3125, 0.4375, 0.125}, -- NodeBox4
|
||||
{-0.0625, 0.125, 0.25, 0.125, 0.4375, 0.3125}, -- NodeBox5
|
||||
{-0.25, -0.4375, -0.0625, -0.1875, -0.3125, 0.125}, -- NodeBox6
|
||||
{-0.0625, -0.4375, -0.25, 0.125, -0.3125, -0.1875}, -- NodeBox7
|
||||
{-0.375, -0.375, -0.0625, -0.25, -0.3125, 0.125}, -- NodeBox8
|
||||
{-0.0625, -0.375, -0.375, 0.125, -0.3125, -0.25}, -- NodeBox9
|
||||
{0.3125, 0.1875, -0.0625, 0.375, 0.25, 0.125}, -- NodeBox10
|
||||
{0.375, 0.25, -0.0625, 0.4375, 0.3125, 0.125}, -- NodeBox11
|
||||
{-0.0625, 0.1875, 0.3125, 0.125, 0.25, 0.375}, -- NodeBox12
|
||||
{-0.0625, 0.25, 0.375, 0.125, 0.3125, 0.4375}, -- NodeBox13
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.25, 0.5, 0.25}, -- Stalk
|
||||
{-0.25, 0.3125, -0.0625, -0.1875, 0.4375, 0.125}, -- NodeBox2
|
||||
{-0.0625, 0.3125, -0.25, 0.125, 0.4375, -0.1875}, -- NodeBox3
|
||||
{0.25, 0.125, -0.0625, 0.3125, 0.4375, 0.125}, -- NodeBox4
|
||||
{-0.0625, 0.125, 0.25, 0.125, 0.4375, 0.3125}, -- NodeBox5
|
||||
{-0.25, -0.4375, -0.0625, -0.1875, -0.3125, 0.125}, -- NodeBox6
|
||||
{-0.0625, -0.4375, -0.25, 0.125, -0.3125, -0.1875}, -- NodeBox7
|
||||
{-0.375, -0.375, -0.0625, -0.25, -0.3125, 0.125}, -- NodeBox8
|
||||
{-0.0625, -0.375, -0.375, 0.125, -0.3125, -0.25}, -- NodeBox9
|
||||
{0.3125, 0.1875, -0.0625, 0.375, 0.25, 0.125}, -- NodeBox10
|
||||
{0.375, 0.25, -0.0625, 0.4375, 0.3125, 0.125}, -- NodeBox11
|
||||
{-0.0625, 0.1875, 0.3125, 0.125, 0.25, 0.375}, -- NodeBox12
|
||||
{-0.0625, 0.25, 0.375, 0.125, 0.3125, 0.4375}, -- NodeBox13
|
||||
}
|
||||
},
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2, tree = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_up(pos, node, digger)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "lib_ecology:bamboo",
|
||||
burntime = 1,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("lib_ecology:bamboo2", {
|
||||
description = S("Bamboo 2"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"bamboo.png"},
|
||||
inventory_image = "bamboo.png",
|
||||
wield_image = "bamboo.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2, tree = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_up(pos, node, digger)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "lib_ecology:bamboo2",
|
||||
burntime = 1,
|
||||
})
|
Loading…
Reference in New Issue