Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow printed data component to part of API module #2099

Closed
cassiancc opened this issue Feb 13, 2025 · 2 comments
Closed

Allow printed data component to part of API module #2099

cassiancc opened this issue Feb 13, 2025 · 2 comments
Labels
area-Minecraft This affects CC's Minecraft-specific content. enhancement An extension of a feature or a new feature.

Comments

@cassiancc
Copy link

Hello! I work on the Infinite Dimensions mod, which allows for ComputerCraft's printed pages to be used to create Infinity Portals by using the text of the paper as a seed for a randomly generated dimension. For this functionality to work, we rely on ComputerCraft's ModRegistry class for access to ModRegistry.DataComponents.PRINTOUT.

We're happy to maintain this if issues do arise from relying on the registry class like this, but as you recommended raising an issue here when relying on classes outside of the API, I thought I'd bring it to your attention that this class might have some utility outside of the mod itself, perhaps for other tech mods wanting to read user data from a printed page.

@cassiancc cassiancc added the enhancement An extension of a feature or a new feature. label Feb 13, 2025
@SquidDev SquidDev added the area-Minecraft This affects CC's Minecraft-specific content. label Feb 13, 2025
@SquidDev
Copy link
Member

Thanks for reaching out! I probably don't want to move the whole component to the API — there's some odd implementation choices there that I probably don't want to expose to the public API. Definitely happy to expose an interface + getter for this though.

Would something like this work for what you need?:

interface PrintoutContents {
  @Nullable String getTitle();
  Stream<String> getLines();

  static @Nullable PrintoutContents get(ItemStack stack);
}

@cassiancc
Copy link
Author

That should work nicely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Minecraft This affects CC's Minecraft-specific content. enhancement An extension of a feature or a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants