Hello fellow minecraft modding enthusiasts,
i'm trying to make a custom map item, similar to the existing one in vanilla minecraft. This custom map item should use different colors for the grass block for each biome.
Where I stay so far:
In my first step i tried to play around with the colorValue of MaterialColors in making my own CustomMaterialColors. After that, I created a CustomFilledMapItem extending FilledMapItem and overwrote the method updateMapData(...) (just letting minecraft pick the index of the color out of CustomMaterialColors instead of MaterialColors). This logically didn't work, because when the CustomFilledMapItem is rendered in MapItemRenderer, the public method updateMapTexture(MapData mapdataIn) is called which leads to the private method updateMapTexture(). In this method the colorValue is get from MaterialColors. So i think that i have to implement my own custom version of MapItemRender but i don't how to register a custom renderer and link it to my new items in minecraft forge.
My Questions are:
How can i say to minecraft: "If the player helds an instance of my custom made item in his main hand, render it by my custom made renderer instead of the allready implemented ones."
Do i have to use the ItemStackTileEntityRenderer in that case? If yes, how exactly do i use it and do you have an example where i can look at? My approach would be something like:
CustomFilledMapItem would not extending FilledMapItem anymore.
CustomFilledMapItem extends now AbstractMapItem (Maybe not so good idea -> Mc using its own MapItemRenderer again). Maybe implementing the Interface IBakedModel as written in the documentation?
The constructor of CustomFilledMapItem would call super(new Item.Properties().setISTER(...)). But what is the argument needed for #setISTER(...)?
I would create a CustomMapItemRenderer class extending ItemStackTileEntityRenderer and implement the #render(...) method.
In addition to step four i would copy paste the needed and adjusted behavior of MapItemRenderer.
If no, do i have to handle the rendering within events? Let's say each game tick it checks if the item held is instance of CustomFilledMap -> render it with custom Renderer (Possible IllegalStateException - Not right thread to render?).
I am new to minecraft modding and i know it's more complex then adding a simple item. Therefore i don't now the hole scope of this "little one new added item project". In the first step it should only be rendered correctly if the player selected the item in the menu bar and if he's in first person mode. Thanks in advance!