Jump to content

Recommended Posts

Posted

So as in my previous post, I needed to rotate the model, which I have done successfully.There are a few things that need fixing though.

 

1. How do I make the hitbox rotate with the model? and

2. How do I make my model render as the model in my inventory?

 

Hitbox stuff:

this.setBlockBounds(0F, 0F, 0F, 1F, 0.125F, 1F);

 

ClientProxy:

public void registerRenderThing() {

	//Campfire
	TileEntitySpecialRenderer renderCampfire = new RenderCampfire();
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCampFire.class, renderCampfire);
	MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(PropsGeneral.campfire), new ItemRendererCampfire(renderCampfire, new TileEntityCampFire()));
}

 

ItemRenderer:

public class ItemRendererCampfire implements IItemRenderer {

TileEntitySpecialRenderer render;
private TileEntity entity;


public ItemRendererCampfire(TileEntitySpecialRenderer render, TileEntity entity) {
	this.entity = entity;
	this.render = render;
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {

	return true;
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {

	return true;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	if (type == IItemRenderer.ItemRenderType.ENTITY)
		GL11.glTranslatef(-0.5F, -0.0F, -0.5F);
	this.render.renderTileEntityAt(this.entity, 0.0D, 0.0D, 0.0D, 0.0F);

}

}

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.