Fix recipe constants being overridden by a blank map. Closes #5380

This commit is contained in:
alexbegt authored and cpw committed 2019-01-20 16:03:09 +00:00
1 parent 60524f0f3e
commit 2bee5f7ac6
1 file changed
+3 -3
@@ -325,12 +325,12 @@ public class CraftingHelper
}
}
if (!items.isEmpty())
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
ret.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
}
else if (json.has("tag"))
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.deserializeItemList(json));
ret.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.deserializeItemList(json));
else if (json.has("item"))
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
ret.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
else
LOGGER.error(CRAFTHELPER, "Couldn't load constant #{} from {} as it's missing `item` or `items` element", x, key);
}