diff options
Diffstat (limited to 'node_defs.lua')
-rw-r--r-- | node_defs.lua | 196 |
1 files changed, 81 insertions, 115 deletions
diff --git a/node_defs.lua b/node_defs.lua index c49cf7c..35fb1d4 100644 --- a/node_defs.lua +++ b/node_defs.lua @@ -5,17 +5,18 @@ moretrees.avoidnodes = {} moretrees.treelist = { {"beech", "Beech Tree"}, {"apple_tree", "Apple Tree"}, - {"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, + {"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"sequoia", "Giant Sequoia"}, {"birch", "Birch Tree"}, - {"palm", "Palm Tree", "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 }, - {"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, - {"pine", "Pine Tree", "pine_cone", "Pine Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, + {"palm", "Palm Tree", "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 }, + {"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"willow", "Willow Tree"}, - {"acacia", "Acacia Tree"}, {"rubber_tree", "Rubber Tree"}, - {"jungletree", "Jungle Tree"}, - {"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, + {"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, + + {"jungletree", "Jungle Tree", nil, nil, nil, nil, "default_junglesapling.png" }, + {"pine", "Pine Tree", "pine_cone", "Pine Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8, "default_pine_sapling.png" }, + {"acacia", "Acacia Tree", nil, nil, nil, nil, "default_acacia_sapling.png" }, } local dirs1 = { 21, 20, 23, 22, 21 } @@ -75,6 +76,7 @@ for i in ipairs(moretrees.treelist) do local fruitdesc = moretrees.treelist[i][4] local selbox = moretrees.treelist[i][5] local vscale = moretrees.treelist[i][6] + local saptext = moretrees.treelist[i][7] or "moretrees_"..treename.."_sapling.png" if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes. and treename ~= "acacia" @@ -105,8 +107,8 @@ for i in ipairs(moretrees.treelist) do minetest.register_node("moretrees:"..treename.."_sapling", { description = S(treedesc.." Sapling"), drawtype = "plantlike", - tiles = {"moretrees_"..treename.."_sapling.png"}, - inventory_image = "moretrees_"..treename.."_sapling.png", + tiles = {saptex}, + inventory_image = saptex, paramtype = "light", paramtype2 = "waving", walkable = false, @@ -118,28 +120,10 @@ for i in ipairs(moretrees.treelist) do sounds = default.node_sound_defaults(), }) - minetest.register_node("moretrees:"..treename.."_sapling_ongen", { - description = S(treedesc.." Sapling"), - drawtype = "plantlike", - tiles = {"moretrees_"..treename.."_sapling.png"}, - inventory_image = "moretrees_"..treename.."_sapling.png", - paramtype = "light", - paramtype2 = "waving", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} - }, - groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,not_in_creative_inventory=1,sapling=1}, - sounds = default.node_sound_defaults(), - drop = "moretrees:"..treename.."_sapling" - }) - -- player will get a sapling with 1/100 chance -- player will get leaves only if he/she gets no saplings, -- this is because max_items is 1 - local droprarity = 100 if treename == "palm" then @@ -235,6 +219,23 @@ for i in ipairs(moretrees.treelist) do end end + minetest.register_node("moretrees:"..treename.."_sapling_ongen", { + description = S(treedesc.." Sapling"), + drawtype = "plantlike", + tiles = {saptext}, + inventory_image = saptext, + paramtype = "light", + paramtype2 = "waving", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,not_in_creative_inventory=1,sapling=1}, + sounds = default.node_sound_defaults(), + drop = "moretrees:"..treename.."_sapling" + }) + if fruit then minetest.register_node("moretrees:"..fruit, { description = S(fruitdesc), @@ -276,46 +277,9 @@ end -- Extra nodes for jungle trees: -minetest.register_node("moretrees:jungletree_sapling", { - description = S("Jungle Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = {"default_junglesapling.png"}, - inventory_image = "default_junglesapling.png", - wield_image = "default_junglesapling.png", - paramtype = "light", - paramtype2 = "waving", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} - }, - groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, - sounds = default.node_sound_leaves_defaults(), -}) - -minetest.register_node("moretrees:jungletree_sapling_ongen", { - description = S("Jungle Sapling"), - drawtype = "plantlike", - visual_scale = 1.0, - tiles = {"default_junglesapling.png"}, - inventory_image = "default_junglesapling.png", - wield_image = "default_junglesapling.png", - paramtype = "light", - paramtype2 = "waving", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} - }, - groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,not_in_creative_inventory=1,sapling=1}, - sounds = default.node_sound_leaves_defaults(), - drop = "moretrees:jungletree_sapling" -}) - -local jungleleaves = {"green","yellow","red"} -local jungleleavesnames = {"Green", "Yellow", "Red"} -for color = 1, 3 do +local jungleleaves = {"yellow","red"} +local jungleleavesnames = {"Yellow", "Red"} +for color = 1, #jungleleaves do local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color] local moretrees_leaves_inventory_image = nil @@ -338,7 +302,7 @@ for color = 1, 3 do drop = { max_items = 1, items = { - {items = {'moretrees:jungletree_sapling'}, rarity = 100 }, + {items = {"default:junglesapling"}, rarity = 100 }, {items = {"moretrees:jungletree_leaves_"..jungleleaves[color]} } } }, @@ -380,15 +344,16 @@ if moretrees.enable_redefine_apple then end table.insert(moretrees.avoidnodes, "default:jungletree") -table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk") +table.insert(moretrees.avoidnodes, "default:pine_tree") +table.insert(moretrees.avoidnodes, "default:acacia_tree") table.insert(moretrees.avoidnodes, "moretrees:fir_trunk") table.insert(moretrees.avoidnodes, "default:tree") if moretrees.spawn_saplings then table.insert(moretrees.avoidnodes, "snow:sapling_pine") table.insert(moretrees.avoidnodes, "default:junglesapling") - table.insert(moretrees.avoidnodes, "moretrees:jungle_tree_sapling") - table.insert(moretrees.avoidnodes, "moretrees:jungle_tree_sapling_ongen") + table.insert(moretrees.avoidnodes, "default:pine_sapling") + table.insert(moretrees.avoidnodes, "default:acacia_sapling") end -- "empty" (tapped) rubber tree nodes @@ -418,47 +383,48 @@ minetest.register_abm({ end, }) --- For compatibility with old nodes and recently-changed nodes. - -minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk") -minetest.register_alias("farming_plus:rubber_tree_full", "moretrees:rubber_tree_trunk") -minetest.register_alias("farming:rubber_tree_full", "moretrees:rubber_tree_trunk") - -minetest.register_alias("technic:rubber_leaves", "moretrees:rubber_tree_leaves") -minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves") -minetest.register_alias("farming:rubber_leaves", "moretrees:rubber_tree_leaves") - -minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling") -minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling") -minetest.register_alias("farming:rubber_sapling", "moretrees:rubber_tree_sapling") - -minetest.register_alias("default:junglesapling","moretrees:jungletree_sapling") -minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree") -minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree") -minetest.register_alias("moretrees:jungletree_planks", "default:junglewood") - -minetest.register_alias("jungletree:leaves_green", "moretrees:jungletree_leaves_green") -minetest.register_alias("jungletree:leaves_red", "moretrees:jungletree_leaves_red") -minetest.register_alias("jungletree:leaves_yellow", "moretrees:jungletree_leaves_yellow") - -minetest.register_alias("moretrees:conifer_trunk", "moretrees:fir_trunk") -minetest.register_alias("moretrees:conifer_trunk_sideways", "moretrees:fir_trunk_sideways") -minetest.register_alias("moretrees:conifer_leaves", "moretrees:fir_leaves") -minetest.register_alias("moretrees:conifer_leaves_bright", "moretrees:fir_leaves_bright") -minetest.register_alias("moretrees:conifer_sapling", "moretrees:fir_sapling") - -minetest.register_alias("conifers:trunk", "moretrees:fir_trunk") -minetest.register_alias("conifers:trunk_reversed", "moretrees:fir_trunk_sideways") -minetest.register_alias("conifers:leaves", "moretrees:fir_leaves") -minetest.register_alias("conifers:leaves_special", "moretrees:fir_leaves_bright") -minetest.register_alias("conifers:sapling", "moretrees:fir_sapling") - -minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree") -minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood") -minetest.register_alias("moretrees:acacia_sapling", "default:acacia_sapling") -minetest.register_alias("moretrees:acacia_leaves", "default:acacia_leaves") - -minetest.register_alias("moretrees:pine_trunk", "default:pinetree") -minetest.register_alias("moretrees:pine_planks", "default:pinewood") -minetest.register_alias("moretrees:pine_sapling", "default:pine_sapling") -minetest.register_alias("moretrees:pine_leaves", "default:pine_needles") +-- For compatibility with old nodes, recently-changed nodes, and default nodes + +minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk") +minetest.register_alias("farming_plus:rubber_tree_full", "moretrees:rubber_tree_trunk") +minetest.register_alias("farming:rubber_tree_full", "moretrees:rubber_tree_trunk") + +minetest.register_alias("technic:rubber_leaves", "moretrees:rubber_tree_leaves") +minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves") +minetest.register_alias("farming:rubber_leaves", "moretrees:rubber_tree_leaves") + +minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling") +minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling") +minetest.register_alias("farming:rubber_sapling", "moretrees:rubber_tree_sapling") + +minetest.register_alias("moretrees:conifer_trunk", "moretrees:fir_trunk") +minetest.register_alias("moretrees:conifer_trunk_sideways", "moretrees:fir_trunk_sideways") +minetest.register_alias("moretrees:conifer_leaves", "moretrees:fir_leaves") +minetest.register_alias("moretrees:conifer_leaves_bright", "moretrees:fir_leaves_bright") +minetest.register_alias("moretrees:conifer_sapling", "moretrees:fir_sapling") + +minetest.register_alias("conifers:trunk", "moretrees:fir_trunk") +minetest.register_alias("conifers:trunk_reversed", "moretrees:fir_trunk_sideways") +minetest.register_alias("conifers:leaves", "moretrees:fir_leaves") +minetest.register_alias("conifers:leaves_special", "moretrees:fir_leaves_bright") +minetest.register_alias("conifers:sapling", "moretrees:fir_sapling") + +minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling") +minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree") +minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree") +minetest.register_alias("moretrees:jungletree_planks", "default:junglewood") +minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungletree_leaves") + +minetest.register_alias("jungletree:leaves_green", "default:jungleleaves") +minetest.register_alias("jungletree:leaves_red", "moretrees:jungletree_leaves_red") +minetest.register_alias("jungletree:leaves_yellow", "moretrees:jungletree_leaves_yellow") + +minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree") +minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood") +minetest.register_alias("moretrees:acacia_sapling", "default:acacia_sapling") +minetest.register_alias("moretrees:acacia_leaves", "default:acacia_leaves") + +minetest.register_alias("moretrees:pine_trunk", "default:pinetree") +minetest.register_alias("moretrees:pine_planks", "default:pinewood") +minetest.register_alias("moretrees:pine_sapling", "default:pine_sapling") +minetest.register_alias("moretrees:pine_leaves", "default:pine_needles") |