Jump to content

[1.7.2] custom item model wont show up in first person.


sigurd4

Recommended Posts

i followed a tutorial by ichun and kept my code mostly like in the tutorial. it worked in the video, but for me the model was only shown in third person, probably because it was slightly outdated and i had to do some things differently. what is it thats causing this? i assume its something that i have to set for my item that wasnt needed before 1.7.2.

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Link to comment
Share on other sites

public class RenderPistolRapture implements IItemRenderer {

private int ammo;
private boolean damageUpgrade;
private boolean clipUpgrade;
protected ModelPistolRapture model;

public RenderPistolRapture()
{
	model = new ModelPistolRapture();
}

@Override
public boolean handleRenderType(ItemStack arg0, ItemRenderType arg1) {
	switch(arg1)
	{
	case EQUIPPED: return true;
	default: return false;
	}
}

@Override
public void renderItem(ItemRenderType arg0, ItemStack itemstack, Object... data) {
	switch(arg0)
	{
	case EQUIPPED:
	{
		damageUpgrade = itemstack.getTagCompound().getBoolean("UpgradeDamage");
		clipUpgrade = itemstack.getTagCompound().getBoolean("UpgradeClip");
		ammo = itemstack.getTagCompound().getInteger("Ammo");

		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("bioshock:textures/entity/weapons/pistol_rapture.png"));

		GL11.glRotatef(190F, 1.0F, 0.0F, 0.0F);
		GL11.glRotatef(-13F, 0.0F, 1.0F, 0.0F);
		GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F);

		@SuppressWarnings("unused")
		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.41F, -0.4F, -0.55F);
			}
			else
			{
				isFirstPerson = true;
				GL11.glTranslatef(0.41F, -0.4F, -0.55F);
			}
		}
		else
		{
			GL11.glTranslatef(0.41F, -0.4F, -0.55F);
		}

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

		model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ammo, damageUpgrade, clipUpgrade);

		GL11.glPopMatrix();
	}
	default: break;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType arg0, ItemStack arg1, ItemRendererHelper arg2) {
	return false;
}

}

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Link to comment
Share on other sites

Topic: [1.7.2] custom item model wont show up in first person.

 

I am pretty sure sigurd4 wants to render a custom model. They need to either handle

EQUIPPED_FIRST_PERSON

or remove the switch statement, lest the custom model will not be rendered.

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.