Imported the classic bushes into Plantlife, updated it to the current

plants_lib API (in the process, added some reasonable biome controls),
made it able to grow on Undergrowth modpack's dirt/grass with leaves
nodes.
This commit is contained in:
Vanessa Ezekowitz 2013-09-28 11:36:36 -04:00
parent c34828ef9d
commit e750a6bb59
12 changed files with 150 additions and 0 deletions

View File

@ -0,0 +1,81 @@
-- Basket
minetest.register_node(":bushes:basket_empty", {
description = "Basket",
tiles = {
"bushes_basket_empty_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
groups = { dig_immediate = 3 },
})
minetest.register_craft({
output = ':bushes:basket_empty',
recipe = {
{ 'default:stick', 'default:stick', 'default:stick' },
{ '', 'default:stick', '' },
},
})
-- Sugar
minetest.register_craftitem(":bushes:sugar", {
description = "Sugar",
inventory_image = "bushes_sugar.png",
on_use = minetest.item_eat(1),
})
minetest.register_craft({
output = 'bushes:sugar 1',
recipe = {
{ 'default:papyrus', 'default:papyrus' },
},
})
-- Raw pie
minetest.register_craftitem(":bushes:berry_pie_raw", {
description = "Raw berry pie",
inventory_image = "bushes_berry_pie_raw.png",
on_use = minetest.item_eat(3),
})
minetest.register_craft({
output = 'bushes:berry_pie_raw 1',
recipe = {
{ 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' },
{ 'bushes:strawberry', 'bushes:strawberry', 'bushes:strawberry' },
},
})
-- Cooked pie
minetest.register_craftitem(":bushes:berry_pie_cooked", {
description = "Cooked berry pie",
inventory_image = "bushes_berry_pie_cooked.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
type = 'cooking',
output = 'bushes:berry_pie_cooked',
recipe = 'bushes:berry_pie_raw',
cooktime = 30,
})
-- Basket with pies
minetest.register_node(":bushes:basket_pies", {
description = "Basket with pies",
tiles = {
"bushes_basket_full_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
on_use = minetest.item_eat(15),
groups = { dig_immediate = 3 },
})
minetest.register_craft({
output = 'bushes:basket_pies 1',
recipe = {
{ 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked' },
{ '', 'bushes:basket_empty', '' },
},
})

View File

@ -0,0 +1,2 @@
default
plants_lib

67
bushes_classic/init.lua Normal file
View File

@ -0,0 +1,67 @@
local BUSHES = {
"strawberry",
}
local BUSHES_DESCRIPTIONS = {
"Strawberry",
}
local spawn_list = {}
for i, bush_name in ipairs(BUSHES) do
minetest.register_node(":bushes:" .. bush_name .. "_bush", {
description = BUSHES_DESCRIPTIONS[i] .. " bush",
drawtype = "plantlike",
visual_scale = 1.3,
tiles = { "bushes_" .. bush_name .. "_bush.png" },
inventory_image = "bushes_" .. bush_name .. "_bush.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
drop = 'bushes:' .. bush_name .. ' 4',
groups = { snappy = 3, bush = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craftitem(":bushes:" .. bush_name, {
description = BUSHES_DESCRIPTIONS[i],
inventory_image = "bushes_" .. bush_name .. ".png",
stack_max = 99,
on_use = minetest.item_eat(1),
})
minetest.register_craft({
output = 'bushes:' .. bush_name .. '_bush',
recipe = {
{ 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name },
{ 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name },
}
})
table.insert(spawn_list, "bushes:"..bush_name.."_bush")
end
plantslib:spawn_on_surfaces({
spawn_delay = 3600,
spawn_plants = spawn_list,
avoid_radius = 10,
spawn_chance = 100,
spawn_surfaces = {
"default:dirt_with_grass",
"woodsoils:dirt_with_leaves_1",
"woodsoils:grass_with_leaves_1",
"woodsoils:grass_with_leaves_2"
},
avoid_nodes = {"group:bush"},
seed_diff = 545342534, -- guaranteed to be random :P
plantlife_limit = -0.1,
light_min = 10,
temp_min = 0.15, -- approx 20C
temp_max = -0.15, -- approx 35C
humidity_min = 0, -- 50% RH
humidity_max = -1, -- 100% RH
})
dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua')
print("[Bushes] Loaded.")

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB