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.
81
bushes_classic/cooking.lua
Normal 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', '' },
|
||||||
|
},
|
||||||
|
})
|
2
bushes_classic/depends.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
default
|
||||||
|
plants_lib
|
67
bushes_classic/init.lua
Normal 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.")
|
BIN
bushes_classic/textures/bushes_basket_bottom.png
Normal file
After Width: | Height: | Size: 283 B |
BIN
bushes_classic/textures/bushes_basket_empty_top.png
Normal file
After Width: | Height: | Size: 285 B |
BIN
bushes_classic/textures/bushes_basket_full_top.png
Normal file
After Width: | Height: | Size: 633 B |
BIN
bushes_classic/textures/bushes_basket_side.png
Normal file
After Width: | Height: | Size: 320 B |
BIN
bushes_classic/textures/bushes_berry_pie_cooked.png
Normal file
After Width: | Height: | Size: 918 B |
BIN
bushes_classic/textures/bushes_berry_pie_raw.png
Normal file
After Width: | Height: | Size: 918 B |
BIN
bushes_classic/textures/bushes_strawberry.png
Normal file
After Width: | Height: | Size: 824 B |
BIN
bushes_classic/textures/bushes_strawberry_bush.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
bushes_classic/textures/bushes_sugar.png
Normal file
After Width: | Height: | Size: 4.3 KiB |