Posted September 17, 201213 yr I have several items i use to spawn blocks with custom renders. What i want to do is get the item to render like the block. similar to how the chest will render in the players hand. How would i go about doing this, and yes i have actual dug threw MC's src looking for how. What i found was that the chest uses render type 22 to render itself and has a class to help render in hand. What i can't find is how to do this with my block or item. http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
September 17, 201213 yr You need to add a new Block renderer. Like this, for instance: public class RendererCircle implements ISimpleBlockRenderingHandler { public static final int blockRenderId = RenderingRegistry.getNextAvailableRenderId(); public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { } public boolean shouldRender3DInInventory() { return false; } public int getRenderId() { return blockRenderId; } And in your block, make the render type equal to the blockRenderId variable. I'm not sure what you need to add, because you want to render it in a different way than I do (I have a 2D-ish block) so you'd have to figure it out yourself. (HINT: use the Tesselator.instance !)
September 17, 201213 yr Author That might actual work i'll give it a try with what i found with the how the chest renders. Maybe i can get it to work, i'll re edit this post when i have something tested. While i'm at it though think you can link the code you use might help me a bit even if its simi 2D. Also i have no clue what a Tesselator is. If your willing can you elaborate on the subject a bit. Edit: Got it working with a bit of screwing around. What i ended up doing was creating a new render inside the my renderHelper class. The challenging part of that was getting the texture to bind to the model. Which i thank cpw's ironChest src for helping me solve that issue. Only thing to figure out now is how to get it to render different in the player's hand and inv. Right now in the inv it render backwards and off lined. Also when i change the render angle to -45 degrees it kills the inv render. any ideas how to fix those issues? http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
September 25, 201213 yr That might actual work i'll give it a try with what i found with the how the chest renders. Maybe i can get it to work, i'll re edit this post when i have something tested. While i'm at it though think you can link the code you use might help me a bit even if its simi 2D. Also i have no clue what a Tesselator is. If your willing can you elaborate on the subject a bit. Edit: Got it working with a bit of screwing around. What i ended up doing was creating a new render inside the my renderHelper class. The challenging part of that was getting the texture to bind to the model. Which i thank cpw's ironChest src for helping me solve that issue. Only thing to figure out now is how to get it to render different in the player's hand and inv. Right now in the inv it render backwards and off lined. Also when i change the render angle to -45 degrees it kills the inv render. any ideas how to fix those issues? Please can you post how you fix it?
September 26, 201213 yr Author here try this but it still need worked on since there is a minor issue with the render size. I think there might be another way for just item since i actual ended up using this for BlockItems. http://calclavia.com/forum/index.php/topic,55.0.html http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
September 26, 201213 yr here try this but it still need worked on since there is a minor issue with the render size. I think there might be another way for just item since i actual ended up using this for BlockItems. http://calclavia.com/forum/index.php/topic,55.0.html Thanks will look in it. It´s my problem, too the BlockItems
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.