Help me update these lines of code from 1.7 to 1.8

Started by oblisgr on Sat, 10/24/2015 - 22:12
Last seen on 14:42, 5. Jan 2017
Joined Mar 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Help me update these lines of code from 1.7 to 1.8
Sat, 10/24/2015 - 22:12

Help me update these lines of code from 1.7 to 1.8

MCreator gives me the following errors:

C:\Pylo\MCreator158\forge\build\sources\java\mod\mcreator\mcreator_weapons1h.java:824: error: cannot find symbol
IIcon icon = item.getIconIndex();
^
  symbol:   class IIcon
  location: class NPC_BattleaxeRender

and 

C:\Pylo\MCreator158\forge\build\sources\java\mod\mcreator\mcreator_weapons1h.java:831: error: instance has private access in Tessellator
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 16F / 256F);

 

CODE:

public static class NPC_BattleaxeRender
implements IItemRenderer{

public boolean handleRenderType(ItemStack itemStack, IItemRenderer.ItemRenderType type){return true;}
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper){return false;}
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data){

IIcon icon = item.getIconIndex();

if (type == IItemRenderer.ItemRenderType.ENTITY){
GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 0.0F, 0.0F);
GL11.glRotatef(0.0F, 1.0F, 0.0F, 0.0F);
GL11.glScalef(2.0F, 2.0F, 2.0F);
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 16F / 256F);
GL11.glPopMatrix();} if (type == IItemRenderer.ItemRenderType.INVENTORY){
GL11.glPushMatrix();
GL11.glTranslatef(15.0F, 1.0F, 0.0F);
GL11.glRotatef(225.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(21.0F, 15.0F, 2.0F);
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 16F / 256F);
GL11.glPopMatrix();} if (type == IItemRenderer.ItemRenderType.EQUIPPED){

GL11.glPushMatrix();
GL11.glTranslatef(1.0F, -0.02F, -0.05F);
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);
GL11.glScalef(1.0F, 1.0F, 1.5F);
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 16F / 256F);
GL11.glPopMatrix();} if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON){
GL11.glPushMatrix();
GL11.glTranslatef(30.0F, -45.0F, 35.0F);
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F);
GL11.glScalef(70.0F, 70.0F, 100.0F);
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 16F / 256F);
GL11.glPopMatrix();} }}

Last seen on 14:23, 5. Jul 2016
Joined Dec 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
but you can export you mod
Sun, 10/25/2015 - 17:16

but you can export you mod via mcr and the import it.