Posted October 24, 20159 yr Hello, I m trying to use it in my code in 1.8 but i get errors like: java:824: error: cannot find symbol IIcon icon = item.getIconIndex(); ^ symbol: class IIcon location: class NPC_BattleaxeRender and java:849: error: instance has private access in Tessellator This is the code lines i used in 1.7.x to render a custom item. It used to work then but not now of course. 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();} }}
October 25, 20159 yr 1.8 has new rendering and model systems. IIcon and IItemRenderer is no more. To have a peak at new rendering: https://github.com/TheGreyGhost/MinecraftByExample ISmartItemModel allows mdoel manipulation. 1.7.10 is no longer supported by forge, you are on your own.
October 25, 20159 yr Code from 1.7 needs major overhauling before you have something that will work in 1.8. There are many threads here that already answer the issues you're displaying. However, they can be difficult to find using the site's own search (it tends to turn up massive logs). Try to Google as much as you can about: Minecraft Forge "1.8"... 1) + blockstates 2) + tesselator 3) + mesher And be ready to do the common and client proxies... they're now essential to all mods with items (including nearly all blocks, because they can drop or appear in inventory as items. Finally, read about Forge's advanced blockstate format. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
October 25, 20159 yr Author yes i figured out how it works. No need to make special render anymore, because 1.8 uses the json models and there you can define the position of the item. The only problem/glich i face now is the partial transparensy of the item' thickness. I have to find out how to fix that now. http://i91.photobucket.com/albums/k309/oblisgr/glitch_zpse9yppcnw.png[/img]
October 25, 20159 yr Psh, that looks awesome. Keep it. (ok, ok, it only looks awesome to me) Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 25, 20159 yr We need code, assets. Did you use built in model? 1.7.10 is no longer supported by forge, you are on your own.
October 26, 20159 yr Author Actually the code didnt had problems. The textures had some transparent pixels around the item and the 1.8 machine recognized them as empty space. In 1.7.10 there wasnt any problem like that. The thing i did was to use gimp to make a black border around my items and fill that empty space. I got 2 goods from that, 1 fixed the item appearance and 2 my items look more cartoon and awsome. Solved!
October 26, 20159 yr 1.7.10 doesn't allow for transparent pixels. The png file gets thresholded (above a certain alpha -> 1, else -> 0). 1.8 looks like it'll allow for partial transparency in items, which is really cool. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 26, 20159 yr Reminds me of time when I was like: "Wtf, why is this blade see-through?" Took me some time to actually look into .png, rather than my GL calls. And indeed- it is pretty cool, you can make glassy-stuff. 1.7.10 is no longer supported by forge, you are on your own.
October 26, 20159 yr Author Anyway just to give my lights to this problem, just take care to repair your items with black border around the item. Like the one in png http://i208.photobucket.com/albums/bb180/Aramis1979/0blisgr_Battleaxe009_Icon_zpsl9z7sdnt.png[/img]
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.