handle legacy drop definitions correctly

This commit is contained in:
flux
2022-08-08 13:26:53 -07:00
parent f7f6c79f74
commit 2c7977f101
2 changed files with 30 additions and 5 deletions

View File

@ -149,7 +149,15 @@ function api.register_single(node, shape, overrides, meta)
end
-- if there's a drop defined, and we can drop a shaped version, do so
if node_def.drop and type(node_def.drop) == "string" then
if meta.legacy_drop then
if type(meta.legacy_drop) == "string" then
local item = api.get_schema_recipe_item(meta.legacy_drop, shape)
if item then
def.drop = item
end
end
elseif node_def.drop and type(node_def.drop) == "string" then
local item = api.get_schema_recipe_item(node_def.drop, shape)
if item then
def.drop = item