From ab24dc78696b6e3042712050407662a46f194399 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Sat, 14 Nov 2015 18:01:43 +0100 Subject: [PATCH] [plantlife_modpack] Update --- .../nature_classic/blossom.lua | 6 +- .../plantlife_modpack/nature_classic/init.lua | 1 + mods/plantlife_modpack/trunks/nodes.lua | 59 ++++++++++--------- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/mods/plantlife_modpack/nature_classic/blossom.lua b/mods/plantlife_modpack/nature_classic/blossom.lua index bacde7f5..62947b5d 100755 --- a/mods/plantlife_modpack/nature_classic/blossom.lua +++ b/mods/plantlife_modpack/nature_classic/blossom.lua @@ -61,14 +61,14 @@ minetest.register_abm({ -- Spawning apples -- Limit mass changes after block has not been loaded for some time: --- spawn apples with 10% chance, but with 10 times higher frequency +-- spawn apples with 25% chance, but with 4 times higher frequency minetest.register_abm({ nodenames = { nature.blossom_node }, - interval = nature.blossom_delay / 10, + interval = nature.apple_delay / 4, chance = nature.apple_chance, action = function(pos, node, active_object_count, active_object_count_wider) - if math.random(10) == 0 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then + if math.random(4) == 1 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then spawn_apple_under(pos) end end diff --git a/mods/plantlife_modpack/nature_classic/init.lua b/mods/plantlife_modpack/nature_classic/init.lua index f88ec6ec..47fd9bff 100755 --- a/mods/plantlife_modpack/nature_classic/init.lua +++ b/mods/plantlife_modpack/nature_classic/init.lua @@ -23,6 +23,7 @@ end nature.leaves_blossom_chance = 15 nature.blossom_leaves_chance = 5 nature.blossom_delay = 3600 +nature.apple_delay = 3600 nature.apple_chance = 10 nature.apple_spread = 2 diff --git a/mods/plantlife_modpack/trunks/nodes.lua b/mods/plantlife_modpack/trunks/nodes.lua index d305c7b0..b1ab4f59 100755 --- a/mods/plantlife_modpack/trunks/nodes.lua +++ b/mods/plantlife_modpack/trunks/nodes.lua @@ -327,35 +327,40 @@ for i in pairs(TRuNKS) do local TRuNK = TRuNKS[i][2] if minetest.get_modpath(MoD) ~= nil then - local des = minetest.registered_nodes[MoD..":"..TRuNK].description + local node = minetest.registered_nodes[MoD..":"..TRuNK] + if node then + local des = node.description - minetest.register_node("trunks:"..TRuNK.."root", { - description = des.." Root", - paramtype = "light", - paramtype2 = "facedir", - tiles = { ---[[top]] MoD.."_"..TRuNK..".png", ---[[bottom]] MoD.."_"..TRuNK..".png", ---[[right]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[makealpha:0,0,0", ---[[left]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[transformFX^[makealpha:0,0,0", ---[[back]] MoD.."_"..TRuNK..".png", ---[[front]] MoD.."_"..TRuNK..".png" - }, - drawtype = "nodebox", - selection_box = {type = "fixed", fixed = roots_cube}, - node_box = {type = "fixed", fixed = roots_sheet}, - groups = { - tree_root=1, - snappy=1, - choppy=2, - oddly_breakable_by_hand=1, - flammable=2--, - --not_in_creative_inventory=1 -- atm in inv for testing - }, - --drop = "trunks:twig_1", -- not sure about this yet - sounds = default.node_sound_wood_defaults(), - }) + minetest.register_node("trunks:"..TRuNK.."root", { + description = des.." Root", + paramtype = "light", + paramtype2 = "facedir", + tiles = { +--[[top]] MoD.."_"..TRuNK..".png", +--[[bottom]] MoD.."_"..TRuNK..".png", +--[[right]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[makealpha:0,0,0", +--[[left]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[transformFX^[makealpha:0,0,0", +--[[back]] MoD.."_"..TRuNK..".png", +--[[front]] MoD.."_"..TRuNK..".png" + }, + drawtype = "nodebox", + selection_box = {type = "fixed", fixed = roots_cube}, + node_box = {type = "fixed", fixed = roots_sheet}, + groups = { + tree_root=1, + snappy=1, + choppy=2, + oddly_breakable_by_hand=1, + flammable=2--, + --not_in_creative_inventory=1 -- atm in inv for testing + }, + --drop = "trunks:twig_1", -- not sure about this yet + sounds = default.node_sound_wood_defaults(), + }) + else + print(string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK)) + end end end end