mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 20:43:42 +01:00
Refine drops
This commit is contained in:
parent
fc1141c624
commit
5ef410730a
15
init.lua
15
init.lua
@ -633,12 +633,21 @@ local function drop_table(name, drop)
|
|||||||
if not dstack:is_empty() and (dname ~= name or
|
if not dstack:is_empty() and (dname ~= name or
|
||||||
(dname == name and dcount > 1)) then
|
(dname == name and dcount > 1)) then
|
||||||
if #di.items == 1 and (not di.rarity or di.rarity <= 1) then
|
if #di.items == 1 and (not di.rarity or di.rarity <= 1) then
|
||||||
|
if drop_sure[dname] then
|
||||||
|
if dcount > drop_sure[dname].output then
|
||||||
|
dcount = dcount + drop_sure[dname].output
|
||||||
|
else
|
||||||
|
dcount = drop_sure[dname].output
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
drop_sure[dname] = {
|
drop_sure[dname] = {
|
||||||
output = dcount,
|
output = dcount,
|
||||||
tools = di.tools,
|
tools = di.tools,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
drop_maybe[dname] = {
|
drop_maybe[#drop_maybe + 1] = {
|
||||||
|
item = dname,
|
||||||
output = dcount,
|
output = dcount,
|
||||||
rarity = di.rarity,
|
rarity = di.rarity,
|
||||||
tools = di.tools,
|
tools = di.tools,
|
||||||
@ -657,11 +666,11 @@ local function drop_table(name, drop)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
for item, data in pairs(drop_maybe) do
|
for _, data in ipairs(drop_maybe) do
|
||||||
craftguide.register_craft{
|
craftguide.register_craft{
|
||||||
type = "digging_chance",
|
type = "digging_chance",
|
||||||
items = {name},
|
items = {name},
|
||||||
output = fmt("%s %u", item, data.output),
|
output = fmt("%s %u", data.item, data.output),
|
||||||
rarity = data.rarity,
|
rarity = data.rarity,
|
||||||
tools = data.tools,
|
tools = data.tools,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user