mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
Extended cherry trees' growing ABM to default:mg_cherry_sapling
- Solves #152 - Replaced all print calls by minetest.log in biome_lib
This commit is contained in:
parent
07e6c4ae88
commit
aa938b0699
@ -420,7 +420,7 @@ function default.grow_cherry_tree(pos, is_apple_tree, trunk_node, leaves_node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"default:cherry_sapling"},
|
nodenames = {"default:cherry_sapling", "default:mg_cherry_sapling"},
|
||||||
interval = 80,
|
interval = 80,
|
||||||
chance = 3,
|
chance = 3,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
biome_lib = {}
|
biome_lib = {}
|
||||||
|
|
||||||
plantslib = setmetatable({}, { __index=function(t,k) print("Use of deprecated function:", k) return biomes_lib[k] end })
|
plantslib = setmetatable({}, { __index=function(t,k) minetest.log("warning", "Use of deprecated function:", k) return biomes_lib[k] end })
|
||||||
|
|
||||||
biome_lib.blocklist_aircheck = {}
|
biome_lib.blocklist_aircheck = {}
|
||||||
biome_lib.blocklist_no_aircheck = {}
|
biome_lib.blocklist_no_aircheck = {}
|
||||||
@ -44,7 +44,7 @@ local DEBUG = false --... except if you want to spam the console with debugging
|
|||||||
|
|
||||||
function biome_lib:dbg(msg)
|
function biome_lib:dbg(msg)
|
||||||
if DEBUG then
|
if DEBUG then
|
||||||
print("[Plantlife] "..msg)
|
minetest.log("info", "[Plantlife] "..msg)
|
||||||
minetest.log("verbose", "[Plantlife] "..msg)
|
minetest.log("verbose", "[Plantlife] "..msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -448,8 +448,8 @@ end)
|
|||||||
-- to prevent unpopulated map areas
|
-- to prevent unpopulated map areas
|
||||||
|
|
||||||
minetest.register_on_shutdown(function()
|
minetest.register_on_shutdown(function()
|
||||||
print("[biome_lib] Stand by, playing out the rest of the aircheck mapblock log")
|
minetest.log("action", "[biome_lib] Stand by, playing out the rest of the aircheck mapblock log")
|
||||||
print("(there are "..#biome_lib.blocklist_aircheck.." entries)...")
|
minetest.log("action", "(there are "..#biome_lib.blocklist_aircheck.." entries)...")
|
||||||
while true do
|
while true do
|
||||||
biome_lib:generate_block_with_air_checking(0.1)
|
biome_lib:generate_block_with_air_checking(0.1)
|
||||||
if #biome_lib.blocklist_aircheck == 0 then return end
|
if #biome_lib.blocklist_aircheck == 0 then return end
|
||||||
@ -457,8 +457,8 @@ minetest.register_on_shutdown(function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_shutdown(function()
|
minetest.register_on_shutdown(function()
|
||||||
print("[biome_lib] Stand by, playing out the rest of the no-aircheck mapblock log")
|
minetest.log("action", "[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", "(there are "..#biome_lib.blocklist_aircheck.." entries)...")
|
||||||
while true do
|
while true do
|
||||||
biome_lib:generate_block_no_aircheck(0.1)
|
biome_lib:generate_block_no_aircheck(0.1)
|
||||||
if #biome_lib.blocklist_no_aircheck == 0 then return end
|
if #biome_lib.blocklist_no_aircheck == 0 then return end
|
||||||
@ -728,10 +728,10 @@ function biome_lib:get_nodedef_field(nodename, fieldname)
|
|||||||
return minetest.registered_nodes[nodename][fieldname]
|
return minetest.registered_nodes[nodename][fieldname]
|
||||||
end
|
end
|
||||||
|
|
||||||
print("[Biome Lib] Loaded")
|
minetest.log("action", "[Biome Lib] Loaded")
|
||||||
|
|
||||||
minetest.after(0, function()
|
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")
|
minetest.log("action", "[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] across "..#biome_lib.actionslist_aircheck.." actions with air-checking and "..#biome_lib.actionslist_no_aircheck.." actions without.")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user