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



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • It doesn't work even if I remove every mod Please help
    • Hi, so I was making an item that sends info to the server to do some work, and I want the server to send the client back the results? How do I do that? Here is my code:   The snippet that sends the packet to the server SimpleChannelNetwork.CHANNEL.sendToServer(new CreateStructureCompass("fortress"));   The file that manage the traffic package io.github.bossmania.NetherandEndMaps.core.network; import io.github.bossmania.NetherandEndMaps.NetherandEndMaps; import io.github.bossmania.NetherandEndMaps.core.network.message.CreateStructureCompass; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; public class SimpleChannelNetwork { public static final String NETWORK_VERSION = "0.1.0"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(NetherandEndMaps.MOD_ID, "network"), () -> NETWORK_VERSION, version -> version.equals(NETWORK_VERSION), version -> version.equals(NETWORK_VERSION)); public static void init() { CHANNEL.registerMessage(0, CreateStructureCompass.class ,CreateStructureCompass::encode, CreateStructureCompass::decode, CreateStructureCompass::handle); } }   the code that handle the packet receive and where I want the server to send back a packet to the client package io.github.bossmania.NetherandEndMaps.core.network.message; import java.util.function.Supplier; import io.github.bossmania.NetherandEndMaps.common.items.TemporaryItem; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.feature.structure.Structure; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.fml.network.NetworkEvent; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; public class CreateStructureCompass { public String structureType; public CreateStructureCompass() { } //create the constructor and store the structureType public CreateStructureCompass(String structureType) { this.structureType = structureType; } //encode the message public static void encode(CreateStructureCompass message, PacketBuffer buffer) { buffer.writeString(message.structureType); } //decode the message public static CreateStructureCompass decode(PacketBuffer buffer) { return new CreateStructureCompass(buffer.readString()); } //execute function when message is sent to server public static void handle(CreateStructureCompass message, Supplier<NetworkEvent.Context> contextSupplier) { NetworkEvent.Context context = contextSupplier.get(); context.enqueueWork(() -> { //get the player and the server ServerPlayerEntity player = context.getSender(); ServerWorld SEWorld = player.getServerWorld(); //get the location of the structure BlockPos structureLocation = SEWorld.func_241117_a_(Structure.FORTRESS, player.getPosition(),100, false); //this is where I want the server to send structureLocation back to the player }); context.setPacketHandled(true); } }  
    • I cannot get an instance of MC Forge to run with either the vanilla launcher or GDLauncher, yet vanilla MC and Fabric MC work fine in both.  I am running the latest versions of everything, and no 1.18-compatible version of Forge will launch even though they all install without fail. Using the vanilla launcher I get exit code 0 and the following logs: Debug log Latest log With GDLauncher I get the following console output:  
    • In 1.15 and before, you could get the item being held/dragged by the cursor using PlayerInventory#getItemStack. This no longer seems to be the case. How do we do this now?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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