Jump to content

1.7.10 Problems with rendering a tag above name (opengl)


powns

Recommended Posts

Basically i am willing to render a tag above a player's nametag.

In my 1.8.9 version of the mod it is working, but since i have no actual experience with opengl i cannot find out whats going on....

 

I have tried to print a line to the console after every action that occurs within the method that should render a tag and it actually goes through every single action.

When i try to run the mod it gives me an error like the picture i attached to the thread.

 

The source code from the render method:

public void renderName(final RendererLivingEntity renderer, final String str, final EntityPlayer entityIn, final double x, final double y, final double z) {
    	final FontRenderer fontrenderer = renderer.getFontRendererFromRenderManager();
        final float f = 1.6f;
        final float f3 = this.mod.getSize();
        GL11.glPushMatrix();
        GL11.glTranslatef((float)x + 0.0f, (float)y + entityIn.height + 0.5f, (float)z);
        GL11.glNormal3f(0.0f, 1.0f, 0.0f);
        GL11.glRotatef(-renderer.getFontRendererFromRenderManager().FONT_HEIGHT, 0.0f, 1.0f, 0.0f);
        GL11.glRotatef(renderer.getFontRendererFromRenderManager().FONT_HEIGHT, 1.0f, 0.0f, 0.0f);
        
        GL11.glScalef(-f3, -f3, f3);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDepthMask(false);
        GL11.glDisable(GL11.GL_DEPTH);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(770, 771);
        final Tessellator tess = Tessellator.instance;

        final int i = this.mod.getHeight();

        final int j = fontrenderer.getStringWidth(str) / 2;
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        tess.startDrawingQuads();
        tess.addVertex((double)(-j - 1), (double)(-1 + i), 0.0);
        tess.addVertex((double)(-j - 1), (double)(8 + i), 0.0);
        tess.addVertex((double)(j + 1), (double)(8 + i), 0.0);
        tess.addVertex((double)(j + 1), (double)(-1 + i), 0.0);
        tess.draw();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127);
        GL11.glEnable(GL11.GL_DEPTH);
        GL11.glDepthMask(true);
        fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glColor3f(1.0f, 1.0f, 1.0f);
        GL11.glPopMatrix();
    }

 

Could anyone explain me what I am doing wrong and possibly assisting me into making this work?

73d5511461c6d94804b3cfaa06b14891.png

Edited by powns
forgot to add some minor detail
Link to comment
Share on other sites

17 minutes ago, Ugdhar said:

1.7.10 is no longer supported

I have seen people still make mods like waypoints mod for hcf... Apart from that idk if you are known with CheatBreaker? People still code a huge bunch in 1.7.10.

I know theres a way to fix this but idk how :/

Link to comment
Share on other sites

4 minutes ago, powns said:

I have seen people still make mods like waypoints mod for hcf... Apart from that idk if you are known with CheatBreaker? People still code a huge bunch in 1.7.10.

I know theres a way to fix this but idk how :/

 

Not supported doesn't mean that it's not possible to make mods for 1.7.10, it just means that you won't get help with it on this site.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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