From 2186b24632e7e45762664a31c62e26946267b5ed Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Sun, 29 Jan 2017 19:43:17 -0600 Subject: [PATCH] Cooperate with underworlds mod. --- depends.txt | 5 +- fungal_tree.lua | 22 ++- mapgen.lua | 20 +-- nodes.lua | 211 +++++++++++++++++------------ textures/fun_caves_wooden_bowl.png | Bin 0 -> 2993 bytes 5 files changed, 161 insertions(+), 97 deletions(-) create mode 100644 textures/fun_caves_wooden_bowl.png diff --git a/depends.txt b/depends.txt index d1dd7b5..d679a20 100644 --- a/depends.txt +++ b/depends.txt @@ -1,5 +1,8 @@ default +bucket? dye flowers -vessels mobs? +underworlds? +vessels +wooden_bucket? diff --git a/fungal_tree.lua b/fungal_tree.lua index 03e7432..1b0c61b 100644 --- a/fungal_tree.lua +++ b/fungal_tree.lua @@ -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'}, }, }) diff --git a/mapgen.lua b/mapgen.lua index 7013874..4a05d36 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -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 diff --git a/nodes.lua b/nodes.lua index d4a31b8..55d1ff3 100644 --- a/nodes.lua +++ b/nodes.lua @@ -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") diff --git a/textures/fun_caves_wooden_bowl.png b/textures/fun_caves_wooden_bowl.png new file mode 100644 index 0000000000000000000000000000000000000000..5169fdff4a0cda3b57a74d47b64067495b3c0c32 GIT binary patch literal 2993 zcmV;i3r_TjP)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%ZRYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S z1Au6Q;m>#f??3%Vpd|o+W=WE9003S@Bra6Svp>fO002awfhw>;8}z{#EWidF!3EsG z3;bXU&9EIRU@z1_9W=mEXoiz;4lcq~xDGvV5BgyU zp1~-*fe8db$Osc*A=-!mVv1NJjtCc-h4>-CNCXm#Bp}I%6j35eku^v$Qi@a{RY)E3 zJ#qp$hg?Rwkvqr$GJ^buyhkyVfwECO)C{#lxu`c9ghrwZ&}4KmnvWKso6vH!8a<3Q zq36)6Xb;+tK10Vaz~~qUGsJ8#F2=(`u{bOVlVi)VBCHIn#u~6ztOL7=^<&SmcLWlF zMZgI*1b0FpVIDz9SWH+>*hr`#93(Um+6gxa1B6k+CnA%mOSC4s5&6UzVlpv@SV$}* z))J2sFA#f(L&P^E5{W}HC%KRU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