Fix item deletion on crafting storage boxes
Since items inside box would be deleted, just don't allow crafting of storeboxes/totes if there's already an item trapped in the form.
This commit is contained in:
parent
d72d7fc692
commit
741955e097
@ -13,7 +13,8 @@ local match_skip = {
|
||||
excess = true,
|
||||
wear = true,
|
||||
stacked = true,
|
||||
any = true
|
||||
any = true,
|
||||
empty = true
|
||||
}
|
||||
|
||||
function nodecore.match(thing, crit)
|
||||
@ -84,5 +85,10 @@ function nodecore.match(thing, crit)
|
||||
end
|
||||
end
|
||||
|
||||
-- Never match on a thing that also has a stack inside it, e.g. crafts on
|
||||
-- shelfs/forms that are full.
|
||||
if crit.empty and not (thing.stacked or nodecore.stack_get(thing)
|
||||
:is_empty()) then return end
|
||||
|
||||
return thing
|
||||
end
|
||||
|
@ -79,7 +79,10 @@ nodecore.register_craft({
|
||||
wield = {name = modname .. ":bar_annealed"},
|
||||
consumewield = 1,
|
||||
nodes = {
|
||||
{match = modname .. ":form", replace = modname .. ":shelf"},
|
||||
{
|
||||
match = {name = modname .. ":form", empty = true},
|
||||
replace = modname .. ":shelf"
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
@ -91,7 +94,10 @@ nodecore.register_craft({
|
||||
check = function(pos) return nodecore.stack_get(pos):is_empty() end,
|
||||
indexkeys = {modname .. ":shelf"},
|
||||
nodes = {
|
||||
{match = modname .. ":shelf", replace = "air"},
|
||||
{
|
||||
match = {name = modname .. ":shelf", empty = true},
|
||||
replace = "air"
|
||||
},
|
||||
},
|
||||
items = {
|
||||
{name = modname .. ":frame_annealed", scatter = 0.001},
|
||||
|
@ -52,7 +52,10 @@ local function register_tank(subname, desc, pane, recipeitem)
|
||||
wield = {name = recipeitem},
|
||||
consumewield = 1,
|
||||
nodes = {
|
||||
{match = "nc_woodwork:form", replace = tankname},
|
||||
{
|
||||
match = {name = "nc_woodwork:form", empty = true},
|
||||
replace = tankname
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
@ -12,7 +12,10 @@ nodecore.register_craft({
|
||||
wield = {name = "nc_lode:frame_annealed"},
|
||||
consumewield = 1,
|
||||
nodes = {
|
||||
{match = "nc_lode:form", replace = modname .. ":handle"},
|
||||
{
|
||||
match = {name = "nc_lode:form", empty = true},
|
||||
replace = modname .. ":handle"
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -81,6 +81,9 @@ nodecore.register_craft({
|
||||
wield = {name = modname .. ":plank"},
|
||||
consumewield = 1,
|
||||
nodes = {
|
||||
{match = modname .. ":form", replace = modname .. ":shelf"},
|
||||
{
|
||||
match = {name = modname .. ":form", empty = true},
|
||||
replace = modname .. ":shelf"
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user