SHARE
TWEET

Untitled

a guest Dec 7th, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private void renderName(RenderPlayerEvent event, LevelheadTag tag, EntityPlayer player, double x, double y, double z) {
  2.         FontRenderer fontrenderer = event.getRenderManager().getFontRenderer();
  3.         float f = (float) (1.6F * Levelhead.getInstance().getDisplayManager().getMasterConfig().getFontSize());
  4.         float f1 = 0.016666668F * f;
  5.         GlStateManager.pushMatrix();
  6.  
  7.         int xMultiplier = 1;
  8.         if (Minecraft.getMinecraft() != null && Minecraft.getMinecraft().gameSettings != null && Minecraft.getMinecraft().gameSettings.thirdPersonView == 2)
  9.             xMultiplier = -1;
  10.         GlStateManager.translate((float) x + 0.0F, (float) y + player.height + 0.5F, (float) z);
  11.         GL11.glNormal3f(0.0F, 1.0F, 0.0F);
  12.         GlStateManager.rotate(-event.getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
  13.         GlStateManager.rotate(event.getRenderManager().playerViewX * xMultiplier, 1.0F, 0.0F, 0.0F);
  14.  
  15.         GlStateManager.scale(-f1, -f1, f1);
  16.         GlStateManager.disableLighting();
  17.         GlStateManager.depthMask(false);
  18.         GlStateManager.disableDepth();
  19.         GlStateManager.enableBlend();
  20.         GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
  21.         Tessellator tessellator = Tessellator.getInstance();
  22.         WorldRenderer worldrenderer = tessellator.getWorldRenderer();
  23.         int i = 0;
  24.  
  25.         int j = fontrenderer.getStringWidth(tag.getString()) / 2;
  26.         GlStateManager.disableTexture2D();
  27.         worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
  28.         worldrenderer.pos(-j - 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
  29.         worldrenderer.pos(-j - 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
  30.         worldrenderer.pos(j + 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
  31.         worldrenderer.pos(j + 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
  32.         tessellator.draw();
  33.         GlStateManager.enableTexture2D();
  34.  
  35.         renderString(fontrenderer, tag);
  36.  
  37.         GlStateManager.enableLighting();
  38.         GlStateManager.disableBlend();
  39.         GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  40.         GlStateManager.popMatrix();
  41.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top