Posted March 6, 20187 yr Good evening everyone, I am working on a custom map item (original MC is ItemEmptyMap and ItemMap which inherit from ItemMapBase), the purpose is to act the same way as the original one except that I would like some information rendered on it. Also, I would like it to be an item apart but I basically make my item inherit from ItemMap. The part I am struggling with is rendering the map in player's hand and in an item frame. From what I observe in the code, the concerned renderer is the ItemRenderer which renders instances of ItemMap and also MapItemRenderer which renders icons and decorations. Is there any way to affect a specific ItemRenderer for my custom map or an event that could catch the rendering and to play with ? Regards. Squirrel ! Squirrel ! Squirrel !
March 7, 20187 yr Author [UPDATE] I found out that there is the Forge event RenderSpecificHandEvent which is called for each hand (MAIN_HAND and OFF_HAND). I ended up subscribing to it and making my own rendering functions, based on the ItemRenderer class. Functions that I simply copy-pasted are renderItemInFirstPerson and renderMapFirstPerson. I find it a bit "dirty" that there is a conditional branching only to render an ItemMap inside the rendering pass of Minecraft. Also, certain rendering functions such as renderArms are private and thus could not be overriden or properly called : I have to copy-paste those functions to simulate the same behavior. Do you think it would be possible create a specific event for the map rendering, considering its unique condition in the code ? What do you think ? Squirrel ! Squirrel ! Squirrel !
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.