2013-01-20 22:15:54 +01:00
|
|
|
moretrees.avoidnodes = {}
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-02-12 04:07:40 +01:00
|
|
|
moretrees.treelist = {
|
2013-04-09 04:54:22 +02:00
|
|
|
{"beech", "Beech Tree"},
|
2013-02-11 06:09:53 +01:00
|
|
|
{"apple_tree", "Apple Tree"},
|
|
|
|
{"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 },
|
|
|
|
{"willow", "Willow Tree"},
|
|
|
|
{"rubber_tree", "Rubber Tree"},
|
2013-01-25 05:22:46 +01:00
|
|
|
{"jungletree", "Jungle Tree"},
|
2013-02-11 06:09:53 +01:00
|
|
|
{"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
2013-01-20 00:36:13 +01:00
|
|
|
}
|
|
|
|
|
2013-04-24 14:43:27 +02:00
|
|
|
local dirs1 = { 21, 20, 23, 22, 21 }
|
|
|
|
local dirs2 = { 12, 9, 18, 7, 12 }
|
|
|
|
local dirs3 = { 14, 11, 16, 5, 14 }
|
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_new_leaves_drawtype = "allfaces_optional"
|
|
|
|
local moretrees_new_leaves_extension = ".png"
|
|
|
|
local moretrees_plantlike_leaves_visual_scale = 1
|
|
|
|
|
2013-11-23 05:51:42 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
2013-11-15 00:05:37 +01:00
|
|
|
moretrees_new_leaves_drawtype = "plantlike"
|
|
|
|
moretrees_new_leaves_extension = "_plantlike.png"
|
2013-11-23 05:51:42 +01:00
|
|
|
moretrees_plantlike_leaves_visual_scale = 1.189
|
2013-11-15 00:05:37 +01:00
|
|
|
end
|
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local new_default_leaves = moretrees:clone_node("default:leaves")
|
2013-11-15 00:05:37 +01:00
|
|
|
if moretrees.enable_default_leafdecay then
|
|
|
|
new_default_leaves.groups = {snappy=3, flammable=2, leaves=1}
|
|
|
|
end
|
2013-11-15 02:39:07 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
|
|
|
new_default_leaves.inventory_image = minetest.inventorycube("default_leaves.png")
|
2013-11-23 05:51:42 +01:00
|
|
|
new_default_leaves.drawtype = "plantlike"
|
|
|
|
new_default_leaves.visual_scale = moretrees_plantlike_leaves_visual_scale
|
|
|
|
new_default_leaves.tiles = {"default_leaves_plantlike.png"}
|
2013-11-27 08:48:43 +01:00
|
|
|
else
|
|
|
|
new_default_leaves.waving = 1
|
2013-11-15 02:39:07 +01:00
|
|
|
end
|
2013-11-23 05:51:42 +01:00
|
|
|
if moretrees.enable_default_leafdecay or moretrees.plantlike_leaves then
|
|
|
|
minetest.register_node(":default:leaves", new_default_leaves)
|
|
|
|
end
|
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local new_default_jungleleaves = moretrees:clone_node("default:jungleleaves")
|
2013-11-23 05:51:42 +01:00
|
|
|
if moretrees.enable_default_leafdecay then
|
|
|
|
new_default_jungleleaves.groups = {snappy=3, flammable=2, leaves=1}
|
2013-11-15 02:39:07 +01:00
|
|
|
end
|
|
|
|
if moretrees.plantlike_leaves then
|
2013-11-23 05:51:42 +01:00
|
|
|
new_default_jungleleaves.inventory_image = minetest.inventorycube("default_jungleleaves.png")
|
|
|
|
new_default_jungleleaves.drawtype = "plantlike"
|
|
|
|
new_default_jungleleaves.visual_scale = moretrees_plantlike_leaves_visual_scale
|
|
|
|
new_default_jungleleaves.tiles = {"default_jungleleaves_plantlike.png"}
|
2013-11-27 08:48:43 +01:00
|
|
|
else
|
|
|
|
new_default_jungleleaves.waving = 1
|
2013-11-23 05:51:42 +01:00
|
|
|
end
|
|
|
|
if moretrees.enable_default_leafdecay or moretrees.plantlike_leaves then
|
|
|
|
minetest.register_node(":default:jungleleaves", new_default_jungleleaves)
|
2013-11-15 00:05:37 +01:00
|
|
|
end
|
|
|
|
|
2013-02-12 04:07:40 +01:00
|
|
|
for i in ipairs(moretrees.treelist) do
|
|
|
|
local treename = moretrees.treelist[i][1]
|
|
|
|
local treedesc = moretrees.treelist[i][2]
|
|
|
|
local fruit = moretrees.treelist[i][3]
|
|
|
|
local fruitdesc = moretrees.treelist[i][4]
|
|
|
|
local selbox = moretrees.treelist[i][5]
|
|
|
|
local vscale = moretrees.treelist[i][6]
|
2013-02-11 06:09:53 +01:00
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
if treename ~= "jungletree" then -- the default game provides jungle tree trunk/planks nodes.
|
2013-03-19 22:01:09 +01:00
|
|
|
|
|
|
|
minetest.register_node("moretrees:"..treename.."_trunk", {
|
|
|
|
description = treedesc.." Trunk",
|
|
|
|
tiles = {
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
2013-04-24 14:43:27 +02:00
|
|
|
paramtype2 = "facedir",
|
2013-03-19 22:01:09 +01:00
|
|
|
is_ground_content = true,
|
|
|
|
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-11-08 02:59:50 +01:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
local keys=placer:get_player_control()
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
if not moretrees:node_is_owned(pos, placer) then
|
|
|
|
minetest.rotate_and_place(itemstack, placer, pointed_thing,
|
|
|
|
moretrees.expect_infinite_stacks, { invert_wall = keys.sneak })
|
|
|
|
end
|
2013-11-08 04:06:27 +01:00
|
|
|
return itemstack
|
2013-11-08 02:59:50 +01:00
|
|
|
end
|
2013-03-19 22:01:09 +01:00
|
|
|
})
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-03-19 22:01:09 +01:00
|
|
|
minetest.register_node("moretrees:"..treename.."_planks", {
|
|
|
|
description = treedesc.." Planks",
|
|
|
|
tiles = {"moretrees_"..treename.."_wood.png"},
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-03-19 22:01:09 +01:00
|
|
|
minetest.register_node("moretrees:"..treename.."_sapling", {
|
2013-04-24 14:43:27 +02:00
|
|
|
description = treedesc.." Sapling",
|
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"moretrees_"..treename.."_sapling.png"},
|
|
|
|
inventory_image = "moretrees_"..treename.."_sapling.png",
|
|
|
|
paramtype = "light",
|
2013-11-22 02:33:02 +01:00
|
|
|
paramtype2 = "waving",
|
2013-04-24 14:43:27 +02:00
|
|
|
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},
|
|
|
|
sounds = default.node_sound_defaults(),
|
2013-03-19 22:01:09 +01:00
|
|
|
})
|
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
|
|
|
description = treedesc.." Sapling",
|
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"moretrees_"..treename.."_sapling.png"},
|
|
|
|
inventory_image = "moretrees_"..treename.."_sapling.png",
|
|
|
|
paramtype = "light",
|
2013-11-22 02:33:02 +01:00
|
|
|
paramtype2 = "waving",
|
2013-09-15 04:44:32 +02:00
|
|
|
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},
|
|
|
|
sounds = default.node_sound_defaults(),
|
|
|
|
drop = "moretrees:"..treename.."_sapling"
|
|
|
|
})
|
|
|
|
|
2013-03-19 22:01:09 +01:00
|
|
|
-- 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
|
2013-01-22 02:31:28 +01:00
|
|
|
|
2013-10-02 19:43:50 +02:00
|
|
|
|
|
|
|
local droprarity = 100
|
|
|
|
|
|
|
|
if treename ~= "palm" then
|
|
|
|
droprarity = 20
|
|
|
|
end
|
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_leaves_inventory_image = nil
|
|
|
|
local moretrees_new_leaves_waving = nil
|
2013-11-22 00:40:55 +01:00
|
|
|
|
2013-11-15 02:39:07 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
2013-11-16 23:38:46 +01:00
|
|
|
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_"..treename.."_leaves.png")
|
2013-11-27 08:48:43 +01:00
|
|
|
else
|
|
|
|
moretrees_new_leaves_waving = 1
|
2013-11-15 02:39:07 +01:00
|
|
|
end
|
|
|
|
|
2013-03-19 22:01:09 +01:00
|
|
|
minetest.register_node("moretrees:"..treename.."_leaves", {
|
|
|
|
description = treedesc.." Leaves",
|
2013-11-15 00:05:37 +01:00
|
|
|
drawtype = moretrees_new_leaves_drawtype,
|
2013-11-27 08:48:43 +01:00
|
|
|
waving = moretrees_new_leaves_waving,
|
2013-11-23 05:51:42 +01:00
|
|
|
visual_scale = moretrees_plantlike_leaves_visual_scale,
|
2013-11-15 00:05:37 +01:00
|
|
|
tiles = { "moretrees_"..treename.."_leaves"..moretrees_new_leaves_extension },
|
2013-11-16 23:38:46 +01:00
|
|
|
inventory_image = moretrees_leaves_inventory_image,
|
2013-03-19 22:01:09 +01:00
|
|
|
paramtype = "light",
|
|
|
|
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2013-10-02 19:43:50 +02:00
|
|
|
{items = {"moretrees:"..treename.."_sapling"}, rarity = droprarity },
|
2013-03-19 22:01:09 +01:00
|
|
|
{items = {"moretrees:"..treename.."_leaves"} }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
2013-04-08 04:22:01 +02:00
|
|
|
|
2013-07-22 09:55:12 +02:00
|
|
|
if minetest.get_modpath("moreblocks") and moretrees.enable_stairsplus then
|
|
|
|
|
|
|
|
register_stair(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_trunk",
|
|
|
|
"moretrees:"..treename.."_trunk",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2, not_in_creative_inventory=1, tree_stair=1 },
|
|
|
|
{ "moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
|
|
|
treedesc.." Trunk",
|
|
|
|
treename.."_trunk",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_slab(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_trunk",
|
|
|
|
"moretrees:"..treename.."_trunk",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2, not_in_creative_inventory=1, tree_slab=1 },
|
|
|
|
{ "moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
|
|
|
treedesc.." Trunk",
|
|
|
|
treename.."_trunk",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_panel(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_trunk",
|
|
|
|
"moretrees:"..treename.."_trunk",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2, not_in_creative_inventory=1, tree_panel=1 },
|
|
|
|
{ "moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
|
|
|
treedesc.." Trunk",
|
|
|
|
treename.."_trunk",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_micro(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_trunk",
|
|
|
|
"moretrees:"..treename.."_trunk",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2, not_in_creative_inventory=1, tree_micro=1 },
|
|
|
|
{ "moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
|
|
|
treedesc.." Trunk",
|
|
|
|
treename.."_trunk",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_stair(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_planks",
|
|
|
|
"moretrees:"..treename.."_planks",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory=1, wood_stair=1 },
|
|
|
|
{ "moretrees_"..treename.."_wood.png" },
|
|
|
|
treedesc.." Planks",
|
|
|
|
treename.."_planks",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_slab(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_planks",
|
|
|
|
"moretrees:"..treename.."_planks",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory=1, wood_slab=1 },
|
|
|
|
{ "moretrees_"..treename.."_wood.png" },
|
|
|
|
treedesc.." Planks",
|
|
|
|
treename.."_planks",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_panel(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_planks",
|
|
|
|
"moretrees:"..treename.."_planks",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory=1, wood_panel=1 },
|
|
|
|
{ "moretrees_"..treename.."_wood.png" },
|
|
|
|
treedesc.." Planks",
|
|
|
|
treename.."_planks",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
register_micro(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_planks",
|
|
|
|
"moretrees:"..treename.."_planks",
|
|
|
|
{ snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory=1, wood_micro=1 },
|
|
|
|
{ "moretrees_"..treename.."_wood.png" },
|
|
|
|
treedesc.." Planks",
|
|
|
|
treename.."_planks",
|
|
|
|
0
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
table.insert(circular_saw.known_stairs, "moretrees:"..treename.."_trunk")
|
|
|
|
table.insert(circular_saw.known_stairs, "moretrees:"..treename.."_planks")
|
|
|
|
end
|
2013-03-19 22:01:09 +01:00
|
|
|
end
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
if fruit then
|
2013-01-20 00:36:13 +01:00
|
|
|
minetest.register_node("moretrees:"..fruit, {
|
|
|
|
description = fruitdesc,
|
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = { "moretrees_"..fruit..".png" },
|
2013-01-25 05:22:46 +01:00
|
|
|
inventory_image = "moretrees_"..fruit..".png^[transformR180",
|
|
|
|
wield_image = "moretrees_"..fruit..".png^[transformR180",
|
|
|
|
visual_scale = vscale,
|
2013-01-20 00:36:13 +01:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = selbox
|
|
|
|
},
|
2013-02-11 06:09:53 +01:00
|
|
|
groups = {fleshy=3,dig_immediate=3,flammable=2, attached_node=1},
|
2013-01-20 00:36:13 +01:00
|
|
|
sounds = default.node_sound_defaults(),
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2013-04-24 14:43:27 +02:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "moretrees:"..treename.."_trunk_sideways" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
|
|
|
nfdir = dirs2[fdir+1]
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "moretrees:"..treename.."_trunk", param2 = nfdir})
|
2013-04-24 14:43:27 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2013-01-25 05:22:46 +01:00
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_trunk")
|
2013-09-15 04:44:32 +02:00
|
|
|
|
|
|
|
if moretrees.spawn_saplings then
|
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_sapling")
|
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_sapling_ongen")
|
|
|
|
end
|
2013-01-25 05:22:46 +01:00
|
|
|
end
|
2013-01-22 02:31:28 +01:00
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
-- Extra nodes for jungle trees:
|
|
|
|
|
|
|
|
minetest.register_node("moretrees:jungletree_sapling", {
|
|
|
|
description = "Jungle Sapling",
|
|
|
|
drawtype = "plantlike",
|
|
|
|
visual_scale = 1.0,
|
|
|
|
tiles = {"default_junglesapling.png"},
|
|
|
|
inventory_image = "default_junglesapling.png",
|
|
|
|
wield_image = "default_junglesapling.png",
|
|
|
|
paramtype = "light",
|
2013-11-22 02:33:02 +01:00
|
|
|
paramtype2 = "waving",
|
2013-09-15 04:44:32 +02:00
|
|
|
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},
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("moretrees:jungletree_sapling_ongen", {
|
|
|
|
description = "Jungle Sapling",
|
|
|
|
drawtype = "plantlike",
|
|
|
|
visual_scale = 1.0,
|
|
|
|
tiles = {"default_junglesapling.png"},
|
|
|
|
inventory_image = "default_junglesapling.png",
|
|
|
|
wield_image = "default_junglesapling.png",
|
|
|
|
paramtype = "light",
|
2013-11-22 02:33:02 +01:00
|
|
|
paramtype2 = "waving",
|
2013-09-15 04:44:32 +02:00
|
|
|
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},
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
drop = "moretrees:jungletree_sapling"
|
|
|
|
})
|
2013-01-22 02:31:28 +01:00
|
|
|
|
2013-01-25 05:22:46 +01:00
|
|
|
local jungleleaves = {"green","yellow","red"}
|
|
|
|
local jungleleavesnames = {"Green", "Yellow", "Red"}
|
2013-01-20 00:36:13 +01:00
|
|
|
for color = 1, 3 do
|
2013-01-25 05:22:46 +01:00
|
|
|
local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color]
|
2013-11-16 23:38:46 +01:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_leaves_inventory_image = nil
|
|
|
|
|
2013-11-16 23:38:46 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
|
|
|
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_jungletree_leaves_"..jungleleaves[color]..".png")
|
2013-12-25 10:20:51 +01:00
|
|
|
else
|
|
|
|
moretrees_new_leaves_waving = 1
|
2013-11-16 23:38:46 +01:00
|
|
|
end
|
|
|
|
|
2013-01-20 00:36:13 +01:00
|
|
|
minetest.register_node(leave_name, {
|
2013-01-25 05:22:46 +01:00
|
|
|
description = "Jungle Tree Leaves ("..jungleleavesnames[color]..")",
|
2013-11-15 00:05:37 +01:00
|
|
|
drawtype = moretrees_new_leaves_drawtype,
|
2013-11-27 08:48:43 +01:00
|
|
|
waving = moretrees_new_leaves_waving,
|
2013-11-23 05:51:42 +01:00
|
|
|
visual_scale = moretrees_plantlike_leaves_visual_scale,
|
2013-11-15 00:05:37 +01:00
|
|
|
tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..moretrees_new_leaves_extension},
|
2013-11-16 23:38:46 +01:00
|
|
|
inventory_image = moretrees_leaves_inventory_image,
|
2013-01-20 00:36:13 +01:00
|
|
|
paramtype = "light",
|
2013-02-14 03:25:24 +01:00
|
|
|
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
|
2013-01-20 00:36:13 +01:00
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2013-01-31 03:51:18 +01:00
|
|
|
{items = {'moretrees:jungletree_sapling'}, rarity = 100 },
|
2013-01-25 05:22:46 +01:00
|
|
|
{items = {"moretrees:jungletree_leaves_"..jungleleaves[color]} }
|
2013-01-20 00:36:13 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2013-01-25 05:22:46 +01:00
|
|
|
-- Extra needles for firs
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_leaves_inventory_image = nil
|
|
|
|
|
2013-11-16 23:38:46 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
|
|
|
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_fir_leaves_bright.png")
|
|
|
|
end
|
|
|
|
|
2013-01-22 02:50:41 +01:00
|
|
|
minetest.register_node("moretrees:fir_leaves_bright", {
|
2013-11-15 00:05:37 +01:00
|
|
|
drawtype = moretrees_new_leaves_drawtype,
|
2013-11-27 08:48:43 +01:00
|
|
|
waving = moretrees_new_leaves_waving,
|
2013-11-23 05:51:42 +01:00
|
|
|
visual_scale = moretrees_plantlike_leaves_visual_scale,
|
2013-01-27 19:17:27 +01:00
|
|
|
description = "Douglas Fir Leaves (Bright)",
|
2013-11-15 02:39:07 +01:00
|
|
|
tiles = { "moretrees_fir_leaves_bright"..moretrees_new_leaves_extension },
|
2013-11-16 23:38:46 +01:00
|
|
|
inventory_image = moretrees_leaves_inventory_image,
|
2013-01-20 00:36:13 +01:00
|
|
|
paramtype = "light",
|
2013-02-14 03:25:24 +01:00
|
|
|
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1 },
|
2013-01-20 00:36:13 +01:00
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2013-01-31 03:51:18 +01:00
|
|
|
{items = {'moretrees:fir_sapling'}, rarity = 100 },
|
2013-01-25 05:22:46 +01:00
|
|
|
{items = {'moretrees:fir_leaves'} }
|
2013-01-20 00:36:13 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
sounds = default.node_sound_leaves_defaults()
|
|
|
|
})
|
|
|
|
|
2013-02-11 18:23:05 +01:00
|
|
|
if moretrees.enable_redefine_apple then
|
2013-12-15 19:30:17 +01:00
|
|
|
local new_default_apple = moretrees:clone_node("default:apple")
|
2013-11-15 00:11:42 +01:00
|
|
|
new_default_apple.groups.attached_node = 1
|
2013-12-15 19:30:17 +01:00
|
|
|
minetest.register_node(":default:apple", new_default_apple)
|
2013-02-11 18:23:05 +01:00
|
|
|
end
|
|
|
|
|
2013-02-12 04:07:40 +01:00
|
|
|
table.insert(moretrees.avoidnodes, "default:jungletree")
|
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk")
|
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:fir_trunk")
|
2013-04-09 04:54:22 +02:00
|
|
|
table.insert(moretrees.avoidnodes, "default:tree")
|
2013-01-22 02:31:28 +01:00
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
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")
|
|
|
|
end
|
|
|
|
|
2013-04-13 19:58:35 +02:00
|
|
|
-- "empty" (tapped) rubber tree nodes
|
|
|
|
|
|
|
|
minetest.register_node("moretrees:rubber_tree_trunk_empty", {
|
|
|
|
description = "Rubber Tree Trunk (Empty)",
|
|
|
|
tiles = {
|
|
|
|
"moretrees_rubber_tree_trunk_top.png",
|
|
|
|
"moretrees_rubber_tree_trunk_top.png",
|
|
|
|
"moretrees_rubber_tree_trunk_empty.png"
|
|
|
|
},
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
paramtype2 = "facedir",
|
2013-11-08 02:59:50 +01:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
local keys=placer:get_player_control()
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
if not moretrees:node_is_owned(pos, placer) then
|
|
|
|
minetest.rotate_and_place(itemstack, placer, pointed_thing,
|
|
|
|
moretrees.expect_infinite_stacks, { invert_wall = keys.sneak })
|
|
|
|
end
|
2013-11-09 01:02:47 +01:00
|
|
|
return itemstack
|
2013-11-27 23:31:38 +01:00
|
|
|
end,
|
2013-11-27 23:32:21 +01:00
|
|
|
after_place_node = function(pos, placer, itemstack)
|
2013-11-27 23:31:38 +01:00
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_int("placed", 1)
|
2013-11-08 02:59:50 +01:00
|
|
|
end
|
2013-04-13 19:58:35 +02:00
|
|
|
})
|
|
|
|
|
2013-04-27 02:12:22 +02:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "moretrees:rubber_tree_trunk_empty_sideways" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
|
|
|
nfdir = dirs2[fdir+1]
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "moretrees:rubber_tree_trunk_empty", param2 = nfdir})
|
2013-04-27 02:12:22 +02:00
|
|
|
end,
|
|
|
|
})
|
2013-04-13 19:58:35 +02:00
|
|
|
|
2013-04-08 04:09:18 +02:00
|
|
|
-- For compatibility with old nodes and recently-changed nodes.
|
|
|
|
|
2013-04-13 19:58:35 +02:00
|
|
|
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("technic:rubber_leaves", "moretrees:rubber_tree_leaves")
|
|
|
|
minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves")
|
|
|
|
|
|
|
|
minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling")
|
|
|
|
minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling")
|
2013-04-10 22:56:46 +02:00
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
minetest.register_alias("default:junglesapling","moretrees:jungletree_sapling")
|
Update 2013-04-17: Got rid of horizontal jungle tree trunk, aliased it
to the one in the moreblocks mod. Got rid of jungle tree planks recipe,
default already has it. But that's not the important part...
Acorns, fir/spruce/pine cones, and coconuts are now edible!
Fir/spruce/pine cones can be cooked to extract fir/spruce/pine nuts. One cone yields 4 portions of nuts, each of which heals 1/2 heart.
Coconuts can be broken apart to get milk and raw coconut solids (e.g. the "meat"). Craft one coconut, one drinking glass, and one cutting tool (*see below). Yields one portion of coconut solids, one glass full of coconut milk, and the tool is returned. The coconut milk heals 1 heart and returns the empty glass, while one portion of coconut solids heals two hearts.
Coconut milk can be crafted with four acorns to produce acorn muffin batter. One portion of this batter can be cooked into four acorn muffins. Each muffin restores two hearts.
Enjoy :-)
-----
* Since Minetest doesn't have any default cutting tools that would normally be suitable for this purpose, the following tools may be used instead to cut the coconuts open:
Default bronze, diamond, Mese, or steel axe,
...or... glooptest Alatro or Arol axe,
...or... moreores Mithril or silver axe,
...or... titanium axe.
(note that stone and wooden axes are deliberately not usable)
2013-04-18 01:30:17 +02:00
|
|
|
minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree")
|
|
|
|
|
2013-01-22 02:31:28 +01:00
|
|
|
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")
|
|
|
|
|
2013-01-22 02:50:41 +01:00
|
|
|
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")
|
2013-01-22 02:31:28 +01:00
|
|
|
|