Fix: temporary remove nyan cat, remove wisps and temporary remove skyrealms (not finished)
This commit is contained in:
parent
f7d9844d54
commit
de389ade0f
106 changed files with 2892 additions and 561 deletions
277
mods/.skyrealms/plants.lua
Normal file
277
mods/.skyrealms/plants.lua
Normal file
|
@ -0,0 +1,277 @@
|
|||
-- Lichen biome
|
||||
|
||||
-- glowing fungi
|
||||
minetest.register_node("caverealms:fungus", {
|
||||
description = "Glowing Fungus",
|
||||
tiles = {"caverealms_fungi.png"},
|
||||
inventory_image = "caverealms_fungi.png",
|
||||
wield_image = "caverealms_fungi.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand = 3, attached_node = 1},
|
||||
light_source = 5,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
-- mycena mushroom
|
||||
minetest.register_node("caverealms:mycena", {
|
||||
description = "Mycena Mushroom",
|
||||
tiles = {"caverealms_mycena.png"},
|
||||
inventory_image = "caverealms_mycena.png",
|
||||
wield_image = "caverealms_mycena.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand = 3, attached_node = 1},
|
||||
light_source = 6,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
-- giant mushroom
|
||||
if minetest.get_modpath("ethereal") then
|
||||
minetest.register_alias("caverealms:mushroom_cap", "ethereal:mushroom")
|
||||
minetest.register_alias("caverealms:mushroom_stem", "ethereal:mushroom_trunk")
|
||||
else
|
||||
-- stem
|
||||
minetest.register_node("caverealms:mushroom_stem", {
|
||||
description = "Giant Mushroom Stem",
|
||||
tiles = {"caverealms_mushroom_stem.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1},
|
||||
})
|
||||
|
||||
-- cap
|
||||
minetest.register_node("caverealms:mushroom_cap", {
|
||||
description = "Giant Mushroom Cap",
|
||||
tiles = {"caverealms_mushroom_cap.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1,},
|
||||
light_source = 3,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"caverealms:mushroom_sapling"}, rarity = 20},
|
||||
{items = {"caverealms:mushroom_cap"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- sapling
|
||||
minetest.register_node("caverealms:mushroom_sapling", {
|
||||
description = "Mushroom Tree Sapling",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"caverealms_mushroom_sapling.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},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- green mushroom
|
||||
-- cap
|
||||
minetest.register_node("caverealms:mushroom_cap_green", {
|
||||
description = "Giant Mushroom Cap, Green",
|
||||
tiles = {"caverealms_mushroom_cap_green.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1,},
|
||||
light_source = 3,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"caverealms:mushroom_sapling_green"}, rarity = 20},
|
||||
{items = {"caverealms:mushroom_cap_green"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
minetest.register_node("caverealms:mushroom_cap_green_spots", {
|
||||
description = "Giant Mushroom Cap, Green",
|
||||
tiles = {"caverealms_mushroom_cap_green.png^caverealms_mushroom_cap_spots.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1,},
|
||||
light_source = 3,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"caverealms:mushroom_sapling_green_spots"}, rarity = 20},
|
||||
{items = {"caverealms:mushroom_cap_green"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- sapling
|
||||
minetest.register_node("caverealms:mushroom_sapling_green", {
|
||||
description = "Mushroom Tree Sapling, Green",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"caverealms_mushroom_sapling_green.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},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-- gills
|
||||
minetest.register_node("caverealms:mushroom_gills", {
|
||||
description = "Giant Mushroom Gills",
|
||||
tiles = {"caverealms_mushroom_gills.png"},
|
||||
is_ground_content = true,
|
||||
light_source = 10,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1},
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
|
||||
-- Saplings
|
||||
|
||||
-- grow trees
|
||||
local add_tree = function (pos, ofx, ofy, ofz, schem)
|
||||
if not schem then
|
||||
print ("Schematic not found")
|
||||
return
|
||||
end
|
||||
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("caverealms").."/schematics/"
|
||||
|
||||
-- giant mushrooms
|
||||
function grow_caverealms_mushroom(pos)
|
||||
add_tree(pos, 5, 0, 5, path .. "shroom.mts")
|
||||
end
|
||||
|
||||
-- height check
|
||||
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
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Caverealms grow sapling",
|
||||
nodenames = {"ethereal:mushroom_sapling", "caverealms:mushroom_sapling"},
|
||||
interval = 10,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local light_level = minetest.get_node_light(pos)
|
||||
-- check light level
|
||||
if not light_level or light_level > 10 then
|
||||
return
|
||||
end
|
||||
-- get node under sapling
|
||||
local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name
|
||||
-- check if registered
|
||||
if not minetest.registered_nodes[node.name] then
|
||||
return
|
||||
end
|
||||
-- ethereal sapling on lichen stone
|
||||
if node.name == "ethereal:mushroom_sapling"
|
||||
and under == "caverealms:stone_with_lichen"
|
||||
and enough_height(pos, 10) then
|
||||
grow_caverealms_mushroom(pos)
|
||||
-- caverealms sapling on lichen stone
|
||||
elseif node.name == "caverealms:mushroom_sapling"
|
||||
and under == "caverealms:stone_with_lichen"
|
||||
and enough_height(pos, 10) then
|
||||
grow_caverealms_mushroom(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- green mushroom growth
|
||||
function caverealms:grow_green_mushroom(x,y,z, area, data)
|
||||
local c_stem = minetest.get_content_id("caverealms:mushroom_stem")
|
||||
local c_gills = minetest.get_content_id("caverealms:mushroom_gills")
|
||||
local c_cap = minetest.get_content_id("caverealms:mushroom_cap_green")
|
||||
local c_caps = minetest.get_content_id("caverealms:mushroom_cap_green_spots")
|
||||
|
||||
-- stem
|
||||
local stop = {x=x,y=y+3,z=z}--{x = x+math.random(-1,1), y = y+3, z = z+math.random(-1,1)}
|
||||
|
||||
for i = 1,3 do
|
||||
-- local vi = area:index(x+((stop.x-x) / i), y+i, z+((stop.z-z) / i))
|
||||
local vi = area:index(x, y+i, z)
|
||||
data[vi] = c_stem
|
||||
end
|
||||
|
||||
data[area:index(stop.x+1, y+3, stop.z)] = c_gills
|
||||
data[area:index(stop.x-1, y+3, stop.z)] = c_gills
|
||||
data[area:index(stop.x, y+3, stop.z+1)] = c_gills
|
||||
data[area:index(stop.x, y+3, stop.z-1)] = c_gills
|
||||
|
||||
data[area:index(stop.x+1, y+3, stop.z+1)] = c_cap
|
||||
data[area:index(stop.x-1, y+3, stop.z+1)] = c_cap
|
||||
data[area:index(stop.x+1, y+3, stop.z-1)] = c_cap
|
||||
data[area:index(stop.x-1, y+3, stop.z-1)] = c_caps
|
||||
data[area:index(stop.x+2, y+3, stop.z)] = c_cap
|
||||
data[area:index(stop.x-2, y+3, stop.z)] = c_cap
|
||||
data[area:index(stop.x, y+3, stop.z+2)] = c_caps
|
||||
data[area:index(stop.x, y+3, stop.z-2)] = c_cap
|
||||
data[area:index(stop.x+1, y+4, stop.z)] = c_caps
|
||||
data[area:index(stop.x-1, y+4, stop.z)] = c_cap
|
||||
data[area:index(stop.x, y+4, stop.z+1)] = c_caps
|
||||
data[area:index(stop.x, y+4, stop.z-1)] = c_cap
|
||||
data[area:index(stop.x, y+4, stop.z)] = c_cap
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- spread moss/lichen/algae to nearby cobblestone
|
||||
minetest.register_abm({
|
||||
label = "Caverealms stone spread",
|
||||
nodenames = {
|
||||
"caverealms:stone_with_moss",
|
||||
"caverealms:stone_with_lichen",
|
||||
"caverealms:stone_with_algae",
|
||||
},
|
||||
neighbors = {"air"},
|
||||
interval = 16,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local num = minetest.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
|
||||
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
|
||||
"default:cobble")
|
||||
if #num > 0 then
|
||||
minetest.set_node(num[math.random(#num)], {name = node.name})
|
||||
end
|
||||
end,
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue