Posted October 6, 201410 yr I've been fideling around with one of my block textures (Heres the code for that:) public IIcon getIcon(int side, int meta) { if (side == 1) { return this.iconTop; } else if (side == 0) { return this.iconTop; } else if (side != meta) { return this.blockIcon; } return this.iconFace; } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister IconRegistry) { this.blockIcon = IconRegistry.registerIcon(Constants.MODID + ":" + "chassisBlock"); this.iconFace = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_face"); this.iconTop = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_top"); } It looks fine when placed in the world but looks different while in my inventory. I kind of understand why it looks this way but I can't figure out how to fix it, and make it look like it does when placed. I'm not trying to be rude it just comes out that way sometimes. I'm here to try and learn as much as I can, won't you join me?
October 6, 201410 yr I think the best way to solve that is to have a default texture, so when meta==0 you return the correct texture in your inventory. The proud(ish) developer of Ancients
October 6, 201410 yr Author I changed it to this: public IIcon getIcon(int side, int meta) { if (side == 1) { return this.iconTop; } else if (side == 0) { return this.iconTop; } else if (meta == 0) { return this.iconFace; } else if (side != meta) { return this.blockIcon; } return this.iconFace; } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister IconRegistry) { this.blockIcon = IconRegistry.registerIcon(Constants.MODID + ":" + "chassisBlock"); this.iconFace = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_face"); this.iconTop = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_top"); } And got this as a result: Fiddling around with it more couldn't produce anything better. I'm not trying to be rude it just comes out that way sometimes. I'm here to try and learn as much as I can, won't you join me?
October 6, 201410 yr Hi You might find the topics under "Item Rendering" useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html You could use an IItemRenderer, or alternatively an ISimpleBlockRenderingHandler (which might be easier). These will let you rotate the block to face any way you choose A quick google should shown you some tutorials -TGG
October 6, 201410 yr Try this: https://bitbucket.org/Dragonisser/cobaltmod/src/283795b0c366596dc22362f56cb558f9d8ff04ab/cobaltmod/blocks/BlockCobaltFurnace.java?at=master#cl-90 Its for my custom furnace and i had the same problem ^^
October 6, 201410 yr Author Try this: https://bitbucket.org/Dragonisser/cobaltmod/src/283795b0c366596dc22362f56cb558f9d8ff04ab/cobaltmod/blocks/BlockCobaltFurnace.java?at=master#cl-90 Its for my custom furnace and i had the same problem ^^ That worked great thank you. Hi You might find the topics under "Item Rendering" useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html You could use an IItemRenderer, or alternatively an ISimpleBlockRenderingHandler (which might be easier). These will let you rotate the block to face any way you choose A quick google should shown you some tutorials -TGG That whole page looks like its going to be very helpful, thank you. I'm not trying to be rude it just comes out that way sometimes. I'm here to try and learn as much as I can, won't you join me?
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.