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

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:

 

 

1wqiBL5.png

 

 

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());
}
}

 

if(pain == 0)

{

   gain = 0;

}

  • Author

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?

if(pain == 0)

{

   gain = 0;

}

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).

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Hey I just wanted to know what should I do if I wanted to render my techne model in my hand instead?

if(pain == 0)

{

   gain = 0;

}

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.