From 7670c1da9274901f57f6682384af2b3bae005a86 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 28 Jul 2021 15:12:53 +0100 Subject: [PATCH] make doors and stairs soft dependencies, fill willow recipes (thanks sangeet) --- README.md | 1 + depends.txt | 4 ++-- fences.lua | 51 +++++++++++++++++++++++++++---------------------- lucky_block.lua | 12 ++++++------ mod.conf | 4 ++-- stairs.lua | 3 ++- 6 files changed, 41 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index f6e72c0..215912f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Ethereal Mapgen mod for Minetest (works on all except v6) - Use "stratum" to generate mesa biome for stripey goodness - Added coloured candles (thanks wRothbard) - Rename some biomes to fall inline with default for spawning + - Make stairs and doors a soft dependency, fix willow recipes (thanks sangeet) ### 1.28 diff --git a/depends.txt b/depends.txt index da7e44b..af45071 100644 --- a/depends.txt +++ b/depends.txt @@ -1,8 +1,8 @@ default farming? -stairs +stairs? flowers -doors +doors? bakedclay? moreblocks? intllib? diff --git a/fences.lua b/fences.lua index 56db90c..bb00a8d 100644 --- a/fences.lua +++ b/fences.lua @@ -1,6 +1,8 @@ local S = ethereal.intllib +local door_mod = minetest.get_modpath("doors") + local add_fence = function(name, node, desc, texture) @@ -27,7 +29,7 @@ local add_fence = function(name, node, desc, texture) }) end - if doors.register_fencegate then + if door_mod and doors.register_fencegate then doors.register_fencegate("ethereal:fencegate_" .. name, { description = S(desc .. " Fence Gate"), @@ -51,7 +53,7 @@ end add_fence("scorched", "scorched_tree", "Scorched", "ethereal_scorched_tree") add_fence("frostwood", "frost_wood", "Frost", "ethereal_frost_wood") add_fence("redwood", "redwood_wood", "Redwood", "ethereal_redwood_wood") -add_fence("willow", "willow", "Willow", "ethereal_willow_wood") +add_fence("willow", "willow_wood", "Willow", "ethereal_willow_wood") add_fence("yellowwood", "yellow_wood", "Healing Wood", "ethereal_yellow_wood") add_fence("palm", "palm_wood", "Palm", "moretrees_palm_wood") add_fence("banana", "banana_wood", "Banana Wood", "ethereal_banana_wood") @@ -75,25 +77,28 @@ minetest.register_alias("ethereal:fencegate_pine_closed", "doors:gate_pine_wood_ -- sakura door -doors.register_door("ethereal:door_sakura", { - tiles = { - {name = "ethereal_sakura_door.png", backface_culling = true} - }, - description = S("Sakura Wood Door"), - inventory_image = "ethereal_sakura_door_inv.png", - groups = { - snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, - flammable = 2 - }, - sound_open = "doors_glass_door_open", - sound_close = "doors_glass_door_close", - recipe = { - {"group:stick", "default:paper"}, - {"default:paper", "group:stick"}, - {"ethereal:sakura_wood", "ethereal:sakura_wood"} - } -}) +if door_mod then -minetest.register_alias("ethereal:sakura_door", "ethereal:door_sakura") -minetest.register_alias("ethereal:sakura_door_a", "ethereal:door_sakura_a") -minetest.register_alias("ethereal:sakura_door_b", "ethereal:door_sakura_b") + doors.register_door("ethereal:door_sakura", { + tiles = { + {name = "ethereal_sakura_door.png", backface_culling = true} + }, + description = S("Sakura Wood Door"), + inventory_image = "ethereal_sakura_door_inv.png", + groups = { + snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, + flammable = 2 + }, + sound_open = "doors_glass_door_open", + sound_close = "doors_glass_door_close", + recipe = { + {"group:stick", "default:paper"}, + {"default:paper", "group:stick"}, + {"ethereal:sakura_wood", "ethereal:sakura_wood"} + } + }) + + minetest.register_alias("ethereal:sakura_door", "ethereal:door_sakura") + minetest.register_alias("ethereal:sakura_door_a", "ethereal:door_sakura_a") + minetest.register_alias("ethereal:sakura_door_b", "ethereal:door_sakura_b") +end diff --git a/lucky_block.lua b/lucky_block.lua index c0b4b7a..e0dd2f4 100644 --- a/lucky_block.lua +++ b/lucky_block.lua @@ -10,7 +10,7 @@ lucky_block:add_schematics({ {"palmtree", ethereal.palmtree, {x = 4, y = 0, z = 4}}, {"bananatree", ethereal.bananatree, {x = 3, y = 0, z = 3}}, {"orangetree", ethereal.orangetree, {x = 2, y = 0, z = 2}}, - {"birchtree", ethereal.birchtree, {x = 2, y = 0, z = 2}}, + {"birchtree", ethereal.birchtree, {x = 2, y = 0, z = 2}} }) lucky_block:add_blocks({ @@ -68,7 +68,7 @@ lucky_block:add_blocks({ {name = "ethereal:sakura_sapling", max = 10}, {name = "ethereal:willow_sapling", max = 10}, {name = "ethereal:lemon_tree_sapling", max = 10}, - {name = "ethereal:olive_tree_sapling", max = 10}, + {name = "ethereal:olive_tree_sapling", max = 10} }}, {"flo", 5, {"ethereal:blue_marble_tile"}, 2}, {"dro", {"ethereal:blue_marble", "ethereal:blue_marble_tile"}, 8}, @@ -88,9 +88,9 @@ lucky_block:add_blocks({ {name = "ethereal:fish_angler", max = 7}, {name = "ethereal:fish_piranha", max = 7}, {name = "ethereal:fishing_rod", max = 1}, - {name = "ethereal:worm", max = 10}, + {name = "ethereal:worm", max = 10} }}, - {"dro", {"ethereal:lemon"}, 9}, + {"dro", {"ethereal:lemon"}, 9} }) if minetest.get_modpath("3d_armor") then @@ -99,14 +99,14 @@ lucky_block:add_blocks({ {"dro", {"3d_armor:chestplate_crystal"}}, {"dro", {"3d_armor:leggings_crystal"}}, {"dro", {"3d_armor:boots_crystal"}}, - {"lig"}, + {"lig"} }) end if minetest.get_modpath("shields") then lucky_block:add_blocks({ {"dro", {"shields:shield_crystal"}}, - {"exp"}, + {"exp"} }) end diff --git a/mod.conf b/mod.conf index 2da3e11..09773f4 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = ethereal -depends = default, stairs, flowers, doors -optional_depends = farming, bakedclay, moreblocks, intllib, lucky_block, toolranks +depends = default, flowers +optional_depends = stairs, doors, farming, bakedclay, moreblocks, intllib, lucky_block, toolranks description = Ethereal mod uses the v7 mapgen to add many new biomes to the world. diff --git a/stairs.lua b/stairs.lua index e5551e9..9519e6f 100644 --- a/stairs.lua +++ b/stairs.lua @@ -3,7 +3,8 @@ local S = ethereal.intllib -- stair mods active -local stairs_redo = stairs and stairs.mod and stairs.mod == "redo" +local stairs_mod = minetest.get_modpath("stairs") +local stairs_redo = stairs_mod and stairs.mod and stairs.mod == "redo" local stairs_plus = minetest.global_exists("stairsplus") -- stair selection function