Jump to content

Recommended Posts

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;

}

Posted

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.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
    • Maybe you need to create file in assets/<modid>/items/<itemname>.json with content like this:   { "model": { "type": "minecraft:model", "model": "modname:item/itemname" } }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.