[Suggestion] Implement an API that allows other mods to open the `DeathLogScreen`
TheCSDev opened this issue ยท 2 comments
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!
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