Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

RenderEquippedItems: GL ERROR


MikeDark
 Share

Recommended Posts

Hello guys. I come here to ask for help to resolve the "GL ERROR". This has occurred after enable the "RenderEquippedItems" method... The video show the problem after enable the "render" and the "solution" after disable the "render".

 

Render Code:

 

 

 

protected void renderEquippedItems(EntityLiving var1, float var2) {
    	super.renderEquippedItems(var1, var2);
    	ItemStack var3 = var1.getHeldItem();
    	ItemStack itemstack1 = var1.func_130225_q(3);
    	Item item;
    	
    	if(var3 != null && var3.getItem() != null){
    		GL11.glPushMatrix();
		this.modeldeadwarrior.rightarm.postRender(0.0625F);
		GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
		IItemRenderer var5 = MinecraftForgeClient.getItemRenderer(var3, IItemRenderer.ItemRenderType.EQUIPPED);
		boolean var6 = (var5 != null) && (var5.shouldUseRenderHelper(IItemRenderer.ItemRenderType.EQUIPPED, var3, IItemRenderer.ItemRendererHelper.BLOCK_3D));
    	
		item = itemstack1.getItem();

		if(item.isFull3D()){
			 float f9 = 0.625F;
			 if(((ECEntityDeadWarrior)var1).isSpinning)
                {
	                GL11.glTranslatef(0.0F, 0.2875F, -0.1F);
	                GL11.glScalef(f9, -f9, f9);
	                GL11.glRotatef(190F, 1.0F, 0.0F, 0.0F);
	                GL11.glRotatef(310F, 0.0F, 1.0F, 0.0F);
                }else
                {
	                GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
	                GL11.glScalef(f9, -f9, f9);
	                GL11.glRotatef(-100F, 1.0F, 0.0F, 0.0F);
	                GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); 	
                }

			 if(((ECEntityDeadWarrior)var1).doIdleAnim && ((ECEntityDeadWarrior)var1).animTick <= 95)
                {             
                	GL11.glRotatef(((float)((ECEntityDeadWarrior)var1).animTick* 40), 1, 0.3F, -0.4F); 
                }
			 renderManager.itemRenderer.renderItem(var1, var3, 0);

	            if (var3.getItem().requiresMultipleRenderPasses())
	            {
	                renderManager.itemRenderer.renderItem(var1, var3, 1);
	            }
			}
    	GL11.glPopMatrix();
    	}
    }

@Override
protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_)
{
   this.renderEquippedItems((EntityLiving)p_77029_1_, p_77029_2_);
}

 

 

 

Error:

 

 

 

[14:26:50] [Client thread/ERROR]: ########## GL ERROR ##########
[14:26:50] [Client thread/ERROR]: @ Post render
[14:26:50] [Client thread/ERROR]: 1283: Stack overflow
[14:26:50] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
at com.themathe1.eternalCraft.client.renderer.entity.ECRenderEntityDeadWarrior.renderEquippedItems(ECRenderEntityDeadWarrior.java:98) ~[ECRenderEntityDeadWarrior.class:?]
at com.themathe1.eternalCraft.client.renderer.entity.ECRenderEntityDeadWarrior.renderEquippedItems(ECRenderEntityDeadWarrior.java:139) ~[ECRenderEntityDeadWarrior.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:229) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:39) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:162) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) [RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) [RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1091) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1068) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:963) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
[14:26:50] [Client thread/ERROR]: ########## GL ERROR ##########
[14:26:50] [Client thread/ERROR]: @ Post render
[14:26:50] [Client thread/ERROR]: 1283: Stack overflow
[14:26:50] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
at com.themathe1.eternalCraft.client.renderer.entity.ECRenderEntityDeadWarrior.renderEquippedItems(ECRenderEntityDeadWarrior.java:98) ~[ECRenderEntityDeadWarrior.class:?]
at com.themathe1.eternalCraft.client.renderer.entity.ECRenderEntityDeadWarrior.renderEquippedItems(ECRenderEntityDeadWarrior.java:139) ~[ECRenderEntityDeadWarrior.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:229) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:39) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:162) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) [RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) [RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1091) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1068) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:963) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
[14:26:50] [Client thread/ERROR]: ########## GL ERROR ##########
[14:26:50] [Client thread/ERROR]: @ Post render
[14:26:50] [Client thread/ERROR]: 1283: Stack overflow
[14:26:50] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
at com.themathe1.eternalCraft.client.renderer.entity.ECRenderEntityDeadWarrior.renderEquippedItems(ECRenderEntityDeadWarrior.java:98) ~[ECRenderEntityDeadWarrior.class:?]
at com.themathe1.eternalCraft.client.renderer.entity.ECRenderEntityDeadWarrior.renderEquippedItems(ECRenderEntityDeadWarrior.java:139) ~[ECRenderEntityDeadWarrior.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:229) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:39) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:162) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) [RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) [RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1091) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1068) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:963) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

 

 

 

Video:

 

https://www.youtube.com/watch?v=fkn2sYTYjSw

Link to comment
Share on other sites

Please, just rename your methods - you will see it right away. (If I am right - because I don't see full code).

 

You are making (at least what it seems like, because I don't see neither whole class, nor its super class which you call with super.method()) infinite loop in your method callings.

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

Link to comment
Share on other sites

Please, just rename your methods - you will see it right away. (If I am right - because I don't see full code).

 

You are making (at least what it seems like, because I don't see neither whole class, nor its super class which you call with super.method()) infinite loop in your method callings.

 

Ohh... Sorry, the full code it's in down

I remove the super, but the error continued... ( same error)

 

Full Render Code:

 

 

 

@SideOnly(Side.CLIENT)
public class ECRenderEntityDeadWarrior extends RenderLiving{

    private static final ResourceLocation mobTextures = new ResourceLocation(ECReference.MOD_ID + ":" + "textures/entity/DeadWarrior.png");
    private static final ResourceLocation mobTextures2 = new ResourceLocation(ECReference.MOD_ID + ":" + "textures/entity/DeadWarrior2.png");

    private ECModelDeadWarrior modeldeadwarrior;

    public ECRenderEntityDeadWarrior() {

super(new ECModelDeadWarrior(), 0.5F);
    }
    
    protected ResourceLocation getEntityTexture(ECEntityDeadWarrior par1ECEntityDeadWarrior) {

if (par1ECEntityDeadWarrior.texture == 1) {

    return mobTextures2;
} else {

    return mobTextures;
}
    }

    @Override
    protected ResourceLocation getEntityTexture(Entity par1Entity) {

return this.getEntityTexture((ECEntityDeadWarrior) par1Entity);
    }

    @Override
    protected void preRenderCallback(EntityLivingBase par1EntityLiving, float par2) {

this.renderPlayerScale((ECEntityDeadWarrior) par1EntityLiving, par2);
    }

    protected void renderPlayerScale(ECEntityDeadWarrior par1EntityDeadWarrior, float par2) {

final float f = 1.0375F;
GL11.glScalef(f, f, f);
    }

    @Override
    protected void rotateCorpse(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) {

GL11.glRotatef(180F - par3, 0.0F, 1.0F, 0.0F);

if (par1EntityLiving.deathTime > 0) {

    float f = (par1EntityLiving.deathTime + par4 - 1.0F) / 20F * 1.6F;
    f = MathHelper.sqrt_float(f);

    if (f > 1.0F) {

	f = 1.0F;
    }

    GL11.glRotatef(f * this.getDeathMaxRotation(par1EntityLiving), 1.0F, 0.0F, 0.0F);
}
    }
    
    @Override
    protected void renderEquippedItems(EntityLivingBase entitylivingbase, float var2) {
    	ItemStack itemstack = entitylivingbase.getHeldItem();
    	Item item;
    	
    	if(itemstack != null && itemstack.getItem() != null){
    		GL11.glPushMatrix();
		this.modeldeadwarrior.rightarm.postRender(0.0625F);
		GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
		IItemRenderer var5 = MinecraftForgeClient.getItemRenderer(itemstack, IItemRenderer.ItemRenderType.EQUIPPED);
		boolean var6 = (var5 != null) && (var5.shouldUseRenderHelper(IItemRenderer.ItemRenderType.EQUIPPED, itemstack, IItemRenderer.ItemRendererHelper.BLOCK_3D));
    	
		item = itemstack.getItem();

		if(item.isFull3D()){
			 float f9 = 0.625F;
			 if(((ECEntityDeadWarrior)entitylivingbase).isSpinning)
                {
	                GL11.glTranslatef(0.0F, 0.2875F, -0.1F);
	                GL11.glScalef(f9, -f9, f9);
	                GL11.glRotatef(190F, 1.0F, 0.0F, 0.0F);
	                GL11.glRotatef(310F, 0.0F, 1.0F, 0.0F);
                }else
                {
	                GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
	                GL11.glScalef(f9, -f9, f9);
	                GL11.glRotatef(-100F, 1.0F, 0.0F, 0.0F);
	                GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); 	
                }

			 if(((ECEntityDeadWarrior)entitylivingbase).doIdleAnim && ((ECEntityDeadWarrior)entitylivingbase).animTick <= 95)
                {             
                	GL11.glRotatef(((float)((ECEntityDeadWarrior)entitylivingbase).animTick* 40), 1, 0.3F, -0.4F); 
                }
			 renderManager.itemRenderer.renderItem(entitylivingbase, itemstack, 0);

	            if (itemstack.getItem().requiresMultipleRenderPasses())
	            {
	                renderManager.itemRenderer.renderItem(entitylivingbase, itemstack, 1);
	            }
	}
	GL11.glPopMatrix();
    	}
    }

}

 

 

 

@edit

 

thanks for your help, I changed the "extended" and modified the model class... thanks...

Link to comment
Share on other sites

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.