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

Misaligned textures on south and east faces for non-full blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 13w48a
    • Minecraft 1.4.2, Snapshot 13w02b, Snapshot 13w10a, Minecraft 1.5, Snapshot 13w18c, Snapshot 13w19a, Snapshot 13w21a, Snapshot 13w21b, Snapshot 13w22a, Snapshot 13w25a, Snapshot 13w25b, Snapshot 13w25c, Snapshot 13w26a, Minecraft 1.6, Minecraft 13w36a, Minecraft 13w38a, Minecraft 13w38c, Minecraft 13w39a, Minecraft 13w39b, Minecraft 13w41a, Minecraft 13w42b, Minecraft 13w43a, Minecraft 1.7.1, Minecraft 13w47c
    • Confirmed

      Description:

      Texture on all non-full width non-symmetrical blocks on south and east sides are misaligned, like :

      • Door
      • trapdoor
      • Fences
      • Fencegates
      • Wall
      • Buttons
      • Levers
      • Stairs
      • hopper
      • Tripwire hook

      This does not affect some blocks like cocoa, because they don't use the standard block method.

      With that bug, it's very difficult to make HD texture pack since these details are near invisible with 16x packs but not on 64x packs for example.


      Expected:

      Having textures correctly aligned, like on Ax.png screenshots.


      Actual:

      Textures are misaligned, like on Bx.png screenshots.


      Solution:
      RenderBlocks.java
      public class RenderBlocks {
          public void renderEastFace(Block par1Block, double par2, double par4, double par6, Icon texture) {
              Tessellator tessellator = Tessellator.instance;
              if (this.hasOverrideBlockTexture()) {
                  texture = this.overrideBlockTexture;
              }
              /* START OF OLD CODE *
              double var10 = (double)texture.getInterpolatedU(this.renderMinX * 16.0D);
              double var12 = (double)texture.getInterpolatedU(this.renderMaxX * 16.0D);
              * END OF OLD CODE */
              /* START OF NEW CODE */
              double var10 = (double)texture.getInterpolatedU(16.0D - this.renderMaxX * 16.0D);
              double var12 = (double)texture.getInterpolatedU(16.0D - this.renderMinX * 16.0D);
              /* END OF NEW CODE */
              double var14 = (double)texture.getInterpolatedV(16.0D - this.renderMaxY * 16.0D);
              double var16 = (double)texture.getInterpolatedV(16.0D - this.renderMinY * 16.0D);
              /* ... */
          }
          public void renderSouthFace(Block par1Block, double par2, double par4, double par6, Icon texture) {
              Tessellator tessellator = Tessellator.instance;
              if (this.hasOverrideBlockTexture()) {
                  texture = this.overrideBlockTexture;
              }
              /* START OF OLD CODE *
              double var10 = (double)texture.getInterpolatedU(this.renderMinZ * 16.0D);
              double var12 = (double)texture.getInterpolatedU(this.renderMaxZ * 16.0D);
              * END OF OLD CODE */
              /* START OF NEW CODE */
              double var10 = (double)texture.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D);
              double var12 = (double)texture.getInterpolatedU(16.0D - this.renderMinZ * 16.0D);
              /* END OF NEW CODE */
              double var14 = (double)texture.getInterpolatedV(16.0D - this.renderMaxY * 16.0D);
              double var16 = (double)texture.getInterpolatedV(16.0D - this.renderMinY * 16.0D);
              /* ... */
          }
      }

        1. A1.png
          A1.png
          91 kB
        2. A2.png
          A2.png
          102 kB
        3. B1.png
          B1.png
          89 kB
        4. B2.png
          B2.png
          102 kB
        5. bkw.class
          112 kB
        6. glitch.png
          glitch.png
          75 kB
        7. misaligned.png
          misaligned.png
          220 kB
        8. Test.zip
          149 kB

            TheMoogle Mog (Ryan Holtz)
            ypetremann Yoann Petremann
            Votes:
            29 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: