Fabric API

Fabric API

108M Downloads

Misleading api in BlockRenderLayerMap

SHsuperCM opened this issue ยท 1 comments

commented

Although it is very clear that BlockRenderLayerMap only handles the render layers of blocks, it contains both api and javadocs that imply that the same map could handle items extending the general Item class.

/**
* Map (or re-map) an item with a render layer. Re-mapping is not recommended but if done, last one in wins.
* Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.
*
* @param item Identifies item to be mapped.
* @param renderLayer Render layer. Should be one of the layers used for entity rendering.
*/
void putItem(Item item, RenderLayer renderLayer);
/**
* Map (or re-map) multiple items with a render layer. Re-mapping is not recommended but if done, last one in wins.
* Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.
*
* @param renderLayer Render layer. Should be one of the layers used for entity rendering.
* @param items Identifies items to be mapped.
*/
void putItems(RenderLayer renderLayer, Item... items);

It would be much clearer if the arguments for these methods took BlockItems instead and their javadocs should clearly state that this affects only items extending BlockItem.

commented

Thank you for the issue! I think deprecating the methods entirely is the best course of action. See #2930.