Skip to content

Conversation

@LeFauxMatt
Copy link
Contributor

This is intended to be a draft of a possible api for CJB Item Spawner. I wanted to submit to facilitate the discussion.
Currently all it does is allow the menu to be launched.

@LeFauxMatt LeFauxMatt changed the title Cjb item spawner api CJB Item Spawner API Dec 18, 2024
@Pathoschild Pathoschild marked this pull request as draft December 19, 2024 01:14
@tlitookilakin
Copy link

tlitookilakin commented Jan 11, 2025

I think it would be useful to be able to register Item providers, but I'm not sure the best way to handle that, since the internals are heavily reliant on SearchableItem.

Maybe SearchableItem could be replaced with regular Items by converting the utility methods it has to extensions and just using GetOne() to produce copies.

@LeFauxMatt
Copy link
Contributor Author

Updated the proposal to add an api method for mods adding custom item repositories for returning additional searchable items.

@LeFauxMatt
Copy link
Contributor Author

Added #236 as an alternative approach

@Pathoschild
Copy link
Collaborator

Hi! ItemRepository is shared across multiple repos (e.g. SMAPI and Lookup Anything have a copy for their own features). The item spawner ideally shouldn't customize its version, since (a) that would make it harder to keep up-to-date with the other repos and (b) the other repos won't benefit from the changes.

It already supports custom item type definitions automatically, so other mods should add custom items that way instead of integrating with mods like CJB Item Spawner one-by-one.

@LeFauxMatt
Copy link
Contributor Author

I think @tlitookilakin had an example of a usecase that this would serve related to Profession Books, but I don't know the specific details so I'll let them explain if it would be needed for that.

@tlitookilakin
Copy link

tlitookilakin commented Jan 15, 2025

Profession Books and Better Beehouses both- the main issue is not an inability to add plain items, but an inability to define a specific range of variants of an item.

Better Beehouses, for example, has options to allow making honey from non-flower produce, and previously had to use harmony hacks to inject the new variants. Currently, it simply does not support Item Spawner or Lookup Anything.

Profession Books again adds specific variants of a single object through item queries.

Another thing worth considering in this general vein, though it does not affect me personally, is that many mods do add custom flavor/preserve items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants