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

[Suggestion] Implement an API that allows other mods to open the DeathLogScreen #38

Open
TheCSDev opened this issue Feb 25, 2024 · 2 comments

Comments

@TheCSDev
Copy link

Hello!
Developer of Better Statistics Screen here.

Recently, there's been interest in integrating my mod with DeathLog (Examples include: Issue 13, and recently Issue 108). While I'm eager to make this happen, the current lack of an API presents a challenge.

As such, I would like to suggest for this mod to implement some sort of reliable way for other mods to integrate this mod, such as a simple API. Here is an example of how ModMenu implements their API.

Here is an example of what you could do:

package com.glisco.deathlog.api.client;

import net.minecraft.text.Text;
import net.minecraft.client.gui.screen.Screen;

public interface DeathLogClientApi
{
    static Screen createDeathLogScreen(@Nullable Screen parent) {...}
    static Text createDeathLogButtonText() {...}
}

...kind of like how ModMenu does it for their mod. Other mod developers such as myself, could then implement support for your mod through CurseMaven and your API.

If implementing your own API isn't feasible, I'd like to present an alternative. My mod, Better Statistics Screen, features an API that allows other mods to integrate custom elements. While this would necessitate a dependency, it's a potential workaround. Although, you would have to add betterstats and tcdcommons to the Gradle proejct, and based on the issue #30, I am assuming you implementing support is likely not what you'd want.

Thank you for your time, as that's all I wanted to suggest, and have a great day!

@gliscowo
Copy link
Owner

Alright, well, personally I do not see any necessity for a dedicated API class or interface. What can I offer you instead is to treat DeathLogClient.openScreen(DirectDeathLogStorage, boolean) and DeathLogClient.getClientStorage() like API functions (read, I will make an effort to keep them stable and backwards-compatible).

Would that work for you?
Cheers

@TheCSDev
Copy link
Author

Hello, and thanks for the reply.
Sure, that can work as well. Will use that to implement support for the mod in the future then.
Thanks again, and have a great day (or night)!

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

2 participants