mirror of
https://notabug.org/TenPlus1/lucky_block.git
synced 2024-12-05 03:23:46 +01:00
centre apple tree lucky block, check item exists before inserting into chest
This commit is contained in:
parent
5601eb1772
commit
b8a76a23b7
@ -8,7 +8,7 @@ local S, NS = dofile(MP .. "/intllib.lua")
|
||||
local dpath = minetest.get_modpath("default") .. "/schematics/"
|
||||
|
||||
lucky_block:add_schematics({
|
||||
{"appletree", dpath .. "apple_tree_from_sapling.mts", {x = 2, y = 1, z = 2}},
|
||||
{"appletree", dpath .. "apple_tree_from_sapling.mts", {x = 3, y = 1, z = 3}},
|
||||
{"jungletree", dpath .. "jungle_tree_from_sapling.mts", {x = 2, y = 1, z = 2}},
|
||||
{"defpinetree", dpath .. "pine_tree_from_sapling.mts", {x = 2, y = 1, z = 2}},
|
||||
{"acaciatree", dpath .. "acacia_tree_from_sapling.mts", {x = 4, y = 1, z = 4}},
|
||||
|
3
init.lua
3
init.lua
@ -180,11 +180,12 @@ local function fill_chest(pos, items)
|
||||
|
||||
if not stacks[s].chance
|
||||
or math.random(1, stacks[s].chance) == 1 then
|
||||
|
||||
if minetest.registered_items[stacks[s].name] then
|
||||
inv:set_stack("main", math.random(32), {
|
||||
name = stacks[s].name,
|
||||
count = math.random(stacks[s].max)
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user