diff --git a/jungletree/init.lua b/jungletree/init.lua index db88abe..dd65f2b 100644 --- a/jungletree/init.lua +++ b/jungletree/init.lua @@ -150,14 +150,31 @@ function sumpf_make_jungletree(pos) end end end -minetest.register_abm({ +--[[minetest.register_abm({ nodenames = {"jungletree:sapling"}, interval = 1, chance = 1, action = function(pos) sumpf_make_jungletree(pos) end +})]] + +minetest.register_abm({ + nodenames = {"jungletree:sapling"}, + neighbors = {"group:soil"}, + interval = 40, + chance = 5, + action = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") ~= 1 + or not minetest.get_node_light(pos) then + return + end + if minetest.env:get_node_light(pos, nil) > 6 then + sumpf_make_jungletree(pos) + end + end }) + --[[ minetest.register_craft({ output = 'default:wood 4', diff --git a/sumpf/birke.lua b/sumpf/birke.lua index ba12d1c..d77794d 100644 --- a/sumpf/birke.lua +++ b/sumpf/birke.lua @@ -21,6 +21,9 @@ minetest.register_node("sumpf:birk", { on_construct = function(pos) mache_birke(pos) end, + on_use = function() + mache_birke(pos) + end, }) minetest.register_node("sumpf:leaves", { @@ -143,15 +146,19 @@ end minetest.register_abm({ nodenames = {"sumpf:sapling"}, - interval = 10, - chance = 16, + neighbors = {"group:soil"}, + interval = 20, + chance = 8, action = function(pos) - if minetest.env:find_node_near(pos, 1, "group:crumbly") - and minetest.env:get_node_light(pos, nil) > 7 then + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") ~= 1 + or not minetest.get_node_light(pos) then + return + end + if minetest.env:get_node_light(pos, nil) > 7 then mache_birke(pos) end end -,}) +}) if sumpf.spawn_plants and minetest.get_modpath("habitat") then diff --git a/sumpf/init.lua b/sumpf/init.lua index 9e39838..ba25505 100644 --- a/sumpf/init.lua +++ b/sumpf/init.lua @@ -46,7 +46,7 @@ minetest.register_node("sumpf:junglestonebrick", { minetest.register_node("sumpf:peat", { description = "Peat", tiles = {"sumpf_peat.png"}, - groups = {crumbly=3, falling_node=1, sand=1}, + groups = {crumbly=3, falling_node=1, sand=1, soil=1}, sounds = default.node_sound_sand_defaults({ footstep = {name="sumpf", gain=0.4}, place = {name="sumpf", gain=0.4}, @@ -74,7 +74,7 @@ minetest.register_node("sumpf:eisen", { minetest.register_node("sumpf:sumpf", { description = "Swamp", tiles = {"sumpf.png"}, - groups = {crumbly=3}, + groups = {crumbly=3, soil=1}, sounds = default.node_sound_dirt_defaults({ footstep = {name="sumpf", gain=0.4}, }), @@ -82,7 +82,7 @@ minetest.register_node("sumpf:sumpf", { minetest.register_node("sumpf:sumpf2", { tiles = {"sumpf.png","sumpf_swampstone.png","sumpf_swampstone.png^sumpf2.png"}, - groups = {cracky=3}, + groups = {cracky=3, soil=1}, drop = "sumpf:junglestone", sounds = default.node_sound_stone_defaults({ footstep = {name="sumpf", gain=0.4}, @@ -138,13 +138,15 @@ minetest.register_node("sumpf:dirtywater_flowing", { tiles = {"default_water.png"}, special_tiles = { {name="sumpfwasser2.png", backface_culling=false, animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1}}, - {name="sumpfwasser2.png", backface_culling=true, animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1}},}, + {name="sumpfwasser2.png", backface_culling=true, animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1}} + }, alpha = WATER_ALPHA, paramtype = "light", walkable = false, pointable = false, diggable = false, buildable_to = true, + drop = "", liquidtype = "flowing", liquid_alternative_flowing = "sumpf:dirtywater_flowing", liquid_alternative_source = "sumpf:dirtywater_source", @@ -156,7 +158,11 @@ minetest.register_node("sumpf:dirtywater_flowing", { minetest.register_node("sumpf:dirtywater_source", { description = "Swampwater", drawtype = "liquid", - tiles = {{name="sumpfwasser.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}}}, + tiles = { + {name="sumpfwasser.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}}, + {name="sumpfwasser.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}}, + {name="sumpfwasser2.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}} + }, special_tiles = {{name="sumpfwasser.png", backface_culling=false},}, alpha = WATER_ALPHA, paramtype = "light", diff --git a/sumpf/mapgen.lua b/sumpf/mapgen.lua index e80c6da..d964149 100644 --- a/sumpf/mapgen.lua +++ b/sumpf/mapgen.lua @@ -77,7 +77,7 @@ minetest.register_on_generated(function(minp, maxp, seed) --Information: if sumpf.info then - local geninfo = "[sumpf] tries to generate a swamp at: x=["..minp.x.."; "..maxp.x.."]; z=["..minp.z.."; "..maxp.z.."]" + local geninfo = "[sumpf] tries to generate a swamp at: x=["..minp.x.."; "..maxp.x.."]; y=["..minp.y.."; "..maxp.y.."]; z=["..minp.z.."; "..maxp.z.."]" print(geninfo) minetest.chat_send_all(geninfo) end diff --git a/sumpf/sounds/sumpf.7.ogg b/sumpf/rest/sumpf.7.ogg similarity index 100% rename from sumpf/sounds/sumpf.7.ogg rename to sumpf/rest/sumpf.7.ogg diff --git a/sumpf/sounds/sumpf.8.ogg b/sumpf/rest/sumpf.8.ogg similarity index 100% rename from sumpf/sounds/sumpf.8.ogg rename to sumpf/rest/sumpf.8.ogg diff --git a/sumpf/textures_16x16/birke_leaves.png b/sumpf/rest/textures_16x16/birke_leaves.png similarity index 100% rename from sumpf/textures_16x16/birke_leaves.png rename to sumpf/rest/textures_16x16/birke_leaves.png diff --git a/sumpf/textures_16x16/birke_mossytree.png b/sumpf/rest/textures_16x16/birke_mossytree.png similarity index 100% rename from sumpf/textures_16x16/birke_mossytree.png rename to sumpf/rest/textures_16x16/birke_mossytree.png diff --git a/sumpf/textures_16x16/birke_sapling.png b/sumpf/rest/textures_16x16/birke_sapling.png similarity index 100% rename from sumpf/textures_16x16/birke_sapling.png rename to sumpf/rest/textures_16x16/birke_sapling.png diff --git a/sumpf/textures_16x16/birke_tree.png b/sumpf/rest/textures_16x16/birke_tree.png similarity index 100% rename from sumpf/textures_16x16/birke_tree.png rename to sumpf/rest/textures_16x16/birke_tree.png diff --git a/sumpf/textures_16x16/sumpfgrass.png b/sumpf/rest/textures_16x16/sumpfgrass.png similarity index 100% rename from sumpf/textures_16x16/sumpfgrass.png rename to sumpf/rest/textures_16x16/sumpfgrass.png diff --git a/sumpf/textures_alternative/sumpf2.png b/sumpf/rest/textures_alternative/sumpf2.png similarity index 100% rename from sumpf/textures_alternative/sumpf2.png rename to sumpf/rest/textures_alternative/sumpf2.png diff --git a/sumpf/textures_alternative/sumpf_leaves_test.png b/sumpf/rest/textures_alternative/sumpf_leaves_test.png similarity index 100% rename from sumpf/textures_alternative/sumpf_leaves_test.png rename to sumpf/rest/textures_alternative/sumpf_leaves_test.png diff --git a/sumpf/textures_alternative/sumpf_pilz_item.png b/sumpf/rest/textures_alternative/sumpf_pilz_item.png similarity index 100% rename from sumpf/textures_alternative/sumpf_pilz_item.png rename to sumpf/rest/textures_alternative/sumpf_pilz_item.png diff --git a/sumpf/textures_alternative/sumpf_pilz_item2.png b/sumpf/rest/textures_alternative/sumpf_pilz_item2.png similarity index 100% rename from sumpf/textures_alternative/sumpf_pilz_item2.png rename to sumpf/rest/textures_alternative/sumpf_pilz_item2.png diff --git a/sumpf/textures_alternative/sumpf_pilz_oben.png b/sumpf/rest/textures_alternative/sumpf_pilz_oben.png similarity index 100% rename from sumpf/textures_alternative/sumpf_pilz_oben.png rename to sumpf/rest/textures_alternative/sumpf_pilz_oben.png diff --git a/sumpf/textures_alternative/sumpf_pilz_seite.png b/sumpf/rest/textures_alternative/sumpf_pilz_seite.png similarity index 100% rename from sumpf/textures_alternative/sumpf_pilz_seite.png rename to sumpf/rest/textures_alternative/sumpf_pilz_seite.png diff --git a/sumpf/textures_alternative/sumpf_pilz_unten.png b/sumpf/rest/textures_alternative/sumpf_pilz_unten.png similarity index 100% rename from sumpf/textures_alternative/sumpf_pilz_unten.png rename to sumpf/rest/textures_alternative/sumpf_pilz_unten.png diff --git a/sumpf/textures_alternative/sumpf_swampstone_tree_test.png b/sumpf/rest/textures_alternative/sumpf_swampstone_tree_test.png similarity index 100% rename from sumpf/textures_alternative/sumpf_swampstone_tree_test.png rename to sumpf/rest/textures_alternative/sumpf_swampstone_tree_test.png diff --git a/sumpf/textures_alternative/sumpf_swampstone_tree_top_test.png b/sumpf/rest/textures_alternative/sumpf_swampstone_tree_top_test.png similarity index 100% rename from sumpf/textures_alternative/sumpf_swampstone_tree_top_test.png rename to sumpf/rest/textures_alternative/sumpf_swampstone_tree_top_test.png diff --git a/sumpf/textures_alternative/sumpfstein.png b/sumpf/rest/textures_alternative/sumpfstein.png similarity index 100% rename from sumpf/textures_alternative/sumpfstein.png rename to sumpf/rest/textures_alternative/sumpfstein.png diff --git a/sumpf/textures/sumpf_peat.png b/sumpf/textures/sumpf_peat.png index 0d9f099..bc4d953 100644 Binary files a/sumpf/textures/sumpf_peat.png and b/sumpf/textures/sumpf_peat.png differ