first commit
55
README.txt
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
.:::. .:::. love_mod
|
||||||
|
:::::::.::::::: by: crazyginger72 (Ginger Pollard)
|
||||||
|
::::::::::::::: ver: 1.0 2014
|
||||||
|
':::::::::::::'
|
||||||
|
':::::::::' This mod was made for someone very special
|
||||||
|
':::::' to me, my truest friend in the world and
|
||||||
|
':' the nicest person I ever have meet!
|
||||||
|
*****shadowzone*****
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Wealcome to the love_mod. This mod adds romantic, loved themed
|
||||||
|
nodes and tools to you inventory to help spread something special.
|
||||||
|
|
||||||
|
dependiencies:
|
||||||
|
*default
|
||||||
|
*stairs
|
||||||
|
*wool
|
||||||
|
*dye?
|
||||||
|
|
||||||
|
########WARNING#########
|
||||||
|
If you are yousing a version of the "3d_armor" mod that includes
|
||||||
|
"admin armor", DO NOT use the wand on anyone wearing admin armor
|
||||||
|
as it will KILL them instantly 99% of the time!!!!!!!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
license:
|
||||||
|
|
||||||
|
Custom license: The contents of this mod may be used, modified,
|
||||||
|
or distruibuted for personal use only. The contents of this mod
|
||||||
|
may not be used in any comercial software or other comerical
|
||||||
|
content or in any way that derives profit from said content,
|
||||||
|
The contents of this mod also may not be packaged with any
|
||||||
|
software or other content that is not free. Any re-distrubitions
|
||||||
|
or moddified code and or files from this mod must include a copy
|
||||||
|
of the original license and be acredited to the original
|
||||||
|
author/creator along with a copy of the un-modified code or file(s).
|
||||||
|
|
||||||
|
non-profit server clause: The contents of this mod MAY be used
|
||||||
|
on any server or in such settings as provided that the use of
|
||||||
|
said server or other setting does not change a fee or demand
|
||||||
|
any other forms of financial restitutions or exchanges.
|
57
crafts.lua
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:heart 7',
|
||||||
|
recipe = {
|
||||||
|
{"wool:red", "","wool:red"},
|
||||||
|
{"wool:red","wool:red","wool:red"},
|
||||||
|
{"" ,"wool:red","" },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:wand',
|
||||||
|
recipe = {
|
||||||
|
{"wool:red" ,"default:mese_crystal","wool:red" },
|
||||||
|
{"" ,"default:stick" ,"" },
|
||||||
|
{"love_mod:heart","default:diamond" ,"love_mod:heart"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:sapling 8',
|
||||||
|
recipe = {
|
||||||
|
{"default:sapling","default:sapling","default:sapling"},
|
||||||
|
{"default:sapling","love_mod:heart" ,"default:sapling"},
|
||||||
|
{"default:sapling","default:sapling","default:sapling"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:wood 4',
|
||||||
|
recipe = {
|
||||||
|
{'love_mod:tree'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:wood_heart 4',
|
||||||
|
recipe = {
|
||||||
|
{'love_mod:tree_heart'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:glass 8',
|
||||||
|
recipe = {
|
||||||
|
{"default:glass","default:glass" ,"default:glass"},
|
||||||
|
{"default:glass","love_mod:heart","default:glass"},
|
||||||
|
{"default:glass","default:glass" ,"default:glass"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'love_mod:heart_wall 14',
|
||||||
|
recipe = {
|
||||||
|
{'love_mod:heart'},
|
||||||
|
}
|
||||||
|
})
|
4
depends.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
default
|
||||||
|
stairs
|
||||||
|
wool
|
||||||
|
dye?
|
22
init.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
.:::. .:::. love_mod
|
||||||
|
:::::::.::::::: by: crazyginger72 (Ginger Pollard)
|
||||||
|
::::::::::::::: ver: 1.0 2014
|
||||||
|
':::::::::::::'
|
||||||
|
':::::::::' This mod was made for someone very special
|
||||||
|
':::::' to me, my truest friend in the world and
|
||||||
|
':' the nicest person I ever have meet!
|
||||||
|
*****shadowzone*****
|
||||||
|
|
||||||
|
|
||||||
|
see README.txt for instruction, description, warnings and license.
|
||||||
|
]]--
|
||||||
|
|
||||||
|
|
||||||
|
love_mod = {}
|
||||||
|
|
||||||
|
dofile(minetest.get_modpath("love_mod").."/crafts.lua")
|
||||||
|
dofile(minetest.get_modpath("love_mod").."/nodes.lua")
|
||||||
|
dofile(minetest.get_modpath("love_mod").."/tools.lua")
|
||||||
|
dofile(minetest.get_modpath("love_mod").."/trees.lua")
|
226
nodes.lua
Normal file
@ -0,0 +1,226 @@
|
|||||||
|
-- GENERATED CODE
|
||||||
|
-- Node Box Editor, version 0.6.4 - Stone
|
||||||
|
-- Namespace: test
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:heart", {
|
||||||
|
description = "Heart",
|
||||||
|
tiles = {"love_mod_heart.png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
light_source = 1,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3,tree=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.0625, -0.5, -0.4375, 0.0625, 0.3125, 0.4375}, -- NodeBox1
|
||||||
|
{-0.1875, -0.4375, -0.4375, 0.1875, 0.25, 0.4375}, -- NodeBox2
|
||||||
|
{-0.25, -0.375, -0.4375, 0.25, 0.25, 0.4375}, -- NodeBox3
|
||||||
|
{-0.3125, -0.3125, -0.4375, 0.3125, 0.25, 0.4375}, -- NodeBox4
|
||||||
|
{-0.375, -0.25, -0.4375, 0.375, 0.25, 0.4375}, -- NodeBox5
|
||||||
|
{-0.4375, -0.1875, -0.4375, 0.4375, 0.25, 0.4375}, -- NodeBox6
|
||||||
|
{-0.5, -0.0625, -0.4375, 0.5, 0.25, 0.4375}, -- NodeBox7
|
||||||
|
{-0.4375, 0.25, -0.4375, -0.0625, 0.375, 0.4375}, -- NodeBox8
|
||||||
|
{0.0625, 0.25, -0.4375, 0.4375, 0.375, 0.4375}, -- NodeBox9
|
||||||
|
{-0.375, 0.375, -0.4375, -0.125, 0.4375, 0.4375}, -- NodeBox10
|
||||||
|
{0.125, 0.375, -0.4375, 0.375, 0.4375, 0.4375}, -- NodeBox11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {0.5,0.4375,0.4375,-0.5,-0.5,-0.4375},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:heart_wall", {
|
||||||
|
description = "Wall Heart",
|
||||||
|
tiles = {"love_mod_heart.png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
light_source = 1,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3,tree=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.0625, -0.5, 0.4375, 0.0625, 0.3125, 0.5}, -- NodeBox1
|
||||||
|
{-0.1875, -0.4375, 0.4375, 0.1875, 0.25, 0.5}, -- NodeBox2
|
||||||
|
{-0.25, -0.375, 0.4375, 0.25, 0.25, 0.5}, -- NodeBox3
|
||||||
|
{-0.3125, -0.3125, 0.4375, 0.3125, 0.25, 0.5}, -- NodeBox4
|
||||||
|
{-0.375, -0.25, 0.4375, 0.375, 0.25, 0.5}, -- NodeBox5
|
||||||
|
{-0.4375, -0.1875, 0.4375, 0.4375, 0.25, 0.5}, -- NodeBox6
|
||||||
|
{-0.5, -0.0625, 0.4375, 0.5, 0.25, 0.5}, -- NodeBox7
|
||||||
|
{-0.4375, 0.25, 0.4375, -0.0625, 0.375, 0.5}, -- NodeBox8
|
||||||
|
{0.0625, 0.25, 0.4375, 0.4375, 0.375, 0.5}, -- NodeBox9
|
||||||
|
{-0.375, 0.375, 0.4375, -0.125, 0.4375, 0.5}, -- NodeBox10
|
||||||
|
{0.125, 0.375, 0.4375, 0.375, 0.4375, 0.5}, -- NodeBox11
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {0.5,0.5,0.4375,-0.5,-0.5,0.5},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:sapling", {
|
||||||
|
description = "Love Tree Sapling",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
visual_scale = 1.5,
|
||||||
|
tiles = {"love_mod_sapling.png"},
|
||||||
|
inventory_image = "love_mod_hearts.png^love_mod_sapling.png",
|
||||||
|
wield_image = "love_mod_sapling.png",
|
||||||
|
paramtype = "light",
|
||||||
|
walkable = false,
|
||||||
|
is_ground_content = true,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.45, -0.75, -0.45, 0.45, 0.525, 0.45}
|
||||||
|
},
|
||||||
|
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:heart_food", {
|
||||||
|
description = "Yummy Heart",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
visual_scale = 1.0,
|
||||||
|
tiles = {"love_mod_hearts.png"},
|
||||||
|
inventory_image = "love_mod_hearts.png",
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
is_ground_content = true,
|
||||||
|
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(3),
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
after_place_node = function(pos, placer, itemstack)
|
||||||
|
if placer:is_player() then
|
||||||
|
minetest.set_node(pos, {name="love_mod:sapling", param2=1})
|
||||||
|
else
|
||||||
|
minetest.set_node(pos, {name="love_mod:heart_food", param2=1})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:leaves", {
|
||||||
|
description = "Leaves",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
visual_scale = 1.3,
|
||||||
|
tiles = {"default_leaves.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
waving = 1,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1, not_in_creative_inventory=1},
|
||||||
|
drop = {
|
||||||
|
max_items = 1,
|
||||||
|
items = {
|
||||||
|
{
|
||||||
|
-- player will get sapling with 1/20 chance
|
||||||
|
items = {'love_mod:sapling'},
|
||||||
|
rarity = 30,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- player will get leaves only if he get no saplings,
|
||||||
|
-- this is because max_items is 1
|
||||||
|
items = {'default:leaves'},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:jungleleaves", {
|
||||||
|
description = "Leaves",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
visual_scale = 1.3,
|
||||||
|
tiles = {"default_jungleleaves.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
waving = 1,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1, not_in_creative_inventory=1},
|
||||||
|
drop = {
|
||||||
|
max_items = 1,
|
||||||
|
items = {
|
||||||
|
{
|
||||||
|
-- player will get sapling with 1/20 chance
|
||||||
|
items = {'love_mod:sapling'},
|
||||||
|
rarity = 30,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- player will get leaves only if he get no saplings,
|
||||||
|
-- this is because max_items is 1
|
||||||
|
items = {'default:leaves'},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:glass", {
|
||||||
|
description = "Love Glass",
|
||||||
|
drawtype = "glasslike_framed",
|
||||||
|
tiles = {"default_obsidian_glass.png", "love_mod_glass.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
light_source = 1,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:tree_heart", {
|
||||||
|
description = "Tree With Heart",
|
||||||
|
tiles = {"love_mod_tree_top.png", "love_mod_tree_top.png", "love_mod_tree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
stack_max = 99,
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:tree", {
|
||||||
|
description = "Tree",
|
||||||
|
tiles = {"love_mod_tree_top.png", "love_mod_tree_top.png", "default_tree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
stack_max = 99,
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:wood", {
|
||||||
|
description = "Wooden Planks",
|
||||||
|
tiles = {"love_mod_wood.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 ="facedir",
|
||||||
|
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("love_mod:wood_heart", {
|
||||||
|
description = "Wooden Heart Planks",
|
||||||
|
tiles = {"love_mod_wood.png^love_mod_hearts.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
stairs.register_stair_and_slab("love_wood", "love_mod:wood",
|
||||||
|
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||||
|
{"love_mod_wood.png"},
|
||||||
|
"Love Mod Wooden Stair",
|
||||||
|
"Love Mod Wooden Slab",
|
||||||
|
default.node_sound_wood_defaults())
|
BIN
textures/love_mod_glass.png
Normal file
After Width: | Height: | Size: 417 B |
BIN
textures/love_mod_heart.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
textures/love_mod_hearts.png
Normal file
After Width: | Height: | Size: 633 B |
BIN
textures/love_mod_sapling.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
textures/love_mod_tree.png
Normal file
After Width: | Height: | Size: 711 B |
BIN
textures/love_mod_tree_top.png
Normal file
After Width: | Height: | Size: 776 B |
BIN
textures/love_mod_wand.png
Normal file
After Width: | Height: | Size: 650 B |
BIN
textures/love_mod_wood.png
Normal file
After Width: | Height: | Size: 323 B |
10
tools.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
minetest.register_tool("love_mod:wand", {
|
||||||
|
description = "Love Wand",
|
||||||
|
inventory_image = "love_mod_wand.png",
|
||||||
|
tool_capabilities = {
|
||||||
|
full_punch_interval = 0.5,
|
||||||
|
max_drop_level=1,
|
||||||
|
damage_groups = {fleshy= -10},
|
||||||
|
groupcaps={},
|
||||||
|
}
|
||||||
|
})
|
106
trees.lua
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
local c_air = minetest.get_content_id("air")
|
||||||
|
local c_ignore = minetest.get_content_id("ignore")
|
||||||
|
local c_tree = minetest.get_content_id("love_mod:tree")
|
||||||
|
local c_ltree = minetest.get_content_id("love_mod:tree_heart")
|
||||||
|
local c_fruit = minetest.get_content_id("love_mod:heart_food")
|
||||||
|
|
||||||
|
function love_mod.grow_tree(data, a, pos, c_leaves)
|
||||||
|
|
||||||
|
local th = math.random(4, 6)
|
||||||
|
local x, y, z = pos.x, pos.y, pos.z
|
||||||
|
for yy = y, y+th-1 do
|
||||||
|
local vi = a:index(x, yy, z)
|
||||||
|
if a:contains(x, yy, z) and (data[vi] == c_air or yy == y) then
|
||||||
|
data[vi] = c_tree
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local vil = a:index(x, y+1, z)
|
||||||
|
if a:contains(x, y+1, z) and (data[vil] == c_tree ) then
|
||||||
|
data[vil] = c_ltree
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
y = y+th-1 -- (x, y, z) is now last piece of trunk
|
||||||
|
local leaves_a = VoxelArea:new{MinEdge={x=-2, y=-1, z=-2}, MaxEdge={x=2, y=2, z=2}}
|
||||||
|
local leaves_buffer = {}
|
||||||
|
|
||||||
|
-- Force leaves near the trunk
|
||||||
|
local d = 1
|
||||||
|
for xi = -d, d do
|
||||||
|
for yi = -d, d do
|
||||||
|
for zi = -d, d do
|
||||||
|
leaves_buffer[leaves_a:index(xi, yi, zi)] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add leaves randomly
|
||||||
|
for iii = 1, 12 do
|
||||||
|
local d = 1
|
||||||
|
local xx = math.random(leaves_a.MinEdge.x, leaves_a.MaxEdge.x - d)
|
||||||
|
local yy = math.random(leaves_a.MinEdge.y, leaves_a.MaxEdge.y - d)
|
||||||
|
local zz = math.random(leaves_a.MinEdge.z, leaves_a.MaxEdge.z - d)
|
||||||
|
|
||||||
|
for xi = 0, d do
|
||||||
|
for yi = 0, d do
|
||||||
|
for zi = 0, d do
|
||||||
|
leaves_buffer[leaves_a:index(xx+xi, yy+yi, zz+zi)] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add the leaves
|
||||||
|
for xi = leaves_a.MinEdge.x, leaves_a.MaxEdge.x do
|
||||||
|
for yi = leaves_a.MinEdge.y, leaves_a.MaxEdge.y do
|
||||||
|
for zi = leaves_a.MinEdge.z, leaves_a.MaxEdge.z do
|
||||||
|
if a:contains(x+xi, y+yi, z+zi) then
|
||||||
|
local vi = a:index(x+xi, y+yi, z+zi)
|
||||||
|
if data[vi] == c_air or data[vi] == c_ignore then
|
||||||
|
if leaves_buffer[leaves_a:index(xi, yi, zi)] then
|
||||||
|
if math.random(1, 100) <= 35 then
|
||||||
|
data[vi] = c_fruit
|
||||||
|
else
|
||||||
|
data[vi] = c_leaves
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"love_mod:sapling"},
|
||||||
|
interval = 5,
|
||||||
|
chance = 10,
|
||||||
|
action = function(pos, node)
|
||||||
|
local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
|
||||||
|
local is_soil = minetest.get_item_group(nu, "soil")
|
||||||
|
local is_sand = minetest.get_item_group(nu, "sand")
|
||||||
|
if is_soil ~= 0 then
|
||||||
|
minetest.log("action", "A Love tree grows @"..minetest.pos_to_string(pos))
|
||||||
|
local vm = minetest.get_voxel_manip()
|
||||||
|
local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16})
|
||||||
|
local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
|
||||||
|
local data = vm:get_data()
|
||||||
|
love_mod.grow_tree(data, a, pos, minetest.get_content_id("love_mod:leaves"))
|
||||||
|
vm:set_data(data)
|
||||||
|
vm:write_to_map(data)
|
||||||
|
vm:update_map()
|
||||||
|
elseif is_sand ~= 0 then
|
||||||
|
minetest.log("action", "A Love tree grows @"..minetest.pos_to_string(pos))
|
||||||
|
local vm = minetest.get_voxel_manip()
|
||||||
|
local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16})
|
||||||
|
local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
|
||||||
|
local data = vm:get_data()
|
||||||
|
love_mod.grow_tree(data, a, pos, minetest.get_content_id("love_mod:jungleleaves"))
|
||||||
|
vm:set_data(data)
|
||||||
|
vm:write_to_map(data)
|
||||||
|
vm:update_map()
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
})
|