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

Map decorations are off by one half pixel in negative area of the map

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.1, 1.21.2 Pre-Release 3
    • Community Consensus
    • Maps
    • Low
    • Platform

      Map decorations on the negative side of the maps midpoint is of by half a pixel

      In the provided picture there are picture showing an example. The banners that are placed on the positive side of the map and has their icon centered around the block its placed on. While the banners that are on the negative side are one half pixel too far right.

      You can also see that the player is not centered on the diamonds on the map.

      Steps to Reproduce:

      • Create a map
      • Go to the center of the map
      • Place a banner on the positive and negative side of the middle
      • Reload the world to avoid MC-129386 moving the banners another half pixel more right
      • Look at the map

       

      Code:

      In function:

      net>minecraft>world>level>saveddata>maps>MapItemSavedData.java>MapItemSavedData>addDecoration()
      

      Code is:

      byte $$10 = (byte)((int)((double)($$8 * 2.0F) + 0.5));
      byte $$11 = (byte)((int)((double)($$9 * 2.0F) + 0.5)); 
      

      Code should be:

      byte $$10 = (byte)((int)Math.floor((double)($$8 * 2.0F) + 0.5)); 
      byte $$11 = (byte)((int)Math.floor((double)($$9 * 2.0F) + 0.5));

        1. image-2024-08-09-21-53-13-691.png
          47 kB
          JustAVirus
        2. image-2024-10-14-22-53-27-821.png
          207 kB
          BugTracker

            Unassigned Unassigned
            JustAVirus JustAVirus
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: