add acacia and palm trees, refactor saplings.lua
This commit is contained in:
parent
1429fd32f4
commit
ddbd92e627
@ -1,94 +1,40 @@
|
||||
local modpath = minetest.get_modpath("fl_trees")
|
||||
|
||||
minetest.register_node("fl_trees:aspen_sapling", {
|
||||
description = "aspen sapling",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
tiles = {"farlands_aspen_sapling.png"},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
on_timer = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.place_schematic(
|
||||
{x=pos.x-2, y=pos.y, z=pos.z-2},
|
||||
modpath .. "/schems/aspen_tree_" .. math.random(5) .. ".mts",
|
||||
0,
|
||||
nil,
|
||||
false
|
||||
)
|
||||
end,
|
||||
on_costruct = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.get_node_timer(pos):start(20)
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
minetest.get_node_timer(pointed_thing.above):start(20)
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
selection_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}},
|
||||
collision_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}}
|
||||
})
|
||||
local function register_sapling(name, offset)
|
||||
minetest.register_node("fl_trees:" .. name .. "_sapling", {
|
||||
description = name .. " sapling",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
tiles = {"farlands_" .. name .. "_sapling.png"},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
on_timer = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.place_schematic(
|
||||
{x=pos.x-offset.x, y=pos.y, z=pos.z-offset.y},
|
||||
modpath .. "/schems/" .. name .. "_tree_" .. math.random(5) .. ".mts",
|
||||
"random",
|
||||
nil,
|
||||
false
|
||||
)
|
||||
end,
|
||||
on_costruct = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.get_node_timer(pos):start(20)
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
minetest.get_node_timer(pointed_thing.above):start(20)
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
selection_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}},
|
||||
collision_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node("fl_trees:baobab_sapling", {
|
||||
description = "baobab sapling",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
tiles = {"farlands_baobab_sapling.png"},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
on_timer = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.place_schematic(
|
||||
{x=pos.x-3, y=pos.y, z=pos.z-3},
|
||||
modpath .. "/schems/baobab_tree_" .. math.random(5) .. ".mts",
|
||||
0,
|
||||
nil,
|
||||
false
|
||||
)
|
||||
end,
|
||||
on_costruct = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.get_node_timer(pos):start(20)
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
minetest.get_node_timer(pointed_thing.above):start(20)
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
selection_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}},
|
||||
collision_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}}
|
||||
})
|
||||
|
||||
minetest.register_node("fl_trees:apple_sapling", {
|
||||
description = "apple sapling",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
tiles = {"farlands_apple_sapling.png"},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
on_timer = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.place_schematic(
|
||||
{x=pos.x-2, y=pos.y, z=pos.z-2},
|
||||
modpath .. "/schems/apple_tree_" .. math.random(5) .. ".mts",
|
||||
0,
|
||||
nil,
|
||||
false
|
||||
)
|
||||
end,
|
||||
on_costruct = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.get_node_timer(pos):start(20)
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
minetest.get_node_timer(pointed_thing.above):start(20)
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
selection_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}},
|
||||
collision_box = {type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}}
|
||||
})
|
||||
register_sapling("aspen", {x=2,y=2})
|
||||
register_sapling("baobab", {x=3,y=3})
|
||||
register_sapling("apple", {x=2,y=2})
|
||||
register_sapling("acacia", {x=3,y=3})
|
||||
register_sapling("palm", {x=3,y=3})
|
BIN
mods/fl_trees/schems/acacia_tree_1.mts
Normal file
BIN
mods/fl_trees/schems/acacia_tree_1.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/acacia_tree_2.mts
Normal file
BIN
mods/fl_trees/schems/acacia_tree_2.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/acacia_tree_3.mts
Normal file
BIN
mods/fl_trees/schems/acacia_tree_3.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/acacia_tree_4.mts
Normal file
BIN
mods/fl_trees/schems/acacia_tree_4.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/acacia_tree_5.mts
Normal file
BIN
mods/fl_trees/schems/acacia_tree_5.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/palm_tree_1.mts
Normal file
BIN
mods/fl_trees/schems/palm_tree_1.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/palm_tree_2.mts
Normal file
BIN
mods/fl_trees/schems/palm_tree_2.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/palm_tree_3.mts
Normal file
BIN
mods/fl_trees/schems/palm_tree_3.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/palm_tree_4.mts
Normal file
BIN
mods/fl_trees/schems/palm_tree_4.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/schems/palm_tree_5.mts
Normal file
BIN
mods/fl_trees/schems/palm_tree_5.mts
Normal file
Binary file not shown.
BIN
mods/fl_trees/textures/farlands_acacia_sapling.png
Normal file
BIN
mods/fl_trees/textures/farlands_acacia_sapling.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 426 B |
BIN
mods/fl_trees/textures/farlands_palm_sapling.png
Normal file
BIN
mods/fl_trees/textures/farlands_palm_sapling.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 524 B |
Loading…
x
Reference in New Issue
Block a user