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

In third person view, my custom bow is rendered as an item as opposed to how the vanilla bow is rendered, I have tried using bFull3d however the bow still does not render as the vanilla bow does, I have tried searching for similar topics but they are outdated, any help with getting this to work in 1.6.2?

ย 

Ethyl

it hasnt really changed, you need a IItemRenderer

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

I have created an IItemRenderer Class using some older topics, however I'm stuck with the following section:

ย 

ย 

private void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) {
	Icon icon = par1EntityLiving.getItemIcon(par2ItemStack, par3);

ย  ย  ย  ย  if (icon == null)
ย  ย  ย  ย  {
ย  ย  ย  ย  ย  ย  return;
ย  ย  ย  ย  }

ย  ย  ย  ย  if (par2ItemStack.getItemSpriteNumber() == 0)
ย  ย  ย  ย  {
ย  ย  ย  ย  ย  ย  this.mc.renderEngine.bindTexture("/terrain.png");
ย  ย  ย  ย  }
ย  ย  ย  ย  else
ย  ย  ย  ย  {
ย  ย  ย  ย  ย  ย  this.mc.renderEngine.bindTexture("/gui/items.png");
ย  ย  ย  ย  }

ย  ย  ย  ย  Tessellator tessellator = Tessellator.instance;
ย  ย  ย  ย  float f = icon.getMinU();
ย  ย  ย  ย  float f1 = icon.getMaxU();
ย  ย  ย  ย  float f2 = icon.getMinV();
ย  ย  ย  ย  float f3 = icon.getMaxV();
ย  ย  ย  ย  float f4 = 0.0F;
ย  ย  ย  ย  float f5 = 0.3F;
ย  ย  ย  ย  GL11.glEnable(GL12.GL_RESCALE_NORMAL);
ย  ย  ย  ย  GL11.glTranslatef(-f4, -f5, 0.0F);
ย  ย  ย  ย  float f6 = 1.5F;
ย  ย  ย  ย  GL11.glScalef(f6, f6, f6);
ย  ย  ย  ย  GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
ย  ย  ย  ย  GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
ย  ย  ย  ย  GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
ย  ย  ย  ย  ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getSheetWidth(), icon.getSheetHeight(), 0.0625F);

ย  ย  ย  ย  if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0)
ย  ย  ย  ย  {
ย  ย  ย  ย  ย  ย  GL11.glDepthFunc(GL11.GL_EQUAL);
ย  ย  ย  ย  ย  ย  GL11.glDisable(GL11.GL_LIGHTING);
ย  ย  ย  ย  ย  ย  this.mc.renderEngine.bindTexture("%blur%/misc/glint.png");
ย  ย  ย  ย  ย  ย  GL11.glEnable(GL11.GL_BLEND);
ย  ย  ย  ย  ย  ย  GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
ย  ย  ย  ย  ย  ย  float f7 = 0.76F;
ย  ย  ย  ย  ย  ย  GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
ย  ย  ย  ย  ย  ย  GL11.glMatrixMode(GL11.GL_TEXTURE);
ย  ย  ย  ย  ย  ย  GL11.glPushMatrix();
ย  ย  ย  ย  ย  ย  float f8 = 0.125F;
ย  ย  ย  ย  ย  ย  GL11.glScalef(f8, f8, f8);
ย  ย  ย  ย  ย  ย  float f9 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
ย  ย  ย  ย  ย  ย  GL11.glTranslatef(f9, 0.0F, 0.0F);
ย  ย  ย  ย  ย  ย  GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
ย  ย  ย  ย  ย  ย  ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
ย  ย  ย  ย  ย  ย  GL11.glPopMatrix();
ย  ย  ย  ย  ย  ย  GL11.glPushMatrix();
ย  ย  ย  ย  ย  ย  GL11.glScalef(f8, f8, f8);
ย  ย  ย  ย  ย  ย  f9 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
ย  ย  ย  ย  ย  ย  GL11.glTranslatef(-f9, 0.0F, 0.0F);
ย  ย  ย  ย  ย  ย  GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
ย  ย  ย  ย  ย  ย  ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
ย  ย  ย  ย  ย  ย  GL11.glPopMatrix();
ย  ย  ย  ย  ย  ย  GL11.glMatrixMode(GL11.GL_MODELVIEW);
ย  ย  ย  ย  ย  ย  GL11.glDisable(GL11.GL_BLEND);
ย  ย  ย  ย  ย  ย  GL11.glEnable(GL11.GL_LIGHTING);
ย  ย  ย  ย  ย  ย  GL11.glDepthFunc(GL11.GL_LEQUAL);
ย  ย  ย  ย  }

ย 

ย 

The renderEngine.bindTexture is throwing an error as well as the icon.getSheetWidth() and icon.getSheetHeight(), I'm assuming this is from before the texture changes since it refers to terrain.png, how do I fix this for 1.6.2? also which textures do I now need to reference instead of the "terrain.png" and the "/gui/items.png"?

ย 

If this has already been answered elsewhere could you point me in the right direction?

ย 

ย 

yeah in 1.6.2 you need to use ResourceLocation

and call a method from the renderEngine which use that (cant remember the exact name since its like func_xxxx_a(ResourceLocation))

ย 

beside that you shouldnt need getSheetWidth as getMinU getMaxU getMinV getMaxV should be enough for every needs

ย 

also, you probably dont need getMin/Max/U/V if you use ResourceLocation instead of the standard iconsheet

ย 

ย 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

I am now using the following in the place of the bindTexture:

ย 

this.mc.renderEngine.func_110577_a(new ResourceLocation("/assets/MOD/textures/model/TEXTURE.png"));

ย 

however I am unsure what exactly I need to point the file path towards? Also what is the following line of code in reference to?

ย 

this.mc.renderEngine.bindTexture("%blur%/misc/glint.png");

as to where to point the file, theres a tutorial on the wiki about how to properlly setup images in your folders and all that

ย 

this.mc.renderEngine.bindTexture("%blur%/misc/glint.png");

thsi is 1.5.2 code and basicly points to a file called glint.png in the folder misc somewhere, not sure exactly what it is

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

Sorry I may have been unclear, I know how to setup textures correctly, I'm just unsure which actual texture to point it to, do I point it to my bow texture?

well yeah, if you want to render a bow, bind a bow texture .. if you want to render a couchย  .... bind a couch texture

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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.