Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

  • Author
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!

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.