Jump to content

Recommended Posts

Posted

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.)

Posted

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

Posted

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

 

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.