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

A map's "frame" icon always points east when the map is put into an item frame on the floor or ceiling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.13.2, Minecraft 1.14 Pre-Release 2, 20w09a, 20w51a, 1.20.2, 23w40a, 23w43a, 1.20.3 Pre-Release 4, 1.20.3, 1.20.4 Release Candidate 1, 1.20.4, 24w09a, 1.20.5, 1.21.1, 24w39a
    • Confirmed
    • Maps

      The Bug

      When placing an unlocked map into an item frame, a "frame" marker is created (the green arrow) which faces the same direction as the map. When placed on the ground and celing specifically though, it always faces to the right.

      Steps to Reproduce

      1. /give @p map
      1. /give @p item_frame
      1. Use map item
      2. Place map in item frame

      Code Analysis / MCP 1.20.1

      When the frame icon is created on the map, it sets the rotation of the icon to be equal to the map's direction (-1 for down & up, 0 for south, 1 for west, 2 for north, and 3 for east) multiplied by 90. This means that any time a map is put on the ground or ceiling, it will always equal -90, or in this case, visually facing right.

      One possible fix, is to add another map icon similar to the frame icon, but does not have a point/arrow on in. This new icon could be used when the map is facing up or down instead,
      Below is the affected code, with a preposed fix:

      net.minecraft.world.level.saveddata.maps/MapItemSavedData.java - tickCarriedBy()
      
               . . .
               MapFrame mapframe = new MapFrame(blockpos, itemframe.getDirection().get2DDataValue() * 90, itemframe.getId());
               this.addDecoration(
      Issue Start:
                       MapDecoration.Type.FRAME, player.level(), "frame-" + itemframe.getId(), blockpos.getX(), blockpos.getZ(), itemframe.getDirection().get2DDataValue() * 90, null
      Issue End:
               );
               this.frameMarkers.put(mapframe.getId(), mapframe);
               . . .
      

      Possible Fix:

               if (itemframe.getDirection().get2DDataValue() == -1) {
                  this.addDecoration(MapDecoration.Type.NEW_MAP_ICON, player.level(), "frame-" + itemframe.getId(), blockpos.getX(), blockpos.getZ(), 180, null);
               } else {
                  this.addDecoration(MapDecoration.Type.FRAME, player.level(), "frame-" + itemframe.getId(), blockpos.getX(), blockpos.getZ(), itemframe.getDirection().get2DDataValue() * 90, null);
               }
               this.frameMarkers.put(mapframe.getId(), mapframe);
      

            Unassigned Unassigned
            Jingy [Helper] Jiingy
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: