Cooperate with underworlds mod.

This commit is contained in:
Duane Robertson 2017-01-29 19:43:17 -06:00
parent bdca26220d
commit 2186b24632
5 changed files with 161 additions and 97 deletions

View file

@ -1,5 +1,8 @@
default
bucket?
dye
flowers
vessels
mobs?
underworlds?
vessels
wooden_bucket?

View file

@ -127,6 +127,24 @@ minetest.register_craft({
}
})
minetest.register_craftitem("fun_caves:wooden_bowl", {
description = "Wooden Bowl",
drawtype = "plantlike",
paramtype = "light",
tiles = {"fun_caves_wooden_bowl.png"},
inventory_image = "fun_caves_wooden_bowl.png",
groups = {bowl = 1, dig_immediate = 3},
})
minetest.register_craft({
output = 'fun_caves:wooden_bowl 20',
recipe = {
{'group:wood', '', 'group:wood'},
{'group:wood', '', 'group:wood'},
{'', 'group:wood', ''},
},
})
minetest.register_craftitem("fun_caves:disgusting_gruel", {
description = "Disgusting Gruel",
drawtype = "plantlike",
@ -164,7 +182,7 @@ minetest.register_craft({
replacements = {
{'bucket:bucket_water', 'bucket:bucket_water'},
{'bucket:bucket_river_water', 'bucket:bucket_river_water'},
{'fun_caves:bucket_wood_water', 'fun_caves:bucket_wood_water'},
{'fun_caves:bucket_wood_river_water', 'fun_caves:bucket_wood_river_water'},
{'wooden_bucket:bucket_wood_water', 'wooden_bucket:bucket_wood_water'},
{'wooden_bucket:bucket_wood_river_water', 'wooden_bucket:bucket_wood_river_water'},
},
})

View file

@ -176,21 +176,21 @@ local function generate(p_minp, p_maxp, seed)
local csize = vector.add(vector.subtract(maxp, minp), 1)
local write
if underworlds_mod and underworlds_mod.underzones then
local avg = (minp.y + maxp.y) / 2
for _, uz in pairs(underworlds_mod.underzones) do
if avg <= uz.upper_bound and avg >= uz.lower_bound then
return
end
end
end
if fun_caves_mod.use_bi_hi then
heightmap = minetest.get_mapgen_object("heightmap")
end
-- use the same seed (based on perlin noise).
--do
-- local seed = minetest.get_perlin(seed_noise):get2d({x=minp.x, y=minp.z})
-- if not (seed and type(seed) == 'number') then
-- return
-- end
-- math.randomseed(seed)
--end
-- Correct heightmap.
if maxp.y < -300 or minp.y > 300 then
for i = 1, #heightmap do

211
nodes.lua
View file

@ -5,46 +5,59 @@
local light_max = fun_caves_mod.light_max or 10
-- black (oily) sand
local newnode = fun_caves_mod.clone_node("default:sand")
newnode.description = "Black Sand"
newnode.tiles = {"fun_caves_black_sand.png"}
newnode.groups['falling_node'] = 0
minetest.register_node("fun_caves:black_sand", newnode)
if minetest.registered_items['underworlds:black_sand'] then
minetest.register_alias("fun_caves:black_sand", 'underworlds:black_sand')
else
-- black (oily) sand
local newnode = fun_caves_mod.clone_node("default:sand")
newnode.description = "Black Sand"
newnode.tiles = {"fun_caves_black_sand.png"}
newnode.groups['falling_node'] = 0
minetest.register_node("fun_caves:black_sand", newnode)
end
-- cobble, hot - cobble with lava instead of mortar XD
minetest.register_node("fun_caves:hot_cobble", {
description = "Hot Cobble",
tiles = {"caverealms_hot_cobble.png"},
is_ground_content = true,
groups = {crumbly=2, surface_hot=3},
--light_source = 2,
damage_per_second = 1,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
if minetest.registered_items['underworlds:hot_cobble'] then
minetest.register_alias("fun_caves:hot_cobble", 'underworlds:hot_cobble')
else
-- cobble, hot - cobble with lava instead of mortar XD
minetest.register_node("fun_caves:hot_cobble", {
description = "Hot Cobble",
tiles = {"caverealms_hot_cobble.png"},
is_ground_content = true,
groups = {crumbly=2, surface_hot=3},
--light_source = 2,
damage_per_second = 1,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
end
-- Glowing fungal stone provides an eerie light.
minetest.register_node("fun_caves:glowing_fungal_stone", {
description = "Glowing Fungal Stone",
tiles = {"default_stone.png^vmg_glowing_fungal.png",},
is_ground_content = true,
light_source = light_max - 4,
groups = {cracky=3, stone=1},
drop = {items={ {items={"default:cobble"},}, {items={"fun_caves:glowing_fungus",},},},},
sounds = default.node_sound_stone_defaults(),
})
if minetest.registered_items['underworlds:glowing_fungal_stone'] then
minetest.register_alias("fun_caves:glowing_fungal_stone", 'underworlds:glowing_fungal_stone')
minetest.register_alias("fun_caves:glowing_fungus", 'underworlds:glowing_fungus')
else
-- Glowing fungal stone provides an eerie light.
minetest.register_node("fun_caves:glowing_fungal_stone", {
description = "Glowing Fungal Stone",
tiles = {"default_stone.png^vmg_glowing_fungal.png",},
is_ground_content = true,
light_source = light_max - 4,
groups = {cracky=3, stone=1},
drop = {items={ {items={"default:cobble"},}, {items={"fun_caves:glowing_fungus",},},},},
sounds = default.node_sound_stone_defaults(),
})
-- Glowing fungus grows underground.
minetest.register_craftitem("fun_caves:glowing_fungus", {
description = "Glowing Fungus",
drawtype = "plantlike",
paramtype = "light",
tiles = {"vmg_glowing_fungus.png"},
inventory_image = "vmg_glowing_fungus.png",
groups = {dig_immediate = 3},
})
-- Glowing fungus grows underground.
minetest.register_craftitem("fun_caves:glowing_fungus", {
description = "Glowing Fungus",
drawtype = "plantlike",
paramtype = "light",
tiles = {"vmg_glowing_fungus.png"},
inventory_image = "vmg_glowing_fungus.png",
groups = {dig_immediate = 3},
})
end
-- moon glass (glows)
if not minetest.registered_items['elixirs:moon_glass'] then
@ -167,6 +180,25 @@ newnode.tiles = {"fun_caves_radioactive_ore.png"}
newnode.light_source = 4
minetest.register_node("fun_caves:radioactive_ore", newnode)
if minetest.registered_items['underworlds:thin_ice'] then
minetest.register_alias("fun_caves:thin_ice", 'underworlds:thin_ice')
else
-- ice, thin -- transparent
minetest.register_node("fun_caves:thin_ice", {
description = "Thin Ice",
tiles = {"caverealms_thin_ice.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_glass_defaults(),
use_texture_alpha = true,
light_source = 1,
drawtype = "glasslike",
sunlight_propagates = true,
freezemelt = "default:water_source",
paramtype = "light",
})
end
-- What's a cave without speleothems?
local spel = {
{type1="stalactite", type2="stalagmite", tile="default_stone.png"},
@ -175,42 +207,49 @@ local spel = {
{type1="icicle_down", type2="icicle_up", desc="Icicle", tile="caverealms_thin_ice.png", drop="default:ice"},
}
for _, desc in pairs(spel) do
minetest.register_node("fun_caves:"..desc.type1, {
description = (desc.desc or "Stalactite"),
tiles = {desc.tile},
is_ground_content = true,
walkable = false,
paramtype = "light",
drop = (desc.drop or "fun_caves:stalactite"),
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.07, 0.0, -0.07, 0.07, 0.5, 0.07},
{-0.04, -0.25, -0.04, 0.04, 0.0, 0.04},
{-0.02, -0.5, -0.02, 0.02, 0.25, 0.02},
} },
groups = {rock=1, cracky=3},
sounds = default.node_sound_stone_defaults(),
})
if minetest.registered_items['underworlds:stalactite'] then
for _, desc in pairs(spel) do
minetest.register_alias("fun_caves:"..desc.type1, 'underworlds:'..desc.type1)
minetest.register_alias("fun_caves:"..desc.type2, 'underworlds:'..desc.type2)
end
else
for _, desc in pairs(spel) do
minetest.register_node("fun_caves:"..desc.type1, {
description = (desc.desc or "Stalactite"),
tiles = {desc.tile},
is_ground_content = true,
walkable = false,
paramtype = "light",
drop = (desc.drop or "fun_caves:stalactite"),
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.07, 0.0, -0.07, 0.07, 0.5, 0.07},
{-0.04, -0.25, -0.04, 0.04, 0.0, 0.04},
{-0.02, -0.5, -0.02, 0.02, 0.25, 0.02},
} },
groups = {rock=1, cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("fun_caves:"..desc.type2, {
description = (desc.desc or "Stalagmite"),
tiles = {desc.tile},
is_ground_content = true,
walkable = false,
paramtype = "light",
drop = "fun_caves:stalagmite",
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.07, -0.5, -0.07, 0.07, 0.0, 0.07},
{-0.04, 0.0, -0.04, 0.04, 0.25, 0.04},
{-0.02, 0.25, -0.02, 0.02, 0.5, 0.02},
} },
groups = {rock=1, cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("fun_caves:"..desc.type2, {
description = (desc.desc or "Stalagmite"),
tiles = {desc.tile},
is_ground_content = true,
walkable = false,
paramtype = "light",
drop = "fun_caves:stalagmite",
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.07, -0.5, -0.07, 0.07, 0.0, 0.07},
{-0.04, 0.0, -0.04, 0.04, 0.25, 0.04},
{-0.02, 0.25, -0.02, 0.02, 0.5, 0.02},
} },
groups = {rock=1, cracky=3},
sounds = default.node_sound_stone_defaults(),
})
end
end
-- spikes, hot -- silicon-based life
@ -265,18 +304,22 @@ newnode.sounds = default.node_sound_dirt_defaults({
})
minetest.register_node("fun_caves:stone_with_algae", newnode)
-- stone, hot
minetest.register_node("fun_caves:hot_stone", {
description = "Hot Stone",
tiles = {"default_desert_stone.png^[colorize:#FF0000:150"},
is_ground_content = true,
groups = {crumbly=2, surface_hot=3},
light_source = light_max - 5,
damage_per_second = 1,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
if minetest.registered_items['underworlds:hot_stone'] then
minetest.register_alias("fun_caves:hot_stone", 'underworlds:hot_stone')
else
-- stone, hot
minetest.register_node("fun_caves:hot_stone", {
description = "Hot Stone",
tiles = {"default_desert_stone.png^[colorize:#FF0000:150"},
is_ground_content = true,
groups = {crumbly=2, surface_hot=3},
light_source = light_max - 5,
damage_per_second = 1,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
end
-- stone with lichen
newnode = fun_caves_mod.clone_node("default:stone")

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB