I_Iz_Shahid Posted July 23, 2015 Posted July 23, 2015 Hey guys, I was trying to get an item to render in 3D with a custom renderer that implements IItemRenderer, but I am having issues actually getting it to render the Item. I even tried to start over following iChun's tutorial for 1.7 but I guess that it doesn't work for 1.8 anymore. The only thing I am getting is an oversized block covering my whole right hand as shown below: If needed, here is my code for my renderer and my clientproxy: Renderer: package I_Iz_Shahids_Mods.net.RapierPlus.Render; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; import I_Iz_Shahids_Mods.net.RapierPlus.Main; import I_Iz_Shahids_Mods.net.RapierPlus.Models.Items.modelRapier; @SideOnly(Side.CLIENT) public class ItemRenderIron implements IItemRenderer { private modelRapier rapierModel; ResourceLocation resource = new ResourceLocation(Main.MODID + ":" + "textures/items/ironrapier.png"); public ItemRenderIron() { rapierModel = new modelRapier(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(resource); rapierModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } default: break; } } } Proxy: package I_Iz_Shahids_Mods.net.RapierPlus.Proxy; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.fml.client.registry.ClientRegistry; import I_Iz_Shahids_Mods.net.RapierPlus.Main; import I_Iz_Shahids_Mods.net.RapierPlus.Blocks.Entity.TileEntityBladeMoulder; import I_Iz_Shahids_Mods.net.RapierPlus.Blocks.Entity.TileEntityPommelMoulder; import I_Iz_Shahids_Mods.net.RapierPlus.Render.ItemRenderIron; import I_Iz_Shahids_Mods.net.RapierPlus.Render.TileEntityBladeMoulderRenderer; import I_Iz_Shahids_Mods.net.RapierPlus.Render.TileEntityPommelMoulderRenderer; public class ClientProxy extends CommonProxy { @Override public void registerRenderers() { MinecraftForgeClient.registerItemRenderer(Main.ironRapier, (IItemRenderer)new ItemRenderIron()); } } Quote if(pain == 0) { gain = 0; }
Elix_x Posted July 23, 2015 Posted July 23, 2015 Use new model format! IItemRenderer is depreceated! And it is not wprking in 1.8! Quote Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
I_Iz_Shahid Posted July 23, 2015 Author Posted July 23, 2015 How can I find one that is working on 1.8? Also if ti helps, I could try to recreate my model in JSON format, will that make things easier? Quote if(pain == 0) { gain = 0; }
Ernio Posted July 23, 2015 Posted July 23, 2015 In 1.8 you can no longer (you shouldn't) access GL directly. Everything is made of models that are pre-baked and eventually put together/modified in runtime. Yes. Using .json models is a good way to start working with it. And yes - .json models allows you to make most of stuff you want. If that is not enough - look into Forge's model API (SmartItemModel fer example). Quote 1.7.10 is no longer supported by forge, you are on your own.
I_Iz_Shahid Posted July 23, 2015 Author Posted July 23, 2015 Thanks! Quote if(pain == 0) { gain = 0; }
I_Iz_Shahid Posted July 23, 2015 Author Posted July 23, 2015 Hey I just wanted to know what should I do if I wanted to render my techne model in my hand instead? Quote if(pain == 0) { gain = 0; }
Recommended Posts
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.