1
0
鏡像自 https://github.com/mt-mods/plantlife_modpack.git 已同步 2025-09-15 19:35:21 +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.
此提交包含在:
Vanessa Ezekowitz
2013-10-23 21:51:28 -04:00
父節點 54a507fad0
當前提交 6958d538d9
共有 44 個檔案被更改,包括 180 行新增104 行删除

查看文件

@@ -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",
on_use = minetest.item_eat(3),
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),
})
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:"..berry, "bushes:"..berry, "bushes:"..berry },
},
})
end
-- Cooked pie
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",
cooktime = 30,
})
-- 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" },
},
})
minetest.register_craft({
output = 'bushes:berry_pie_raw 1',
recipe = {
{ 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' },
{ 'bushes:strawberry', 'bushes:strawberry', 'bushes:strawberry' },
},
})
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
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', '' },
},
output = "bushes:mixed_berry_pie_raw 2",
recipe = {
{ "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 一般檔案
查看文件

@@ -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 },
})

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.2 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.3 KiB

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 283 B

之後

寬度:  |  高度:  |  大小: 248 B

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 285 B

之後

寬度:  |  高度:  |  大小: 271 B

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 633 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.2 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.2 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.3 KiB

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 320 B

之後

寬度:  |  高度:  |  大小: 341 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.2 KiB

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 918 B

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 918 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.2 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 2.0 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 725 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 751 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 391 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.6 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 2.0 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 734 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 771 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 409 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.0 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 2.0 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 705 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 739 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 426 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 716 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 781 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 421 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 1.4 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 2.0 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 708 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 747 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 411 B

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 824 B

之後

寬度:  |  高度:  |  大小: 1.9 KiB

未顯示二進位檔案。

之前

寬度:  |  高度:  |  大小: 7.1 KiB

之後

寬度:  |  高度:  |  大小: 2.0 KiB

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 671 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 747 B

未顯示二進位檔案。

之後

寬度:  |  高度:  |  大小: 386 B