From 9dd52282186256e5040fa334d0506a09ed44a298 Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Wed, 5 Sep 2018 02:01:24 +0200 Subject: [PATCH] Version MFF. --- API.txt | 0 README.md | 0 depends.txt | 0 init.lua | 30 +++++++++++++++--------------- locale/de.txt | 0 locale/fr.txt | 0 locale/template.txt | 0 locale/tr.txt | 0 8 files changed, 15 insertions(+), 15 deletions(-) mode change 100644 => 100755 API.txt mode change 100644 => 100755 README.md mode change 100644 => 100755 depends.txt mode change 100644 => 100755 init.lua mode change 100644 => 100755 locale/de.txt mode change 100644 => 100755 locale/fr.txt mode change 100644 => 100755 locale/template.txt mode change 100644 => 100755 locale/tr.txt diff --git a/API.txt b/API.txt old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/depends.txt b/depends.txt old mode 100644 new mode 100755 diff --git a/init.lua b/init.lua old mode 100644 new mode 100755 index 01a17d2..e564984 --- a/init.lua +++ b/init.lua @@ -44,7 +44,7 @@ local DEBUG = false --... except if you want to spam the console with debugging function biome_lib:dbg(msg) if DEBUG then - print("[Plantlife] "..msg) + minetest.log("info", "[Plantlife] "..msg) minetest.log("verbose", "[Plantlife] "..msg) end end @@ -142,7 +142,7 @@ function biome_lib:register_generate_plant(biomedef, nodes_or_function_or_model) biome_lib:dbg("Warning: Registered function call using deprecated string method: "..dump(nodes_or_function_or_model)) end - if biomedef.check_air == false then + if biomedef.check_air == false then biome_lib:dbg("Register no-air-check mapgen hook: "..dump(nodes_or_function_or_model)) biome_lib.actionslist_no_aircheck[#biome_lib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model } local s = biomedef.surface @@ -218,7 +218,7 @@ function biome_lib:populate_surfaces(biome, nodes_or_function_or_model, snodes, else if string.find(biome_surfaces_string, "group:") then for j = 1, #biome.surface do - if string.find(biome.surface[j], "^group:") + if string.find(biome.surface[j], "^group:") and minetest.get_item_group(dest_node.name, biome.surface[j]) then surface_ok = true break @@ -289,7 +289,7 @@ function biome_lib:populate_surfaces(biome, nodes_or_function_or_model, snodes, if objtype == "table" then if nodes_or_function_or_model.axiom then - biome_lib:generate_tree(pos, nodes_or_function_or_model) + biome_lib:generate_tree(p_top, nodes_or_function_or_model) spawned = true else local fdir = nil @@ -448,8 +448,8 @@ end) -- to prevent unpopulated map areas minetest.register_on_shutdown(function() - print("[biome_lib] Stand by, playing out the rest of the aircheck mapblock log") - print("(there are "..#biome_lib.blocklist_aircheck.." entries)...") + minetest.log("action", "[biome_lib] Stand by, playing out the rest of the aircheck mapblock log") + minetest.log("action", "(there are "..#biome_lib.blocklist_aircheck.." entries)...") while true do biome_lib:generate_block_with_air_checking(0.1) if #biome_lib.blocklist_aircheck == 0 then return end @@ -457,8 +457,8 @@ minetest.register_on_shutdown(function() end) minetest.register_on_shutdown(function() - print("[biome_lib] Stand by, playing out the rest of the no-aircheck mapblock log") - print("(there are "..#biome_lib.blocklist_aircheck.." entries)...") + minetest.log("action", "[biome_lib] Stand by, playing out the rest of the no-aircheck mapblock log") + minetest.log("action", "(there are "..#biome_lib.blocklist_aircheck.." entries)...") while true do biome_lib:generate_block_no_aircheck(0.1) if #biome_lib.blocklist_no_aircheck == 0 then return end @@ -497,13 +497,13 @@ function biome_lib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) chance = biome.spawn_chance, neighbors = biome.neighbors, action = function(pos, node, active_object_count, active_object_count_wider) - local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } local n_top = minetest.get_node(p_top) local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z}) local noise2 = biome_lib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) local noise3 = biome_lib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) - if noise1 > biome.plantlife_limit + if noise1 > biome.plantlife_limit and noise2 <= biome.temp_min and noise2 >= biome.temp_max and noise3 <= biome.humidity_min @@ -546,7 +546,7 @@ function biome_lib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) elseif biome.spawn_on_side then local onside = biome_lib:find_open_side(pos) - if onside then + if onside then minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir }) end elseif biome.spawn_on_bottom then @@ -652,7 +652,7 @@ function biome_lib:find_adjacent_wall(pos, verticals, randomflag) local verts = dump(verticals) if randomflag then local walltab = {} - + if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end @@ -728,10 +728,10 @@ function biome_lib:get_nodedef_field(nodename, fieldname) return minetest.registered_nodes[nodename][fieldname] end -print("[Biome Lib] Loaded") +minetest.log("action", "[Biome Lib] Loaded") minetest.after(0, function() - print("[Biome Lib] Registered a total of "..(#biome_lib.surfaceslist_aircheck)+(#biome_lib.surfaceslist_no_aircheck).." surface types to be evaluated, spread") - print("[Biome Lib] across "..#biome_lib.actionslist_aircheck.." actions with air-checking and "..#biome_lib.actionslist_no_aircheck.." actions without.") + minetest.log("action", "[Biome Lib] Registered a total of "..(#biome_lib.surfaceslist_aircheck)+(#biome_lib.surfaceslist_no_aircheck).." surface types to be evaluated, spread") + minetest.log("action", "[Biome Lib] across "..#biome_lib.actionslist_aircheck.." actions with air-checking and "..#biome_lib.actionslist_no_aircheck.." actions without.") end) diff --git a/locale/de.txt b/locale/de.txt old mode 100644 new mode 100755 diff --git a/locale/fr.txt b/locale/fr.txt old mode 100644 new mode 100755 diff --git a/locale/template.txt b/locale/template.txt old mode 100644 new mode 100755 diff --git a/locale/tr.txt b/locale/tr.txt old mode 100644 new mode 100755