Jump to content

[1.7.2] 3D Item Icon


Ghaz-ranka

Recommended Posts

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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");

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.