[Suggestion] Add more API Documentation or API Examples
Roadhog360 opened this issue ยท 3 comments
I've been trying to implement this and I can't figure it out. I tried copying the entries for the vanilla shulker boxes into the API. Copying the code for the colors into the API plugin worked with no compile errors after I added my own blockName function. But trying to copy the code for your Shulker box registry into registerProviders
completely broke down.
There is no constructors for"ShulkerBoxBlockEntity()" (they all only have args so what you typed doesn't work) and ShulkerBoxPreviewProvider
isn't a class that's available through the common API. So I tried copying in the ShulkerBoxPreviewProvider class into my own code, but then it couldn't extend InventoryAwarePreviewProvider
because it also doesn't exist in the API! So... how am I supposed to use the API? There's no examples of direct API usage, so I'm completely stuck. Additionally, it's nearly impossible to tell what each registry passed into the interface's functions even does because they're all unstable, half of the args for them have obfuscated names like class_2960
Please document what people are supposed to do with the API to add their custom Shulker boxes to it, because I can't find any way to do this.
I'm modifying Netherite Plus, and using the common API, since I want connector mods to also work with it, so the Forge version of ShulkerBoxTooltip remains compatible. I'm using 4.0.4+1.20.1
EDIT: It turns out the obfuscated names are a problem with the common library. Trying to use the fabric one works, but I want the common one.
Hi,
The public API is located in the packages com.misterpemodder.shulkerboxtooltip.api.*
. Any other package is part of the implementation and is prone to breaking without warning.
It looks Netherite Plus is a Fabric / Quilt mod, so you should be using the fabric JAR only. The common one is meant to be used with Architectury.
As for the documentation, I agree the Javadoc is on the lighter side, but perhaps you could look into how other mods does integration with ShulkerBoxTooltip, such as ChestTracker, Enderite, or Reinforced Shulker Boxes.
In any case, If you have any other questions feel free to ask them!
Although it is a Fabric mod as explained in the post I want to ensure Sinytra connector compatibility with my Fabric port of it, which is why I chose the common jar.
I was going to use reflection to access the forge versions of the functions I need to register my API hook, if it was present in the classpath. Even if it is a fabric mod I want to ensure that it works on both platforms, and have been testing Sinytra connector to be sure of this