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

NBT parser regex checks for pipebars as tag declaration

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.8.9, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, 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.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w14a, Minecraft 17w15a
    • Fix Version/s: Minecraft 17w16a
    • Labels:
    • Confirmation Status:
      Confirmed

      Description

      Tiny, minor error that doesn't really affect anybody. The NBT parser uses the following regex (Double specifically but applies to most of the other regex used):

      [-+]?[0-9]*\\.?[0-9]+[d|D]

      The | (pipebar) is used as a literal value check rather than as an OR operator, so the following creates a Double when it should be a String instead:

      tagname:1|

      The other datatypes use the pipebar as a value, including IntArrays (resulting in a String due to non-parseable Integer rather than an expected List with the record tossed).

      \\[[-+\\d|,\\s]+\\]
      
      tagname:[1,2,|,4]

      The fix is to simply remove the pipebar:

      [-+]?[0-9]*\\.?[0-9]+[dD]
      \\[[-+\\d,\\s]+\\]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                grum [Mojang] Grum (Erik Broes)
                Reporter:
                skylinerw [Mod] Skylinerw
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: