Add coconut

master
Wuzzy 2020-11-05 20:30:43 +01:00
parent 733bea2365
commit 1e562a04bb
7 changed files with 63 additions and 1 deletions

View File

@ -1,6 +1,10 @@
License:
Sourcecode: WTFPL (see below)
Graphics: WTFPL (see below)
Graphics: WTFPL with one exception (see below)
The file `hades_trees_coconut.png` by VanessaE
is licensed under
CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0/>.
See also:
http://minetest.net/

View File

@ -0,0 +1,22 @@
local S = minetest.get_translator("hades_trees")
hades_trees.register_sapling("coconut_sapling", {
description = S("Coconut Palm Sapling"),
image = "hades_trees_coconut_sapling.png",
selbox = {-0.25, -0.5, -0.25, 0.25, 0.35, 0.25},
})
hades_trees.register_fruit("coconut", {
description = S("Coconut"),
drawtype = "plantlike",
image = "hades_trees_coconut.png",
selbox = {-5/16, -7/16, -5/16, 5/16, 7/16, 5/16},
})
minetest.register_abm({
nodenames = {"hades_trees:coconut_sapling"},
interval = 60,
chance = 20,
action = function(pos, node)
hades_trees.generate_coconutpalm(pos)
end
})

View File

@ -20,6 +20,8 @@ function hades_trees.grow_sapling(pos, check_light)
hades_trees.generate_orangetree(pos, check_light)
elseif node.name == "hades_trees:cocoa_sapling" then
hades_trees.generate_cocoatree(pos, check_light)
elseif node.name == "hades_trees:coconut_sapling" then
hades_trees.generate_coconutpalm(pos, check_light)
end
end
@ -194,6 +196,23 @@ function hades_trees.generate_cocoatree(pos, check_light, trunk, leaves, undergr
hades_trees.generate_tree(pos, check_light, trunk, leaves, underground, replacements)
end
-- Coconut Palm
function hades_trees.generate_coconutpalm(pos, check_light, trunk, leaves, underground, replacements)
if not trunk then
trunk = "hades_trees:jungle_tree"
end
if not leaves then
leaves = "hades_trees:jungle_leaves"
end
if not underground then
underground = {"hades_core:dirt", "hades_core:dirt_with_grass"}
end
if not replacements then
replacements = {["hades_trees:coconut"]=20}
end
hades_trees.generate_tree(pos, check_light, trunk, leaves, underground, replacements)
end
-- Pale Tree
function hades_trees.generate_paletree(pos, check_light, trunk, leaves, underground)
if not trunk then

View File

@ -12,6 +12,7 @@ dofile(minetest.get_modpath("hades_trees").."/cjtree.lua")
dofile(minetest.get_modpath("hades_trees").."/banana.lua")
dofile(minetest.get_modpath("hades_trees").."/orange.lua")
dofile(minetest.get_modpath("hades_trees").."/cocoa.lua")
dofile(minetest.get_modpath("hades_trees").."/coconut.lua")
dofile(minetest.get_modpath("hades_trees").."/wood.lua")
dofile(minetest.get_modpath("hades_trees").."/crafting.lua")

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

View File

@ -193,3 +193,19 @@ refruit.add_refruit("cocoa", {
bud_selbox = {-0.1875, -0.25, -0.1875, 0.1875, 0.375, 0.1875},
flower_selbox = {-0.1875, -0.1875, -0.1875, 0.1875, 0.5, 0.1875},
})
refruit.add_refruit("coconut", {
fruit_itemstring = "hades_trees:coconut",
bud_description = S("Coconut Bud"),
bud_tt = S("Grows to a Coconut Flower").."\n"..surv.."\n"..S("Needs Common Jungle Leaves to grow"),
flower_description = S("Coconut Flower"),
flower_tt = S("Grows to a Coconut").."\n"..surv.."\n"..S("Needs Common Jungle Leaves to grow"),
bud_interval = 35,
bud_chance = 10,
flower_interval = 34,
flower_chance = 60,
neighbors = {"hades_trees:jungle_leaves"},
bud_selbox = {-2/16, -6/16, -2/16, 2/16, 3/16, 2/16},
flower_selbox = {-5/16, -7/16, -5/16, 5/16, 7/16, 5/16},
})