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

Make ModConfig.getFullPath nullable #236

Open
SquidDev opened this issue Jan 17, 2025 · 0 comments
Open

Make ModConfig.getFullPath nullable #236

SquidDev opened this issue Jan 17, 2025 · 0 comments

Comments

@SquidDev
Copy link

ModConfig.getFullPath currently has a comment on it wondering whether it's worth removing.

// TODO: remove from public API?
public Path getFullPath() {

I personally use it to read another file, adjacent to the main config file, that contains secrets. One doesn't want to put secrets in the main config, as they are synced to the client!

However, there currently isn't a way (AFAIK) to determine whether the config file is being synced from disk over the network. As a result, there's no way to tell if getFullPath will throw. On 1.20.1, one could poke the config file directly, but as of #178 that's no longer possible, and you have to try/catch the error instead. Ugly!

It would be nice if we just changed getFullPath to be nullable, rather than throwing an exception.

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

No branches or pull requests

1 participant