Ghaz-ranka Posted July 26, 2014 Share Posted July 26, 2014 I have followed a couple tutorials and managed to get a 3D item to render in game but the issue I am having is that it has no icon and I am having trouble figuring out exactly how to fix this. Below is my source code: https://github.com/G1R-Productions/g1rwarcraft If anyone could help with this issue it would be most appreciated. Quote Link to comment Share on other sites More sharing options...
TheGreyGhost Posted July 26, 2014 Share Posted July 26, 2014 Hi There is no icon in inventory because you need to either give your Item an icon using .setTextureName() or you need to implement the INVENTORY render type in your IItemRenderer. See the Item Rendering sections on this page, and especially the IItemRenderer topic. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG Quote Link to comment Share on other sites More sharing options...
Ghaz-ranka Posted July 26, 2014 Author Share Posted July 26, 2014 Could you possibly give an example? I have tried both and the texture is an invisible texture in the inventory. (I am rather new to modding I have only being modding for about 2.5 weeks.) Quote Link to comment Share on other sites More sharing options...
TheGreyGhost Posted July 26, 2014 Share Posted July 26, 2014 Hi To just use the 2D inventory icon for the sword, change your ItemRender3Dtool to have @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return (type == ENTITY || type == EQUIPPED || type == EQUIPPED_FIRST_PERSON); } And make sure you have included the image you register in registerIcons. public class testSword extends ItemSword { public testSword(ToolMaterial arg0) { super(arg0); this.setCreativeTab(grwarcraft.g1rwarcraft); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(grwarcraft.modid + ":" + this.getUnlocalizedName().substring(5)); } } -TGG Quote Link to comment Share on other sites More sharing options...
Ghaz-ranka Posted July 26, 2014 Author Share Posted July 26, 2014 Using this code for rendering them item in 3d in the inventory the icon is blank. case INVENTORY: GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation( "grwarcraft:/sword1.png")); GL11.glRotatef(0.0F, 0.0f, 0.0f, 0.0f); GL11.glRotatef(0.0F, 0.0f, 0.0f, 0.0f); GL11.glTranslatef(0.0F, 0.0F, 0.0F); GL11.glPopMatrix(); break; Using this code it says it cannot be resolved to a variable. @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return (type == ENTITY || type == EQUIPPED || type == EQUIPPED_FIRST_PERSON); } I also have an icon registered with the item: item3dtool = new GRItems().setTextureName("grwarcraft:/sword1").setUnlocalizedName("3dtool"); GameRegistry.registerItem(item3dtool, "3dtool"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.