Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-93479

F3+B hitbox/fishing rod line thickness (width) varies depending on whether F3 is open

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.8.8, Minecraft 15w46a, Minecraft 15w47a, Minecraft 15w47b, Minecraft 15w47c, Minecraft 15w49a, Minecraft 15w49b, Minecraft 1.8.9, Minecraft 15w50a, Minecraft 15w51a, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w05a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 16w15a, Minecraft 16w15b, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17a, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 3, Minecraft 1.12 Pre-Release 4, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 17w31a, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 18w06a, Minecraft 18w07a, Minecraft 18w07b, Minecraft 18w07c, Minecraft 18w08a, Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w10a, Minecraft 18w10b, Minecraft 18w10c, Minecraft 18w10d, Minecraft 18w11a, Minecraft 18w14b, Minecraft 18w15a, Minecraft 1.13-pre1, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w43a, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14.3, 1.14.4, 19w34a
    • Fix Version/s: 19w39a
    • Labels:
    • Confirmation Status:
      Confirmed
    • Category:
      UI

      Description

      The thickness of the lines on the hitbox display F3+B varies depending on whether the F3 menu is open. When F3 is closed, the lines are noticeably thicker than when it is open. Other debug-related renderers, such as F3+G for chunk borders, also change the thickness. Sometimes, the width resets after the F3 menu is closed, and sometimes it stays at the smaller width.

      This happens because the line thickness is not set when drawing the hitboxes; instead, the current thickness is used, which is smaller if F3 is open due to drawing the crosshair.

      The specific code spots where this occurs are as follows (using MCP with 1.10.2 and 1.10.2 obfuscation):

      The crosshair is rendered here:

      net.minecraft.client.gui.GuiIngame.renderAttackIndicator(float, ScaledResolution) (bdm.a(float, bdp), lines 347-356)
      if (gamesettings.showDebugInfo && !gamesettings.hideGUI && !this.mc.thePlayer.hasReducedDebug() && !gamesettings.reducedDebugInfo) {
          GlStateManager.pushMatrix();
          GlStateManager.translate((float)(l / 2), (float)(i1 / 2), this.zLevel);
          Entity entity = this.mc.getRenderViewEntity();
          GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_184045_1_, -1.0F, 0.0F, 0.0F);
          GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_184045_1_, 0.0F, 1.0F, 0.0F);
          GlStateManager.scale(-1.0F, -1.0F, -1.0F);
          OpenGlHelper.renderDirections(10);
          GlStateManager.popMatrix();
      }
      

      The specific rendering of the directions is here. Note the call to GL11.glLineWidth(1) at the end:

      net.minecraft.client.renderer.OpenGlHelper.renderDirections(int) (caf.m(int), lines 787-809)
      public static void renderDirections(int p_188785_0_) {
          GlStateManager.disableTexture2D();
          GlStateManager.depthMask(false);
          Tessellator tessellator = Tessellator.getInstance();
          VertexBuffer vertexbuffer = tessellator.getBuffer();
          GL11.glLineWidth(4.0F);
          vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR);
          vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
          vertexbuffer.pos((double)p_188785_0_, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, (double)p_188785_0_, 0.0D).color(0, 0, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, 0.0D, (double)p_188785_0_).color(0, 0, 0, 255).endVertex();
          tessellator.draw();
          GL11.glLineWidth(2.0F);
          vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR);
          vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 0, 0, 255).endVertex();
          vertexbuffer.pos((double)p_188785_0_, 0.0D, 0.0D).color(255, 0, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 255, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, (double)p_188785_0_, 0.0D).color(0, 255, 0, 255).endVertex();
          vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(127, 127, 255, 255).endVertex();
          vertexbuffer.pos(0.0D, 0.0D, (double)p_188785_0_).color(127, 127, 255, 255).endVertex();
          tessellator.draw();
          GL11.glLineWidth(1.0F);
          GlStateManager.depthMask(true);
          GlStateManager.enableTexture2D();
      }
      

      And the code that renders the bounding box is here. Note the lack of any code setting the line width:

      net.minecraft.client.renderer.entity.RenderManager.renderDebugBoundingBox(Entity, double, double, double, float, float) (bsh.a(rw, double, double, double, float, float), lines 404-450)
      /**
       * Renders the bounding box around an entity when F3+B is pressed
       */
      private void renderDebugBoundingBox(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks) {
      	GlStateManager.depthMask(false);
      	GlStateManager.disableTexture2D();
      	GlStateManager.disableLighting();
      	GlStateManager.disableCull();
      	GlStateManager.disableBlend();
      	float f = entityIn.width / 2.0F;
      	AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
      	RenderGlobal.func_189694_a(axisalignedbb.minX - entityIn.posX + x, axisalignedbb.minY - entityIn.posY + y, axisalignedbb.minZ - entityIn.posZ + z, axisalignedbb.maxX - entityIn.posX + x, axisalignedbb.maxY - entityIn.posY + y, axisalignedbb.maxZ - entityIn.posZ + z, 1.0F, 1.0F, 1.0F, 1.0F);
      
      	if (entityIn instanceof EntityLivingBase) {
      		float f1 = 0.01F;
      		RenderGlobal.func_189694_a(x - (double)f, y + (double)entityIn.getEyeHeight() - 0.009999999776482582D, z - (double)f, x + (double)f, y + (double)entityIn.getEyeHeight() + 0.009999999776482582D, z + (double)f, 1.0F, 0.0F, 0.0F, 1.0F);
      	}
      
      	Tessellator tessellator = Tessellator.getInstance();
      	VertexBuffer vertexbuffer = tessellator.getBuffer();
      	Vec3d vec3d = entityIn.getLook(partialTicks);
      	vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
      	vertexbuffer.pos(x, y + (double)entityIn.getEyeHeight(), z).color(0, 0, 255, 255).endVertex();
      	vertexbuffer.pos(x + vec3d.xCoord * 2.0D, y + (double)entityIn.getEyeHeight() + vec3d.yCoord * 2.0D, z + vec3d.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
      	tessellator.draw();
      	GlStateManager.enableTexture2D();
      	GlStateManager.enableLighting();
      	GlStateManager.enableCull();
      	GlStateManager.disableBlend();
      	GlStateManager.depthMask(true);
      }
      

      This can be fixed by adding a call to GlStateManager.glLineWidth(1) (bob.d(1) - for thin lines) or GlStateManager.glLineWidth(2) (bob.d(2) - for thick lines) to renderDebugBoundingBox.

      The thickness change does not happen when in third person (F5).

      Video:
      https://www.youtube.com/watch?v=upPdAta8xGY

        Attachments

        1. 2015-11-29_18.23.23.png
          2015-11-29_18.23.23.png
          387 kB
        2. 2015-11-29_18.23.35.png
          2015-11-29_18.23.35.png
          408 kB
        3. 2015-12-08_21.38.49.png
          2015-12-08_21.38.49.png
          205 kB
        4. 2015-12-08_21.38.59.png
          2015-12-08_21.38.59.png
          213 kB
        5. 2015-12-08_21.39.45.png
          2015-12-08_21.39.45.png
          204 kB
        6. 2015-12-08_21.39.56.png
          2015-12-08_21.39.56.png
          219 kB
        7. 2015-12-08_21.40.46.png
          2015-12-08_21.40.46.png
          274 kB
        8. 2015-12-08_21.40.58.png
          2015-12-08_21.40.58.png
          282 kB
        9. 2015-12-08_21.41.18.png
          2015-12-08_21.41.18.png
          256 kB
        10. 2015-12-08_21.41.29.png
          2015-12-08_21.41.29.png
          264 kB
        11. 2015-12-08_21.41.48.png
          2015-12-08_21.41.48.png
          240 kB
        12. 2015-12-08_21.41.58.png
          2015-12-08_21.41.58.png
          249 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Les3awe [Mod] Les3awe
            • Votes:
              10 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: