1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2025-06-08 12:30:39 +02:00

Multiple changes

There are now five bushes in this mod: strawberry, blackberry,
blueberry, raspberry, and gooseberry.

Instead of giving you the fruit, digging a bush now directly gives you
that bush, with a 1/5 chance of getting two.

Craft one bush by itself to turn it into four of the corresponding
fruit.  Craft six of that fruit to get the bush back (this is how it was
before, I opted to keep it that way).

Craft:

- - -
S J S
f f f

That is, two sugar, one jungle grass, and three fruit as before, to get
one raw pie of that fruit.  Cook it as usual.  Heals 2 hearts.

Craft one whole pie by itself to get four slices, each of which heals
1/2 heart.

Craft:

S J S
f f f
f f f

That is, two sugar, one jungle grass, and mix-and-match six fruits to
get two mixed fruit pies.  Cook as usual, craft one to get four slices.

Baskets of pies can be crafted the same as before (craft a basket from
four sticks in a "T" shape, then craft one of those plus three pies of
the desired type).

In addition: some moderate rewriting and re-arranging of the code to
facilitating adding the new objects.

Made the bushes lower-resolution (they were 64px, which made them not
fit in so well into the usual 16px landscape - reduced them to 32px.
Ditto for the basket textures.  Pies are all 16px.

New textures for the pies.
This commit is contained in:
Vanessa Ezekowitz 2013-10-23 21:51:28 -04:00
parent 54a507fad0
commit 6958d538d9
44 changed files with 180 additions and 104 deletions

@ -1,23 +1,15 @@
-- 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',
output = ":bushes:basket_empty",
recipe = {
{ 'default:stick', 'default:stick', 'default:stick' },
{ '', 'default:stick', '' },
{ "default:stick", "default:stick", "default:stick" },
{ "", "default:stick", "" },
},
})
-- Sugar
minetest.register_craftitem(":bushes:sugar", {
description = "Sugar",
inventory_image = "bushes_sugar.png",
@ -25,65 +17,92 @@ minetest.register_craftitem(":bushes:sugar", {
})
minetest.register_craft({
output = 'bushes:sugar 1',
output = "bushes:sugar 1",
recipe = {
{ 'default:papyrus', 'default:papyrus' },
{ "default:papyrus", "default:papyrus" },
},
})
-- Raw pie
minetest.register_craftitem(":bushes:berry_pie_raw", {
description = "Raw berry pie",
inventory_image = "bushes_berry_pie_raw.png",
for i, berry in ipairs(bushes_classic.bushes) do
local desc = bushes_classic.bushes_descriptions[i]
minetest.register_craftitem(":bushes:"..berry.."_pie_raw", {
description = "Raw "..desc.." pie",
inventory_image = "bushes_"..berry.."_pie_raw.png",
on_use = minetest.item_eat(3),
})
})
minetest.register_craft({
output = 'bushes:berry_pie_raw 1',
if berry ~= "mixed_berry" then
minetest.register_craftitem(":bushes:"..berry, {
description = "Raw "..desc.." pie",
inventory_image = "bushes_"..berry..".png",
groups = {berry = 1},
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' },
{ "bushes:sugar", "default:junglegrass", "bushes:sugar" },
{ "bushes:"..berry, "bushes:"..berry, "bushes:"..berry },
},
})
})
end
minetest.register_craft({
output = 'bushes:berry_pie_raw 1',
recipe = {
{ 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' },
{ 'farming_plus:strawberry_item', 'farming_plus:strawberry_item', 'farming_plus:strawberry_item' },
},
})
-- Cooked pie
-- Cooked pie
minetest.register_craftitem(":bushes:berry_pie_cooked", {
description = "Cooked berry pie",
inventory_image = "bushes_berry_pie_cooked.png",
minetest.register_craftitem(":bushes:"..berry.."_pie_cooked", {
description = "Cooked "..desc.." 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',
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"
-- slice of pie
minetest.register_craftitem(":bushes:"..berry.."_pie_slice", {
description = "Slice of "..desc.." pie",
inventory_image = "bushes_"..berry.."_pie_slice.png",
on_use = minetest.item_eat(1),
})
minetest.register_craft({
output = "bushes:"..berry.."_pie_slice 4",
recipe = {
{ "bushes:"..berry.."_pie_cooked" },
},
})
-- Basket with pies
minetest.register_craft({
output = "bushes:basket_"..berry.." 1",
recipe = {
{ "bushes:berry_pie_cooked", "bushes:berry_pie_cooked", "bushes:berry_pie_cooked" },
{ "", "bushes:basket_empty", "" },
},
})
end
minetest.register_craft({
output = "bushes:strawberry_pie_raw 1",
recipe = {
{ "bushes:sugar", "default:junglegrass", "bushes:sugar" },
{ "farming_plus:strawberry_item", "farming_plus:strawberry_item", "farming_plus:strawberry_item" },
},
on_use = minetest.item_eat(15),
groups = { dig_immediate = 3 },
})
minetest.register_craft({
output = 'bushes:basket_pies 1',
output = "bushes:mixed_berry_pie_raw 2",
recipe = {
{ 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked' },
{ '', 'bushes:basket_empty', '' },
{ "bushes:sugar", "default:junglegrass", "bushes:sugar" },
{ "group:berry", "group:berry", "group:berry" },
{ "group:berry", "group:berry", "group:berry" },
},
})

@ -0,0 +1,5 @@
strawberry: http://www.clker.com/clipart-4060.html
blueberry: http://www.clker.com/clipart-cerezafiro12.html
blackberry: http://www.clker.com/clipart-blackberry-2.html
raspberry: http://www.clker.com/clipart-simple-raspberry.html
gooseberry: http://www.clker.com/clipart-26281.html

@ -1,49 +1,36 @@
local BUSHES = {
-- Bushes classic mod originally by unknown
-- now maintained by VanessaE
--
-- License: WTFPL
bushes_classic = {}
bushes_classic.bushes = {
"strawberry",
"blackberry",
"blueberry",
"raspberry",
"gooseberry",
"mixed_berry"
}
local BUSHES_DESCRIPTIONS = {
bushes_classic.bushes_descriptions = {
"Strawberry",
"Blackberry",
"Blueberry",
"Raspberry",
"Gooseberry",
"Mixed Berry"
}
local spawn_list = {}
bushes_classic.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
dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua')
dofile(minetest.get_modpath('bushes_classic') .. '/nodes.lua')
plantslib:spawn_on_surfaces({
spawn_delay = 3600,
spawn_plants = spawn_list,
spawn_plants = bushes_classic.spawn_list,
avoid_radius = 10,
spawn_chance = 100,
spawn_surfaces = {
@ -53,7 +40,7 @@ plantslib:spawn_on_surfaces({
"woodsoils:grass_with_leaves_2"
},
avoid_nodes = {"group:bush"},
seed_diff = 545342534, -- guaranteed to be random :P
seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P
plantlife_limit = -0.1,
light_min = 10,
temp_min = 0.15, -- approx 20C
@ -62,6 +49,6 @@ plantslib:spawn_on_surfaces({
humidity_max = -1, -- 100% RH
})
dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua')
minetest.register_alias("bushes:basket_pies", "bushes:basket_strawberry")
print("[Bushes] Loaded.")

65
bushes_classic/nodes.lua Normal file

@ -0,0 +1,65 @@
for i, bush_name in ipairs(bushes_classic.bushes) do
local desc = bushes_classic.bushes_descriptions[i]
if bush_name ~= "mixed_berry" then
minetest.register_node(":bushes:" .. bush_name .. "_bush", {
description = desc.." 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,
groups = { snappy = 3, bush = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
drop = {
max_items = 2,
items = {
{items = {"bushes:" .. bush_name .. "_bush"}, rarity = 1 }, -- always get at least one on dig
{items = {"bushes:" .. bush_name .. "_bush"}, rarity = 5 }, -- 1/5 chance of getting a second one.
}
},
})
minetest.register_craft({
output = "bushes:"..bush_name.." 4",
recipe = {
{ "bushes:"..bush_name.."_bush", },
}
})
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 },
}
})
end
minetest.register_node(":bushes:basket_"..bush_name, {
description = "Basket with "..desc.." Pies",
tiles = {
"bushes_basket_"..bush_name.."_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
on_use = minetest.item_eat(15),
groups = { dig_immediate = 3 },
})
table.insert(bushes_classic.spawn_list, "bushes:"..bush_name.."_bush")
end
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 },
})

Binary file not shown.

After

(image error) Size: 1.2 KiB

Binary file not shown.

After

(image error) Size: 1.3 KiB

Binary file not shown.

Before

(image error) Size: 283 B

After

(image error) Size: 248 B

Binary file not shown.

Before

(image error) Size: 285 B

After

(image error) Size: 271 B

Binary file not shown.

Before

(image error) Size: 633 B

Binary file not shown.

After

(image error) Size: 1.2 KiB

Binary file not shown.

After

(image error) Size: 1.2 KiB

Binary file not shown.

After

(image error) Size: 1.3 KiB

Binary file not shown.

Before

(image error) Size: 320 B

After

(image error) Size: 341 B

Binary file not shown.

After

(image error) Size: 1.2 KiB

Binary file not shown.

Before

(image error) Size: 918 B

Binary file not shown.

Before

(image error) Size: 918 B

Binary file not shown.

After

(image error) Size: 1.2 KiB

Binary file not shown.

After

(image error) Size: 2.0 KiB

Binary file not shown.

After

(image error) Size: 725 B

Binary file not shown.

After

(image error) Size: 751 B

Binary file not shown.

After

(image error) Size: 391 B

Binary file not shown.

After

(image error) Size: 1.6 KiB

Binary file not shown.

After

(image error) Size: 2.0 KiB

Binary file not shown.

After

(image error) Size: 734 B

Binary file not shown.

After

(image error) Size: 771 B

Binary file not shown.

After

(image error) Size: 409 B

Binary file not shown.

After

(image error) Size: 1.0 KiB

Binary file not shown.

After

(image error) Size: 2.0 KiB

Binary file not shown.

After

(image error) Size: 705 B

Binary file not shown.

After

(image error) Size: 739 B

Binary file not shown.

After

(image error) Size: 426 B

Binary file not shown.

After

(image error) Size: 716 B

Binary file not shown.

After

(image error) Size: 781 B

Binary file not shown.

After

(image error) Size: 421 B

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 2.0 KiB

Binary file not shown.

After

(image error) Size: 708 B

Binary file not shown.

After

(image error) Size: 747 B

Binary file not shown.

After

(image error) Size: 411 B

Binary file not shown.

Before

(image error) Size: 824 B

After

(image error) Size: 1.9 KiB

Binary file not shown.

Before

(image error) Size: 7.1 KiB

After

(image error) Size: 2.0 KiB

Binary file not shown.

After

(image error) Size: 671 B

Binary file not shown.

After

(image error) Size: 747 B

Binary file not shown.

After

(image error) Size: 386 B