From 416400cd5f194e0c3ba9f91c64ba63ea92b08703 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sat, 13 Sep 2014 12:18:14 +0200 Subject: [PATCH] make some depends optional --- jungletree/depends.txt | 1 - sumpf/birke.lua | 2 +- sumpf/depends.txt | 6 ++--- sumpf/init.lua | 60 ++++++++++++++++++++++-------------------- 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/jungletree/depends.txt b/jungletree/depends.txt index 2b22e74..4ad96d5 100644 --- a/jungletree/depends.txt +++ b/jungletree/depends.txt @@ -1,2 +1 @@ default -habitat diff --git a/sumpf/birke.lua b/sumpf/birke.lua index 8961987..b011422 100644 --- a/sumpf/birke.lua +++ b/sumpf/birke.lua @@ -207,7 +207,7 @@ minetest.register_abm({ }) if sumpf.spawn_plants -and minetest.get_modpath("habitat") then +and habitat then habitat:generate("sumpf:sapling", {"default:dirt_with_grass"}, minp, maxp, 20, 25, 100, 500, {"default:water_source"},30,{"default:desert_sand"}) habitat:generate("sumpf:gras", {"default:dirt_with_grass"}, diff --git a/sumpf/depends.txt b/sumpf/depends.txt index 7566019..d0d86bc 100644 --- a/sumpf/depends.txt +++ b/sumpf/depends.txt @@ -1,6 +1,6 @@ default riesenpilz jungletree -habitat -bucket -stairs +bucket? +habitat? +stairs? diff --git a/sumpf/init.lua b/sumpf/init.lua index 52e08dd..5d088ad 100644 --- a/sumpf/init.lua +++ b/sumpf/init.lua @@ -93,29 +93,31 @@ minetest.register_node("sumpf:sumpf2", { ----------------------stairs and slabs------------------ -stairs.register_stair_and_slab("swampstone", "sumpf:junglestone", - {cracky=3}, - {"sumpf_swampstone.png"}, - "Swamp Stone Stair", - "Swamp Stone Slab", - default.node_sound_stone_defaults() -) +if stairs then + stairs.register_stair_and_slab("swampstone", "sumpf:junglestone", + {cracky=3}, + {"sumpf_swampstone.png"}, + "Swamp Stone Stair", + "Swamp Stone Slab", + default.node_sound_stone_defaults() + ) -stairs.register_stair_and_slab("swampcobble", "sumpf:cobble", - {cracky=3}, - {"sumpf_cobble.png"}, - "Swamp Cobble Stone Stair", - "Swamp Cobble Stone Slab", - default.node_sound_stone_defaults() -) + stairs.register_stair_and_slab("swampcobble", "sumpf:cobble", + {cracky=3}, + {"sumpf_cobble.png"}, + "Swamp Cobble Stone Stair", + "Swamp Cobble Stone Slab", + default.node_sound_stone_defaults() + ) -stairs.register_stair_and_slab("swampstonebrick", "sumpf:junglestonebrick", - {cracky=2, stone=1}, - {"sumpf_swampstone_brick.png"}, - "Swamp Stone Brick Stair", - "Swamp Stone Brick Slab", - default.node_sound_stone_defaults() -) + stairs.register_stair_and_slab("swampstonebrick", "sumpf:junglestonebrick", + {cracky=2, stone=1}, + {"sumpf_swampstone_brick.png"}, + "Swamp Stone Brick Stair", + "Swamp Stone Brick Slab", + default.node_sound_stone_defaults() + ) +end --------------------------------------------------------- @@ -180,13 +182,15 @@ minetest.register_node("sumpf:dirtywater_source", { groups = {water=3, liquid=3, puts_out_fire=1}, }) -bucket.register_liquid( - "sumpf:dirtywater_source", - "sumpf:dirtywater_flowing", - "sumpf:bucket_dirtywater", - "bucket.png^sumpf_bucket_dirtywater.png", - "Swampwater Bucket" -) +if bucket then + bucket.register_liquid( + "sumpf:dirtywater_source", + "sumpf:dirtywater_flowing", + "sumpf:bucket_dirtywater", + "bucket.png^sumpf_bucket_dirtywater.png", + "Swampwater Bucket" + ) +end sumpf = {}