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

#1 If you can get the player skin as a TextureAtlasSprite, then you can add it using TGG's createBakedQuadForFace method from the chess board tutorial.

 

#2 That's the entire point of IPerspectiveAwareModel. Look at the examples in the two posts I mentioned earlier - they both return different models based on perspective.

  • Author

How do I return an IPerspectiveAwareModel for my item? Do I do this in getModel? If so, how do I cast it to a ModelResourceLocation? Thanks again.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

  • Author

I have most of it done. I appreciate your help @coolAlias. I have a class implementing IPerspectiveAwareModel and have registered it on the ModelBakeEvent. I'm pretty sure I still have to register the render for the item anyway? The tricky part for my item is that I want to de-render cuboids based on first person / third person etc. If you could just help me out on the the handlePerspective() method I think we can conclude this topic! By the way, why is almost everything deprecated?

public class ModelItem implements IPerspectiveAwareModel
{

private IBakedModel modelItem;

@Override
public List getFaceQuads(EnumFacing par1EnumFacing) 
{
	return this.modelItem.getFaceQuads(par1EnumFacing);
}

@Override
public List getGeneralQuads() 
{
	return this.modelItem.getGeneralQuads();
}

@Override
public boolean isAmbientOcclusion() 
{
	return this.modelItem.isAmbientOcclusion();
}

@Override
public boolean isGui3d() 
{
	return this.modelItem.isGui3d();
}

@Override
public boolean isBuiltInRenderer() 
{
	return this.modelItem.isBuiltInRenderer();
}

@Override
public TextureAtlasSprite getTexture() 
{
	return this.modelItem.getTexture();
}

@Override
public ItemCameraTransforms getItemCameraTransforms() 
{
	return this.modelItem.getItemCameraTransforms();
}

@Override
public Pair<IBakedModel, Matrix4f> handlePerspective(TransformType par1TransformType) 
{
	switch(par1TransformType)
	{
	case FIRST_PERSON: //What should I do here
		break;
	case THIRD_PERSON: //What should I do here
		break;
	case GUI: //What should I do here
		break;
	default:
		break;
	}
	return null; //What should I return here
}

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

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.