mojira.dev
MC-97662

NBT parser regex checks for pipebars as tag declaration

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]+\\]

Linked issues

Comments 0

No comments.

Skylinerw

Erik Broes

Confirmed

NBT, nbt, parsing, pipe

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.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w14a, Minecraft 17w15a

Minecraft 17w16a

Retrieved