Jump to content

ItemRenderer Issues - 1.5


LederhosenSheep

Recommended Posts

I started my mod in 1.4.7 and it was working okay until this new 1.5 crazy texture change and now my ItemRenderer class is acting up in relation to the binding and unbinding of a texture. If anyone knows how to fix this for the newer update, I'd appreciate it :D

 

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	switch (type) {
	case EQUIPPED: {
		GL11.glPushMatrix();

		//ForgeHooksClient.bindTexture("/lederhosensheep/stevechem/egun.png", 0);

		GL11.glRotatef(190F, 1.0F, 0.0F, 0.0F);
		GL11.glRotatef(15F, 0.0F, 1.0F, 0.0F);
		GL11.glRotatef(250F, 0.0F, 0.0F, 1.0F);

		boolean isFirstPerson = false;

		if (data[1] != null && data[1] instanceof EntityPlayer) {
			if (!((EntityPlayer) data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) {
				GL11.glTranslatef(0.2F, -0.5F, 0.2F);
			} else {
				isFirstPerson = true;
			}

		} else {
			GL11.glTranslatef(0.2F, -0.5F, 0.2F);
		}

		float scale = 1.2F;
		GL11.glScalef(scale, scale, scale);

		egunModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F,
				0.0625F);

		//ForgeHooksClient.unbindTexture();

		GL11.glPopMatrix();

	}
	default:
		break;
	}
}

 

Thanks in advance! - Leder

Link to comment
Share on other sites

You should use the method Minecraft.getMinecraft().renderEngine.func_98187_b(texture) instead of ForgeHooksClient.bindTexture(texture)

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.