Advertisement
Guest User

Untitled

a guest
Apr 24th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.75 KB | None | 0 0
  1.     private static void renderTextOverlay(Vec3 offset, List<String> present, List<String> missing, ItemStack ghosted, ItemStack stack, float scale, Vec3 textOffset) {
  2.         FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj;
  3.         if (ghosted != null) {
  4.             stack = ghosted;
  5.         }
  6.         if (stack != null) {
  7.             net.minecraft.client.renderer.RenderHelper.enableStandardItemLighting();
  8.  
  9.             GL11.glPushMatrix();
  10.  
  11.             rotateToPlayer();
  12.  
  13.             GL11.glTranslated(offset.xCoord + -0.5 + textOffset.xCoord, offset.yCoord + 0.5 + textOffset.yCoord, offset.zCoord + 0.2 + textOffset.zCoord);
  14.  
  15.             float f3 = 0.0075F;
  16.             float factor = 1.5f;
  17.             GlStateManager.scale(f3 * factor, -f3 * factor, f3);
  18.             GlStateManager.disableLighting();
  19.             GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
  20.             GlStateManager.disableDepth();
  21.  
  22.             if ((!missing.isEmpty()) || (!present.isEmpty())) {
  23.                 GlStateManager.pushMatrix();
  24.                 GlStateManager.scale(.5, .5, .5);
  25.                 int y = 60 - 10;
  26.                 for (String s : missing) {
  27.                     fontrenderer.drawStringWithShadow(s, 60, y, 0xffff0000);
  28.                     y -= 10;
  29.                 }
  30.                 for (String s : present) {
  31.                     fontrenderer.drawStringWithShadow(s, 60, y, 0xff00ff00);
  32.                     y -= 10;
  33.                 }
  34.                 GlStateManager.popMatrix();
  35.             }
  36.  
  37.             fontrenderer.drawStringWithShadow(String.valueOf(stack.stackSize), 40, 40, 0xffffffff);
  38.             GlStateManager.enableDepth();
  39.             GlStateManager.enableLighting();
  40.  
  41.             GL11.glPopMatrix();
  42.         }
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement