From 89c4f49750a41c2f20571f63204acec41bd876ad Mon Sep 17 00:00:00 2001 From: alek13 Date: Thu, 29 Feb 2024 18:16:55 +0300 Subject: [PATCH] Wooden: refactoring `lottplants`: reorganize code & files. Relates to #1237 #1238 --- mods/lord/Blocks/lottplants/init.lua | 166 +- mods/lord/Blocks/lottplants/src/herbs.lua | 136 ++ mods/lord/Blocks/lottplants/src/nodes.lua | 1392 +---------------- mods/lord/Blocks/lottplants/src/trees.lua | 8 + .../Blocks/lottplants/src/trees/fruits.lua | 50 + .../Blocks/lottplants/src/trees/leaves.lua | 568 +++++++ .../lottplants/src/trees/leaves/decay.lua | 66 + .../Blocks/lottplants/src/trees/saplings.lua | 272 ++++ .../saplings/grow_functions.lua} | 66 +- .../Blocks/lottplants/src/trees/trunks.lua | 196 +++ .../lottplants/src/trees/trunks/slabs.lua | 89 ++ 11 files changed, 1476 insertions(+), 1533 deletions(-) create mode 100644 mods/lord/Blocks/lottplants/src/herbs.lua create mode 100644 mods/lord/Blocks/lottplants/src/trees.lua create mode 100644 mods/lord/Blocks/lottplants/src/trees/fruits.lua create mode 100644 mods/lord/Blocks/lottplants/src/trees/leaves.lua create mode 100644 mods/lord/Blocks/lottplants/src/trees/leaves/decay.lua create mode 100644 mods/lord/Blocks/lottplants/src/trees/saplings.lua rename mods/lord/Blocks/lottplants/src/{functions.lua => trees/saplings/grow_functions.lua} (95%) create mode 100644 mods/lord/Blocks/lottplants/src/trees/trunks.lua create mode 100644 mods/lord/Blocks/lottplants/src/trees/trunks/slabs.lua diff --git a/mods/lord/Blocks/lottplants/init.lua b/mods/lord/Blocks/lottplants/init.lua index 92cc809ea..f4703f589 100644 --- a/mods/lord/Blocks/lottplants/init.lua +++ b/mods/lord/Blocks/lottplants/init.lua @@ -3,169 +3,13 @@ local old_require = require require = function(name) return dofile(mod_path .. "/src/" .. name:gsub("%.", "/") .. ".lua") end -local S = minetest.get_translator("lottplants") - -require("nodes") +require("trees") require("wild_crops") require("flowers") - --- ===== GROWING TIME ===== --- 67 11 --- ольха -ALDINT = 67 -ALDCHA = 11 - --- яблоня -APPINT = 67 -APPCHA = 11 - --- берёза -BIRINT = 67 -BIRCHA = 11 - --- бук -BEEINT = 67 -BEECHA = 11 - --- кулумальда -CULINT = 67 -CULCHA = 11 - --- вяз -ELMINT = 67 -ELMCHA = 11 - --- ель -FIRINT = 67 -FIRCHA = 11 - --- лебетрон -LEBINT = 67 -LEBCHA = 11 - --- малорн -MALINT = 67 -MALCHA = 11 - --- лихолесье -MIRINT = 67 -MIRCHA = 11 - --- сосна -PININT = 67 -PINCHA = 11 - --- слива -PLUINT = 67 -PLUCHA = 11 - --- рябина -ROWINT = 67 -ROWCHA = 11 - --- белое дерево -WHIINT = 67 -WHICHA = 11 - --- йаванамирэ -YAVINT = 67 -YAVCHA = 11 - -require("functions") - -minetest.register_node("lottplants:brambles_of_mordor", { - description = S("Brambles Of Mordor"), - drawtype = "plantlike", - tiles = { "lottplants_brambles_of_mordor.png" }, - inventory_image = "lottplants_brambles_of_mordor.png", - wield_image = "lottplants_brambles_of_mordor.png", - sunlight_propagates = true, - paramtype = "light", - paramtype2 = "meshoptions", - place_param2 = 42, - walkable = false, - waving = 1, - buildable_to = true, - groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_grey=1, grass=1}, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, - }, -}) - -minetest.register_node("lottplants:pilinehtar", { - description = S("Pilinehtar"), - drawtype = "plantlike", - tiles = { "lottplants_pilinehtar.png" }, - inventory_image = "lottplants_pilinehtar.png", - wield_image = "lottplants_pilinehtar.png", - sunlight_propagates = true, - paramtype = "light", - paramtype2 = "meshoptions", - place_param2 = 2, - waving = 1, - walkable = false, - buildable_to = true, - groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_green=1, grass=1}, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, - }, -}) - -minetest.register_abm({ - nodenames = {"group:flora"}, - neighbors = {"default:dirt_with_grass", "default:desert_sand"}, - interval = 50, - chance = 25, - action = function(pos, node) - pos.y = pos.y - 1 - local under = minetest.get_node(pos) - pos.y = pos.y + 1 - if under.name == "default:desert_sand" then - minetest.set_node(pos, {name="lottplants:brambles_of_mordor"}) - elseif under.name ~= "default:dirt_with_grass" then - return - end - - local light = minetest.get_node_light(pos) - if not light or light < 13 then - return - end - - local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4} - local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4} - if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then - return - end - - local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora") - if #flowers > 3 then - return - end - - local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass") - if #seedling > 0 then - seedling = seedling[math.random(#seedling)] - seedling.y = seedling.y + 1 - light = minetest.get_node_light(seedling) - if not light or light < 13 then - return - end - if minetest.get_node(seedling).name == "air" then - minetest.set_node(seedling, {name=node.name}) - end - end - end, -}) - -minetest.register_craftitem("lottplants:honey", { - description = S("Honey"), - inventory_image = "lottplants_honey.png", - on_use = minetest.item_eat(1), -}) +require("herbs") +require("nodes") +--- @type lottplants.Planks_API +_G.planks = require('planks') require = old_require diff --git a/mods/lord/Blocks/lottplants/src/herbs.lua b/mods/lord/Blocks/lottplants/src/herbs.lua new file mode 100644 index 000000000..f6f5b3e3b --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/herbs.lua @@ -0,0 +1,136 @@ +local S = minetest.get_translator("lottplants") + + +--Lorien grass +minetest.register_node("lottplants:lorien_grass_1", { + description = S("Lorien Grass"), + drawtype = "plantlike", + tiles = { "lottplants_lorien_grass_1.png" }, + -- use a bigger inventory image + inventory_image = "lottplants_lorien_grass_3.png", + wield_image = "lottplants_lorien_grass_3.png", + paramtype = "light", + waving = 1, + walkable = false, + is_ground_content = true, + buildable_to = true, + groups = { + snappy = 3, flammable = 3, flora = 1, attached_node = 1, grass = 1, color_green = 1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, + }, + on_place = function(itemstack, placer, pointed_thing) + -- place a random grass node + local stack = ItemStack("lottplants:lorien_grass_" .. math.random(1, 5)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("lottplants:lorien_grass_1 " .. itemstack:get_count() - (1 - ret:get_count())) + end, +}) +minetest.register_node("lottplants:lorien_grass_2", { + description = S("Lorien Grass"), + drawtype = "plantlike", + tiles = { "lottplants_lorien_grass_2.png" }, + inventory_image = "lottplants_lorien_grass_2.png", + wield_image = "lottplants_lorien_grass_2.png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + is_ground_content = true, + drop = "lottplants:lorien_grass_1", + groups = { + snappy = 3, flammable = 3, flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, + }, +}) +minetest.register_node("lottplants:lorien_grass_3", { + description = S("Lorien Grass"), + drawtype = "plantlike", + tiles = { "lottplants_lorien_grass_3.png" }, + inventory_image = "lottplants_lorien_grass_3.png", + wield_image = "lottplants_lorien_grass_3.png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + is_ground_content = true, + drop = "lottplants:lorien_grass_1", + groups = { + snappy = 3, flammable = 3, flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, + }, +}) +minetest.register_node("lottplants:lorien_grass_4", { + description = S("Lorien Grass"), + drawtype = "plantlike", + tiles = { "lottplants_lorien_grass_4.png" }, + inventory_image = "lottplants_lorien_grass_4.png", + wield_image = "lottplants_lorien_grass_4.png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + is_ground_content = true, + drop = "lottplants:lorien_grass_1", + groups = { + snappy = 3, flammable = 3, flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, + }, +}) + +minetest.register_node("lottplants:brambles_of_mordor", { + description = S("Brambles Of Mordor"), + drawtype = "plantlike", + tiles = { "lottplants_brambles_of_mordor.png" }, + inventory_image = "lottplants_brambles_of_mordor.png", + wield_image = "lottplants_brambles_of_mordor.png", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 42, + walkable = false, + waving = 1, + buildable_to = true, + groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_grey=1, grass=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, + }, +}) + +minetest.register_node("lottplants:pilinehtar", { + description = S("Pilinehtar"), + drawtype = "plantlike", + tiles = { "lottplants_pilinehtar.png" }, + inventory_image = "lottplants_pilinehtar.png", + wield_image = "lottplants_pilinehtar.png", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 2, + waving = 1, + walkable = false, + buildable_to = true, + groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_green=1, grass=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, + }, +}) diff --git a/mods/lord/Blocks/lottplants/src/nodes.lua b/mods/lord/Blocks/lottplants/src/nodes.lua index c9df325c4..27fbeca7c 100644 --- a/mods/lord/Blocks/lottplants/src/nodes.lua +++ b/mods/lord/Blocks/lottplants/src/nodes.lua @@ -1,1345 +1,5 @@ local S = minetest.get_translator("lottplants") --- LEAVES - -minetest.register_node("lottplants:alderleaf", { - description = S("Alder Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_alderleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_alderleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:alderleaf", - liquid_alternative_source = "lottplants:alderleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:aldersapling' }, - rarity = 20, - }, - { - items = { 'lottplants:alderleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:appleleaf", { - description = S("Apple Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_appleleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_appleleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:appleleaf", - liquid_alternative_source = "lottplants:appleleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:applesapling' }, - rarity = 20, - }, - { - items = { 'lottplants:appleleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:birchleaf", { - description = S("Birch Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_birchleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_birchleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:birchleaf", - liquid_alternative_source = "lottplants:birchleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:birchsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:birchleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:beechleaf", { - description = S("Beech Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_beechleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_beechleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:beechleaf", - liquid_alternative_source = "lottplants:beechleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:beechsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:beechleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:culumaldaleaf", { - description = S("Culumalda Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_culumaldaleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_culumaldaleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:culumaldaleaf", - liquid_alternative_source = "lottplants:culumaldaleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_red = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:culumaldasapling' }, - rarity = 20, - }, - { - items = { 'lottplants:culumaldaleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:yellowflowers", { - description = S("Yellow Flowers on Culumalda Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_yellowflowers.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_yellowflowers_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:yellowflowers", - liquid_alternative_source = "lottplants:yellowflowers", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_orange = 1 }, - drop = { - max_items = 3, - items = { - { items = { 'lottplants:yellowflowers' } }, - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - - -minetest.register_node("lottplants:elmleaf", { - description = S("Elm Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_elmleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_elmleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:elmleaf", - liquid_alternative_source = "lottplants:elmleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:elmsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:elmleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:firleaf", { - description = S("Fir Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_firleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_firleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:firleaf", - liquid_alternative_source = "lottplants:firleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:firsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:firleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:lebethronleaf", { - description = S("Lebethron Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_lebethronleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_lebethronleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:lebethronleaf", - liquid_alternative_source = "lottplants:lebethronleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:lebethronsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:lebethronleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:mallornleaf", { - description = S("Mallorn Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_mallornleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_mallornleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:mallornleaf", - liquid_alternative_source = "lottplants:mallornleaf", - liquid_renewable = false, - liquid_range = 0, - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_yellow = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:mallornsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:mallornleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:pineleaf", { - description = S("Pine Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_pineleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_pineleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:pineleaf", - liquid_alternative_source = "lottplants:pineleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:pinesapling' }, - rarity = 20, - }, - { - items = { 'lottplants:pineleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:plumleaf", { - description = S("Plum Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_plumleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_plumleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:plumleaf", - liquid_alternative_source = "lottplants:plumleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:plumsapling' }, - rarity = 20, - }, - { - items = { 'lottplants:plumleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:rowanleaf", { - description = S("Rowan Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_rowanleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_rowanleaf_inv.png", - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:rowanleaf", - liquid_alternative_source = "lottplants:rowanleaf", - liquid_renewable = false, - liquid_range = 0, - - paramtype = "light", - waving = 2, - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_yellow = 1 }, - drop = { - max_items = 1, - items = { - { items = { 'lottplants:rowansapling' }, rarity = 20 }, - { items = { 'lottfarming:berries' }, rarity = 200 }, - { items = { 'lottplants:rowanleaf' } }, - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:rowanberry", { - description = S("Rowan Leaf with Berries"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_rowanberry.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_rowanberry_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:rowanberry", - liquid_alternative_source = "lottplants:rowanberry", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1 }, - drop = { - max_items = 2, - items = { - { items = { 'lottplants:rowanleaf' } }, - { items = { 'lottfarming:berries' } }, - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:whiteleaf", { - description = S("White Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_whiteleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_whiteleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:whiteleaf", - liquid_alternative_source = "lottplants:whiteleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_white = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:whitesapling' }, - rarity = 20, - }, - { - items = { 'lottplants:whiteleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("lottplants:yavannamireleaf", { - description = S("Yavannamire Leaf"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_yavannamireleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_yavannamireleaf_inv.png", - paramtype = "light", - waving = 2, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:yavannamireleaf", - liquid_alternative_source = "lottplants:yavannamireleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:yavannamiresapling' }, - rarity = 20, - }, - { - items = { 'lottplants:yavannamireleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_alias("lottmapgen:mirkleaves", "lottplants:mirkleaf") -minetest.register_node("lottplants:mirkleaf", { - description = S("Mirkwood Leaves"), - drawtype = "mesh", - mesh = "leaves_model.obj", - tiles = { "lottplants_mirkleaf.png" }, - use_texture_alpha = "clip", - inventory_image = "lottplants_mirkleaf_inv.png", - paramtype = "light", - waving = 2, - sunlight_propagates = false, - is_ground_content = false, - walkable = false, - --climbable=true, - liquid_viscosity = 8, - liquidtype = "source", - liquid_alternative_flowing = "lottplants:mirkleaf", - liquid_alternative_source = "lottplants:mirkleaf", - liquid_renewable = false, - liquid_range = 0, - - groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, - drop = { - max_items = 1, - items = { - { - items = { 'lottplants:mirksapling' }, - rarity = 20, - }, - { - items = { 'lottplants:mirkleaf' }, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - --- --- TREE --- - --- сосна (pine -minetest.register_node("lottplants:pinetrunk", { - description = S("Pine Trunk"), - tiles = { "lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png" }, - paramtype2 = "facedir", - drop = "lottplants:pinetree", - groups = { tree = 1, choppy = 3, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:pinetree", { - description = S("Pine Tree"), - tiles = { "lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png" }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 3, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:pinetree", digger, 13, 2) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:pinetrunk") - end, -}) - --- ель (fir) -minetest.register_node("lottplants:firtrunk", { - description = S("Fir Trunk"), - tiles = { "lottplants_fir_tree_top.png", "lottplants_fir_tree_top.png", "lottplants_fir_tree.png" }, - paramtype2 = "facedir", - drop = "lottplants:firtree", - groups = { tree = 1, choppy = 3, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:firtree", { - description = S("Fir Tree"), - tiles = { "lottplants_fir_tree_top.png", "lottplants_fir_tree_top.png", "lottplants_fir_tree.png" }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 3, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:firtree", digger, 13, 2) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:firtrunk") - end, -}) - - --- берёза -minetest.register_node("lottplants:birchtrunk", { - description = S("Birch Trunk"), - tiles = { "lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png" }, - paramtype2 = "facedir", - drop = "lottplants:birchtree", - groups = { tree = 1, choppy = 3, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:birchtree", { - description = S("Birch Tree"), - tiles = { "lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png" }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 3, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:birchtree", digger, 12, 3) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:birchtrunk") - end, -}) - --- ольха -minetest.register_node("lottplants:aldertrunk", { - description = S("Alder Trunk"), - tiles = { "lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png" }, - paramtype2 = "facedir", - drop = "lottplants:aldertree", - groups = { tree = 1, choppy = 2, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:aldertree", { - description = S("Alder Tree"), - tiles = { "lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png" }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 2, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:aldertree", digger, 10, 2) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:aldertrunk") - end, -}) - --- лебетрон -minetest.register_node("lottplants:lebethrontrunk", { - description = S("Lebethron Trunk"), - tiles = { "lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png" }, - paramtype2 = "facedir", - drop = "lottplants:lebethrontree", - groups = { tree = 1, choppy = 1, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:lebethrontree", { - description = S("Lebethron Tree"), - tiles = { "lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png" }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 1, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:lebethrontree", digger, 10, 2) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:lebethrontrunk") - end, -}) - --- маллорн -minetest.register_node("lottplants:mallorntrunk", { - description = S("Mallorn Trunk"), - tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, - paramtype2 = "facedir", - drop = "lottplants:mallorntree", - groups = { tree = 1, choppy = 1, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:mallorntree", { - description = S("Mallorn Tree"), - tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 1, flammable = 2 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:mallorntree", digger, 30, 5) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:mallorntrunk") - end, -}) - --- молодой маллорн -minetest.register_node("lottplants:mallorntrunk_young", { - description = S("Young Mallorn Trunk"), - tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - { -0.125, -0.5, -0.1875, 0.125, 0.5, 0.1875 }, - { -0.1875, -0.5, -0.125, 0.1875, 0.5, 0.125 }, - }, - }, - paramtype2 = "facedir", - drop = "lottplants:mallorntree_young", - groups = { tree = 1, choppy = 1, flammable = 2, fuel = 1 }, - sounds = default.node_sound_wood_defaults(), - on_place = minetest.rotate_node, -}) - -minetest.register_node("lottplants:mallorntree_young", { - description = S("Young Mallorn Trее"), - tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - { -0.125, -0.5, -0.1875, 0.125, 0.5, 0.1875 }, - { -0.1875, -0.5, -0.125, 0.1875, 0.5, 0.125 }, - }, - }, - paramtype2 = "facedir", - groups = { tree = 1, choppy = 1, flammable = 2, fuel = 1 }, - sounds = default.node_sound_wood_defaults(), - on_dig = function(pos, node, digger) - default.dig_tree(pos, node, "lottplants:mallorntree_young", digger, 10, 1) - end, - on_place = function(itemstack, placer, pointed_thing) - return default.place_tree(itemstack, placer, pointed_thing, "lottplants:mallorntrunk_young") - end, -}) - --- SAPLINGS - -minetest.register_node("lottplants:aldersapling", { - description = S("Alder Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_aldersapling.png" }, - inventory_image = "lottplants_aldersapling.png", - wield_image = "lottplants_aldersapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:applesapling", { - description = S("Apple Tree Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_applesapling.png" }, - inventory_image = "lottplants_applesapling.png", - wield_image = "lottplants_applesapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:birchsapling", { - description = S("Birch Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_birchsapling.png" }, - inventory_image = "lottplants_birchsapling.png", - wield_image = "lottplants_birchsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:beechsapling", { - description = S("Beech Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_beechsapling.png" }, - inventory_image = "lottplants_beechsapling.png", - wield_image = "lottplants_beechsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:culumaldasapling", { - description = S("Culumalda Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_culumaldasapling.png" }, - inventory_image = "lottplants_culumaldasapling.png", - wield_image = "lottplants_culumaldasapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:elmsapling", { - description = S("Elm Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_elmsapling.png" }, - inventory_image = "lottplants_elmsapling.png", - wield_image = "lottplants_elmsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:firsapling", { - description = S("Fir Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_firsapling.png" }, - inventory_image = "lottplants_firsapling.png", - wield_image = "lottplants_firsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:lebethronsapling", { - description = S("Lebethron Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_lebethronsapling.png" }, - inventory_image = "lottplants_lebethronsapling.png", - wield_image = "lottplants_lebethronsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:mallornsapling", { - description = S("Mallorn Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_mallornsapling.png" }, - inventory_image = "lottplants_mallornsapling.png", - wield_image = "lottplants_mallornsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:pinesapling", { - description = S("Pine Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_pinesapling.png" }, - inventory_image = "lottplants_pinesapling.png", - wield_image = "lottplants_pinesapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:plumsapling", { - description = S("Plum Tree Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_plumsapling.png" }, - inventory_image = "lottplants_plumsapling.png", - wield_image = "lottplants_plumsapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:rowansapling", { - description = S("Rowan Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_rowansapling.png" }, - inventory_image = "lottplants_rowansapling.png", - wield_image = "lottplants_rowansapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:whitesapling", { - description = S("White Tree Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_whitesapling.png" }, - inventory_image = "lottplants_whitesapling.png", - wield_image = "lottplants_whitesapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:yavannamiresapling", { - description = S("Yavannamire Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_yavannamiresapling.png" }, - inventory_image = "lottplants_yavannamiresapling.png", - wield_image = "lottplants_yavannamiresapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("lottplants:mirksapling", { - description = S("Mirkwood Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_mirksapling.png" }, - inventory_image = "lottplants_mirksapling.png", - wield_image = "lottplants_mirksapling.png", - paramtype = "light", - waving = 1, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, - }, - groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, - sounds = default.node_sound_defaults(), -}) - --- FRUITS - -minetest.register_node("lottplants:plum", { - description = S("Plum"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_plum.png" }, - inventory_image = "lottplants_plum.png", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0, 0.2 } - }, - groups = { - fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1, color_violet = 1 - }, - on_use = minetest.item_eat(2), - sounds = default.node_sound_leaves_defaults(), - after_place_node = function(pos, placer, itemstack) - if placer:is_player() then - minetest.set_node(pos, { name = "lottplants:plum", param2 = 1 }) - end - end, -}) - -minetest.register_node("lottplants:yavannamirefruit", { - description = S("Yavannamire Fruit"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = { "lottplants_yavannamirefruit.png" }, - inventory_image = "lottplants_yavannamirefruit.png", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - selection_box = { - type = "fixed", - fixed = { -0.2, -0.5, -0.2, 0.2, 0, 0.2 } - }, - groups = { fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1 }, - on_use = minetest.item_eat(4), - sounds = default.node_sound_leaves_defaults(), - after_place_node = function(pos, placer, itemstack) - if placer:is_player() then - minetest.set_node(pos, { name = "lottplants:yavannamirefruit", param2 = 1 }) - end - end, -}) - --- LEAFDECAY --- Регистрация опадающей листвы и др. - --- Alders / Ольха -default.register_leafdecay({ - trunks = {"lottplants:aldertree"}, - leaves = {"lottplants:alderleaf"}, - radius = 3, -}) - -default.register_leafdecay({ - trunks = {"default:tree"}, - leaves = { - "lottplants:appleleaf", "default:leaves", "default:apple", -- Apple Tree / Яблоня - "lottplants:beechleaf", -- Beeches / Бук - "lottplants:culumaldaleaf", "lottplants:yellowflowers", -- Culumalda / Кулумальда - "lottplants:elmleaf", -- Elms / Вяз - "lottplants:plumleaf", "lottplants:plum", -- Plum Tree / Слива - "lottplants:rowanleaf", "lottplants:rowanberry", -- Rowans / Рябина - "lottplants:whiteleaf", -- White Tree / Белое дерево - "lottplants:yavannamireleaf", "lottplants:yavannamirefruit", -- Yavannamire / Йаванамирэ - }, - radius = 6, -- такая большая цифра только из-за бука -}) - --- Lebethron / Лебетрон -default.register_leafdecay({ - trunks = {"lottplants:lebethrontree"}, - leaves = {"lottplants:lebethronleaf"}, - radius = 2, -}) - --- Birches / Береза -default.register_leafdecay({ - trunks = {"lottplants:birchtree"}, - leaves = {"lottplants:birchleaf"}, - radius = 3, -}) - --- Firs / Ель -default.register_leafdecay({ - trunks = {"lottplants:firtree"}, - leaves = {"lottplants:firleaf"}, - radius = 4, -}) - --- (Young) Mallorn / (Молодой) маллорн -default.register_leafdecay({ - trunks = {"lottplants:mallorntree", "lottplants:mallorntree_young"}, - leaves = {"lottplants:mallornleaf"}, - radius = 2, -}) - --- Pines / Сосна -default.register_leafdecay({ - trunks = {"lottplants:pinetree"}, - leaves = {"lottplants:pineleaf"}, - radius = 2, -}) - --- Mirk Large/Small / Большое/Малое дерево Лихолесья -default.register_leafdecay({ - trunks = {"default:jungletree"}, - leaves = {"lottplants:mirkleaf"}, - radius = 2, -}) - ---- @type lottplants.Planks_API -_G.planks = require('planks') - ---Lorien grass - -minetest.register_node("lottplants:lorien_grass_1", { - description = S("Lorien Grass"), - drawtype = "plantlike", - tiles = { "lottplants_lorien_grass_1.png" }, - -- use a bigger inventory image - inventory_image = "lottplants_lorien_grass_3.png", - wield_image = "lottplants_lorien_grass_3.png", - paramtype = "light", - waving = 1, - walkable = false, - is_ground_content = true, - buildable_to = true, - groups = { - snappy = 3, flammable = 3, flora = 1, attached_node = 1, grass = 1, color_green = 1 - }, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, - }, - on_place = function(itemstack, placer, pointed_thing) - -- place a random grass node - local stack = ItemStack("lottplants:lorien_grass_" .. math.random(1, 5)) - local ret = minetest.item_place(stack, placer, pointed_thing) - return ItemStack("lottplants:lorien_grass_1 " .. itemstack:get_count() - (1 - ret:get_count())) - end, -}) -minetest.register_node("lottplants:lorien_grass_2", { - description = S("Lorien Grass"), - drawtype = "plantlike", - tiles = { "lottplants_lorien_grass_2.png" }, - inventory_image = "lottplants_lorien_grass_2.png", - wield_image = "lottplants_lorien_grass_2.png", - paramtype = "light", - waving = 1, - walkable = false, - buildable_to = true, - is_ground_content = true, - drop = "lottplants:lorien_grass_1", - groups = { - snappy = 3, flammable = 3, flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1 - }, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, - }, -}) -minetest.register_node("lottplants:lorien_grass_3", { - description = S("Lorien Grass"), - drawtype = "plantlike", - tiles = { "lottplants_lorien_grass_3.png" }, - inventory_image = "lottplants_lorien_grass_3.png", - wield_image = "lottplants_lorien_grass_3.png", - paramtype = "light", - waving = 1, - walkable = false, - buildable_to = true, - is_ground_content = true, - drop = "lottplants:lorien_grass_1", - groups = { - snappy = 3, flammable = 3, flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1 - }, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, - }, -}) -minetest.register_node("lottplants:lorien_grass_4", { - description = S("Lorien Grass"), - drawtype = "plantlike", - tiles = { "lottplants_lorien_grass_4.png" }, - inventory_image = "lottplants_lorien_grass_4.png", - wield_image = "lottplants_lorien_grass_4.png", - paramtype = "light", - waving = 1, - walkable = false, - buildable_to = true, - is_ground_content = true, - drop = "lottplants:lorien_grass_1", - groups = { - snappy = 3, flammable = 3, flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1 - }, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, -0.5, 0.5, -5 / 16, 0.5 }, - }, -}) - - --- trunk slabs -stairs.register_slab( - "pinetree", - "lottplants:pinetree", - { tree_slab = 1, choppy = 3, flammable = 2 }, - { "lottplants_pinetree.png", }, - S("Pine Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "firtree", - "lottplants:firtree", - { tree_slab = 1, choppy = 3, flammable = 2 }, - { "lottplants_fir_tree.png" }, - S("Fir Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "birchtree", - "lottplants:birchtree", - { tree_slab = 1, choppy = 3, flammable = 2 }, - { "lottplants_birchtree.png", }, - S("Birch Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "aldertree", - "lottplants:aldertree", - { tree_slab = 1, choppy = 3, flammable = 2 }, - { "lottplants_aldertree.png", }, - S("Alder Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "lebethrontree", - "lottplants:lebethrontree", - { tree_slab = 1, choppy = 3, flammable = 2 }, - { "default_tree.png", }, - S("Lebethron Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "mallorntree", - "lottplants:mallorntree", - { tree_slab = 1, choppy = 3, flammable = 2 }, - { "lottplants_mallorntree.png", }, - S("Mallorn Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "tree", - "default:tree", - { tree_slab = 1, choppy = 2, flammable = 2 }, - { "default_tree.png",}, - S("Tree Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - -stairs.register_slab( - "jungletreetree", - "default:jungletree", - { tree_slab = 1, choppy = 2, flammable = 2 }, - { "default_jungletree.png",}, - S("Jungle Tree Trunk Slab"), - default.node_sound_wood_defaults(), - false -) - - -minetest.register_craft({ - type = "fuel", - recipe = "group:tree_slab", - burntime = 15, -}) - --Fireflies / Светлячки minetest.register_node("lottplants:fireflies", { @@ -1385,3 +45,55 @@ minetest.register_abm({ end end, }) + +minetest.register_abm({ + nodenames = {"group:flora"}, + neighbors = {"default:dirt_with_grass", "default:desert_sand"}, + interval = 50, + chance = 25, + action = function(pos, node) + pos.y = pos.y - 1 + local under = minetest.get_node(pos) + pos.y = pos.y + 1 + if under.name == "default:desert_sand" then + minetest.set_node(pos, {name="lottplants:brambles_of_mordor"}) + elseif under.name ~= "default:dirt_with_grass" then + return + end + + local light = minetest.get_node_light(pos) + if not light or light < 13 then + return + end + + local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4} + local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4} + if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then + return + end + + local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora") + if #flowers > 3 then + return + end + + local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass") + if #seedling > 0 then + seedling = seedling[math.random(#seedling)] + seedling.y = seedling.y + 1 + light = minetest.get_node_light(seedling) + if not light or light < 13 then + return + end + if minetest.get_node(seedling).name == "air" then + minetest.set_node(seedling, {name=node.name}) + end + end + end, +}) + +minetest.register_craftitem("lottplants:honey", { + description = S("Honey"), + inventory_image = "lottplants_honey.png", + on_use = minetest.item_eat(1), +}) diff --git a/mods/lord/Blocks/lottplants/src/trees.lua b/mods/lord/Blocks/lottplants/src/trees.lua new file mode 100644 index 000000000..55f22192b --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees.lua @@ -0,0 +1,8 @@ + +require('trees.trunks') +require('trees.trunks.slabs') +require('trees.fruits') +require('trees.leaves') +require('trees.leaves.decay') +require('trees.saplings') +require("trees.saplings.grow_functions") diff --git a/mods/lord/Blocks/lottplants/src/trees/fruits.lua b/mods/lord/Blocks/lottplants/src/trees/fruits.lua new file mode 100644 index 000000000..7e0f3a5ca --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees/fruits.lua @@ -0,0 +1,50 @@ +local S = minetest.get_translator("lottplants") + + +minetest.register_node("lottplants:plum", { + description = S("Plum"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_plum.png" }, + inventory_image = "lottplants_plum.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0, 0.2 } + }, + groups = { + fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1, color_violet = 1 + }, + on_use = minetest.item_eat(2), + sounds = default.node_sound_leaves_defaults(), + after_place_node = function(pos, placer, itemstack) + if placer:is_player() then + minetest.set_node(pos, { name = "lottplants:plum", param2 = 1 }) + end + end, +}) + +minetest.register_node("lottplants:yavannamirefruit", { + description = S("Yavannamire Fruit"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_yavannamirefruit.png" }, + inventory_image = "lottplants_yavannamirefruit.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0, 0.2 } + }, + groups = { fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1 }, + on_use = minetest.item_eat(4), + sounds = default.node_sound_leaves_defaults(), + after_place_node = function(pos, placer, itemstack) + if placer:is_player() then + minetest.set_node(pos, { name = "lottplants:yavannamirefruit", param2 = 1 }) + end + end, +}) diff --git a/mods/lord/Blocks/lottplants/src/trees/leaves.lua b/mods/lord/Blocks/lottplants/src/trees/leaves.lua new file mode 100644 index 000000000..251aabc9a --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees/leaves.lua @@ -0,0 +1,568 @@ +local S = minetest.get_translator("lottplants") + + +minetest.register_node("lottplants:alderleaf", { + description = S("Alder Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_alderleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_alderleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:alderleaf", + liquid_alternative_source = "lottplants:alderleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:aldersapling' }, + rarity = 20, + }, + { + items = { 'lottplants:alderleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:appleleaf", { + description = S("Apple Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_appleleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_appleleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:appleleaf", + liquid_alternative_source = "lottplants:appleleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:applesapling' }, + rarity = 20, + }, + { + items = { 'lottplants:appleleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:birchleaf", { + description = S("Birch Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_birchleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_birchleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:birchleaf", + liquid_alternative_source = "lottplants:birchleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:birchsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:birchleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:beechleaf", { + description = S("Beech Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_beechleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_beechleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:beechleaf", + liquid_alternative_source = "lottplants:beechleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:beechsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:beechleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:culumaldaleaf", { + description = S("Culumalda Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_culumaldaleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_culumaldaleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:culumaldaleaf", + liquid_alternative_source = "lottplants:culumaldaleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_red = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:culumaldasapling' }, + rarity = 20, + }, + { + items = { 'lottplants:culumaldaleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:yellowflowers", { + description = S("Yellow Flowers on Culumalda Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_yellowflowers.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_yellowflowers_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:yellowflowers", + liquid_alternative_source = "lottplants:yellowflowers", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_orange = 1 }, + drop = { + max_items = 3, + items = { + { items = { 'lottplants:yellowflowers' } }, + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + + +minetest.register_node("lottplants:elmleaf", { + description = S("Elm Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_elmleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_elmleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:elmleaf", + liquid_alternative_source = "lottplants:elmleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:elmsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:elmleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:firleaf", { + description = S("Fir Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_firleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_firleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:firleaf", + liquid_alternative_source = "lottplants:firleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:firsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:firleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:lebethronleaf", { + description = S("Lebethron Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_lebethronleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_lebethronleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:lebethronleaf", + liquid_alternative_source = "lottplants:lebethronleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:lebethronsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:lebethronleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:mallornleaf", { + description = S("Mallorn Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_mallornleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_mallornleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:mallornleaf", + liquid_alternative_source = "lottplants:mallornleaf", + liquid_renewable = false, + liquid_range = 0, + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_yellow = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:mallornsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:mallornleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:pineleaf", { + description = S("Pine Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_pineleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_pineleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:pineleaf", + liquid_alternative_source = "lottplants:pineleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:pinesapling' }, + rarity = 20, + }, + { + items = { 'lottplants:pineleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:plumleaf", { + description = S("Plum Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_plumleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_plumleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:plumleaf", + liquid_alternative_source = "lottplants:plumleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:plumsapling' }, + rarity = 20, + }, + { + items = { 'lottplants:plumleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:rowanleaf", { + description = S("Rowan Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_rowanleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_rowanleaf_inv.png", + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:rowanleaf", + liquid_alternative_source = "lottplants:rowanleaf", + liquid_renewable = false, + liquid_range = 0, + + paramtype = "light", + waving = 2, + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_yellow = 1 }, + drop = { + max_items = 1, + items = { + { items = { 'lottplants:rowansapling' }, rarity = 20 }, + { items = { 'lottfarming:berries' }, rarity = 200 }, + { items = { 'lottplants:rowanleaf' } }, + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:rowanberry", { + description = S("Rowan Leaf with Berries"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_rowanberry.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_rowanberry_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:rowanberry", + liquid_alternative_source = "lottplants:rowanberry", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1 }, + drop = { + max_items = 2, + items = { + { items = { 'lottplants:rowanleaf' } }, + { items = { 'lottfarming:berries' } }, + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:whiteleaf", { + description = S("White Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_whiteleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_whiteleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:whiteleaf", + liquid_alternative_source = "lottplants:whiteleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_white = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:whitesapling' }, + rarity = 20, + }, + { + items = { 'lottplants:whiteleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("lottplants:yavannamireleaf", { + description = S("Yavannamire Leaf"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_yavannamireleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_yavannamireleaf_inv.png", + paramtype = "light", + waving = 2, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:yavannamireleaf", + liquid_alternative_source = "lottplants:yavannamireleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:yavannamiresapling' }, + rarity = 20, + }, + { + items = { 'lottplants:yavannamireleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_alias("lottmapgen:mirkleaves", "lottplants:mirkleaf") +minetest.register_node("lottplants:mirkleaf", { + description = S("Mirkwood Leaves"), + drawtype = "mesh", + mesh = "leaves_model.obj", + tiles = { "lottplants_mirkleaf.png" }, + use_texture_alpha = "clip", + inventory_image = "lottplants_mirkleaf_inv.png", + paramtype = "light", + waving = 2, + sunlight_propagates = false, + is_ground_content = false, + walkable = false, + --climbable=true, + liquid_viscosity = 8, + liquidtype = "source", + liquid_alternative_flowing = "lottplants:mirkleaf", + liquid_alternative_source = "lottplants:mirkleaf", + liquid_renewable = false, + liquid_range = 0, + + groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, color_green = 1 }, + drop = { + max_items = 1, + items = { + { + items = { 'lottplants:mirksapling' }, + rarity = 20, + }, + { + items = { 'lottplants:mirkleaf' }, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) diff --git a/mods/lord/Blocks/lottplants/src/trees/leaves/decay.lua b/mods/lord/Blocks/lottplants/src/trees/leaves/decay.lua new file mode 100644 index 000000000..32902668f --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees/leaves/decay.lua @@ -0,0 +1,66 @@ + +-- Регистрация опадающей листвы и др. + +-- Alders / Ольха +default.register_leafdecay({ + trunks = {"lottplants:aldertree"}, + leaves = {"lottplants:alderleaf"}, + radius = 3, +}) + +default.register_leafdecay({ + trunks = {"default:tree"}, + leaves = { + "lottplants:appleleaf", "default:leaves", "default:apple", -- Apple Tree / Яблоня + "lottplants:beechleaf", -- Beeches / Бук + "lottplants:culumaldaleaf", "lottplants:yellowflowers", -- Culumalda / Кулумальда + "lottplants:elmleaf", -- Elms / Вяз + "lottplants:plumleaf", "lottplants:plum", -- Plum Tree / Слива + "lottplants:rowanleaf", "lottplants:rowanberry", -- Rowans / Рябина + "lottplants:whiteleaf", -- White Tree / Белое дерево + "lottplants:yavannamireleaf", "lottplants:yavannamirefruit", -- Yavannamire / Йаванамирэ + }, + radius = 6, -- такая большая цифра только из-за бука +}) + +-- Lebethron / Лебетрон +default.register_leafdecay({ + trunks = {"lottplants:lebethrontree"}, + leaves = {"lottplants:lebethronleaf"}, + radius = 2, +}) + +-- Birches / Береза +default.register_leafdecay({ + trunks = {"lottplants:birchtree"}, + leaves = {"lottplants:birchleaf"}, + radius = 3, +}) + +-- Firs / Ель +default.register_leafdecay({ + trunks = {"lottplants:firtree"}, + leaves = {"lottplants:firleaf"}, + radius = 4, +}) + +-- (Young) Mallorn / (Молодой) маллорн +default.register_leafdecay({ + trunks = {"lottplants:mallorntree", "lottplants:mallorntree_young"}, + leaves = {"lottplants:mallornleaf"}, + radius = 2, +}) + +-- Pines / Сосна +default.register_leafdecay({ + trunks = {"lottplants:pinetree"}, + leaves = {"lottplants:pineleaf"}, + radius = 2, +}) + +-- Mirk Large/Small / Большое/Малое дерево Лихолесья +default.register_leafdecay({ + trunks = {"default:jungletree"}, + leaves = {"lottplants:mirkleaf"}, + radius = 2, +}) diff --git a/mods/lord/Blocks/lottplants/src/trees/saplings.lua b/mods/lord/Blocks/lottplants/src/trees/saplings.lua new file mode 100644 index 000000000..417721a64 --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees/saplings.lua @@ -0,0 +1,272 @@ +local S = minetest.get_translator("lottplants") + + +minetest.register_node("lottplants:aldersapling", { + description = S("Alder Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_aldersapling.png" }, + inventory_image = "lottplants_aldersapling.png", + wield_image = "lottplants_aldersapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:applesapling", { + description = S("Apple Tree Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_applesapling.png" }, + inventory_image = "lottplants_applesapling.png", + wield_image = "lottplants_applesapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:birchsapling", { + description = S("Birch Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_birchsapling.png" }, + inventory_image = "lottplants_birchsapling.png", + wield_image = "lottplants_birchsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:beechsapling", { + description = S("Beech Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_beechsapling.png" }, + inventory_image = "lottplants_beechsapling.png", + wield_image = "lottplants_beechsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:culumaldasapling", { + description = S("Culumalda Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_culumaldasapling.png" }, + inventory_image = "lottplants_culumaldasapling.png", + wield_image = "lottplants_culumaldasapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:elmsapling", { + description = S("Elm Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_elmsapling.png" }, + inventory_image = "lottplants_elmsapling.png", + wield_image = "lottplants_elmsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:firsapling", { + description = S("Fir Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_firsapling.png" }, + inventory_image = "lottplants_firsapling.png", + wield_image = "lottplants_firsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:lebethronsapling", { + description = S("Lebethron Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_lebethronsapling.png" }, + inventory_image = "lottplants_lebethronsapling.png", + wield_image = "lottplants_lebethronsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:mallornsapling", { + description = S("Mallorn Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_mallornsapling.png" }, + inventory_image = "lottplants_mallornsapling.png", + wield_image = "lottplants_mallornsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:pinesapling", { + description = S("Pine Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_pinesapling.png" }, + inventory_image = "lottplants_pinesapling.png", + wield_image = "lottplants_pinesapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:plumsapling", { + description = S("Plum Tree Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_plumsapling.png" }, + inventory_image = "lottplants_plumsapling.png", + wield_image = "lottplants_plumsapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:rowansapling", { + description = S("Rowan Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_rowansapling.png" }, + inventory_image = "lottplants_rowansapling.png", + wield_image = "lottplants_rowansapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:whitesapling", { + description = S("White Tree Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_whitesapling.png" }, + inventory_image = "lottplants_whitesapling.png", + wield_image = "lottplants_whitesapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:yavannamiresapling", { + description = S("Yavannamire Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_yavannamiresapling.png" }, + inventory_image = "lottplants_yavannamiresapling.png", + wield_image = "lottplants_yavannamiresapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("lottplants:mirksapling", { + description = S("Mirkwood Sapling"), + drawtype = "plantlike", + visual_scale = 1.0, + tiles = { "lottplants_mirksapling.png" }, + inventory_image = "lottplants_mirksapling.png", + wield_image = "lottplants_mirksapling.png", + paramtype = "light", + waving = 1, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.2, -0.5, -0.2, 0.2, 0.3, 0.2 }, + }, + groups = { snappy = 2, dig_immediate = 3, flammable = 2, sapling = 1 }, + sounds = default.node_sound_defaults(), +}) diff --git a/mods/lord/Blocks/lottplants/src/functions.lua b/mods/lord/Blocks/lottplants/src/trees/saplings/grow_functions.lua similarity index 95% rename from mods/lord/Blocks/lottplants/src/functions.lua rename to mods/lord/Blocks/lottplants/src/trees/saplings/grow_functions.lua index cf122595f..ddbc28f61 100644 --- a/mods/lord/Blocks/lottplants/src/functions.lua +++ b/mods/lord/Blocks/lottplants/src/trees/saplings/grow_functions.lua @@ -683,18 +683,20 @@ function lottplants_smallmirktree(pos) end end end +end -end -- SAPLINGS - +-- ===== GROWING TIME ===== +local SAPLING_GROW_ABM_INTERVAL = 67 +local SAPLING_GROW_ABM_CHANCE = 11 -- Alders sapling / Ольха minetest.register_abm({ nodenames = {"lottplants:aldersapling"}, - interval = ALDINT, - chance = ALDCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -709,8 +711,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:applesapling"}, - interval = APPINT, - chance = APPCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -725,8 +727,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:birchsapling"}, - interval = BIRINT, - chance = BIRCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -741,8 +743,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:beechsapling"}, - interval = BEEINT, - chance = BEECHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -757,8 +759,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:culumaldasapling"}, - interval = CULINT, - chance = CULCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -773,8 +775,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:elmsapling"}, - interval = ELMINT, - chance = ELMCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -789,8 +791,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:firsapling"}, - interval = FIRINT, - chance = FIRCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -805,8 +807,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:lebethronsapling"}, - interval = LEBINT, - chance = LEBCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -821,8 +823,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:mallornsapling"}, - interval = MALINT, - chance = MALCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -843,8 +845,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:pinesapling"}, - interval = PININT, - chance = PINCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -859,8 +861,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:plumsapling"}, - interval = PLUINT, - chance = PLUCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -875,8 +877,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:rowansapling"}, - interval = ROWINT, - chance = ROWCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -891,8 +893,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:whitesapling"}, - interval = WHIINT, - chance = WHICHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -907,8 +909,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:yavannamiresapling"}, - interval = YAVINT, - chance = YAVCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return @@ -923,8 +925,8 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"lottplants:mirksapling"}, - interval = MIRINT, - chance = MIRCHA, + interval = SAPLING_GROW_ABM_INTERVAL, + chance = SAPLING_GROW_ABM_CHANCE, action = function(pos, node, active_object_count, active_object_count_wider) if not default.can_grow(pos) then return diff --git a/mods/lord/Blocks/lottplants/src/trees/trunks.lua b/mods/lord/Blocks/lottplants/src/trees/trunks.lua new file mode 100644 index 000000000..49b48343d --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees/trunks.lua @@ -0,0 +1,196 @@ +local S = minetest.get_translator("lottplants") + + +-- сосна (pine +minetest.register_node("lottplants:pinetrunk", { + description = S("Pine Trunk"), + tiles = { "lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png" }, + paramtype2 = "facedir", + drop = "lottplants:pinetree", + groups = { tree = 1, choppy = 3, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:pinetree", { + description = S("Pine Tree"), + tiles = { "lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png" }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 3, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:pinetree", digger, 13, 2) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:pinetrunk") + end, +}) + +-- ель (fir) +minetest.register_node("lottplants:firtrunk", { + description = S("Fir Trunk"), + tiles = { "lottplants_fir_tree_top.png", "lottplants_fir_tree_top.png", "lottplants_fir_tree.png" }, + paramtype2 = "facedir", + drop = "lottplants:firtree", + groups = { tree = 1, choppy = 3, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:firtree", { + description = S("Fir Tree"), + tiles = { "lottplants_fir_tree_top.png", "lottplants_fir_tree_top.png", "lottplants_fir_tree.png" }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 3, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:firtree", digger, 13, 2) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:firtrunk") + end, +}) + + +-- берёза +minetest.register_node("lottplants:birchtrunk", { + description = S("Birch Trunk"), + tiles = { "lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png" }, + paramtype2 = "facedir", + drop = "lottplants:birchtree", + groups = { tree = 1, choppy = 3, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:birchtree", { + description = S("Birch Tree"), + tiles = { "lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png" }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 3, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:birchtree", digger, 12, 3) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:birchtrunk") + end, +}) + +-- ольха +minetest.register_node("lottplants:aldertrunk", { + description = S("Alder Trunk"), + tiles = { "lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png" }, + paramtype2 = "facedir", + drop = "lottplants:aldertree", + groups = { tree = 1, choppy = 2, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:aldertree", { + description = S("Alder Tree"), + tiles = { "lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png" }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 2, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:aldertree", digger, 10, 2) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:aldertrunk") + end, +}) + +-- лебетрон +minetest.register_node("lottplants:lebethrontrunk", { + description = S("Lebethron Trunk"), + tiles = { "lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png" }, + paramtype2 = "facedir", + drop = "lottplants:lebethrontree", + groups = { tree = 1, choppy = 1, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:lebethrontree", { + description = S("Lebethron Tree"), + tiles = { "lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png" }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 1, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:lebethrontree", digger, 10, 2) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:lebethrontrunk") + end, +}) + +-- маллорн +minetest.register_node("lottplants:mallorntrunk", { + description = S("Mallorn Trunk"), + tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, + paramtype2 = "facedir", + drop = "lottplants:mallorntree", + groups = { tree = 1, choppy = 1, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:mallorntree", { + description = S("Mallorn Tree"), + tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 1, flammable = 2 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:mallorntree", digger, 30, 5) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:mallorntrunk") + end, +}) + +-- молодой маллорн +minetest.register_node("lottplants:mallorntrunk_young", { + description = S("Young Mallorn Trunk"), + tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + { -0.125, -0.5, -0.1875, 0.125, 0.5, 0.1875 }, + { -0.1875, -0.5, -0.125, 0.1875, 0.5, 0.125 }, + }, + }, + paramtype2 = "facedir", + drop = "lottplants:mallorntree_young", + groups = { tree = 1, choppy = 1, flammable = 2, fuel = 1 }, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, +}) + +minetest.register_node("lottplants:mallorntree_young", { + description = S("Young Mallorn Trее"), + tiles = { "lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png" }, + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + { -0.125, -0.5, -0.1875, 0.125, 0.5, 0.1875 }, + { -0.1875, -0.5, -0.125, 0.1875, 0.5, 0.125 }, + }, + }, + paramtype2 = "facedir", + groups = { tree = 1, choppy = 1, flammable = 2, fuel = 1 }, + sounds = default.node_sound_wood_defaults(), + on_dig = function(pos, node, digger) + default.dig_tree(pos, node, "lottplants:mallorntree_young", digger, 10, 1) + end, + on_place = function(itemstack, placer, pointed_thing) + return default.place_tree(itemstack, placer, pointed_thing, "lottplants:mallorntrunk_young") + end, +}) diff --git a/mods/lord/Blocks/lottplants/src/trees/trunks/slabs.lua b/mods/lord/Blocks/lottplants/src/trees/trunks/slabs.lua new file mode 100644 index 000000000..6d8bebec7 --- /dev/null +++ b/mods/lord/Blocks/lottplants/src/trees/trunks/slabs.lua @@ -0,0 +1,89 @@ +local S = minetest.get_translator("lottplants") + + +stairs.register_slab( + "pinetree", + "lottplants:pinetree", + { tree_slab = 1, choppy = 3, flammable = 2 }, + { "lottplants_pinetree.png", }, + S("Pine Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "firtree", + "lottplants:firtree", + { tree_slab = 1, choppy = 3, flammable = 2 }, + { "lottplants_fir_tree.png" }, + S("Fir Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "birchtree", + "lottplants:birchtree", + { tree_slab = 1, choppy = 3, flammable = 2 }, + { "lottplants_birchtree.png", }, + S("Birch Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "aldertree", + "lottplants:aldertree", + { tree_slab = 1, choppy = 3, flammable = 2 }, + { "lottplants_aldertree.png", }, + S("Alder Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "lebethrontree", + "lottplants:lebethrontree", + { tree_slab = 1, choppy = 3, flammable = 2 }, + { "default_tree.png", }, + S("Lebethron Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "mallorntree", + "lottplants:mallorntree", + { tree_slab = 1, choppy = 3, flammable = 2 }, + { "lottplants_mallorntree.png", }, + S("Mallorn Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "tree", + "default:tree", + { tree_slab = 1, choppy = 2, flammable = 2 }, + { "default_tree.png",}, + S("Tree Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + +stairs.register_slab( + "jungletreetree", + "default:jungletree", + { tree_slab = 1, choppy = 2, flammable = 2 }, + { "default_jungletree.png",}, + S("Jungle Tree Trunk Slab"), + default.node_sound_wood_defaults(), + false +) + + +minetest.register_craft({ + type = "fuel", + recipe = "group:tree_slab", + burntime = 15, +})