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

Discrepancy exists between identifier-allowed characters and path segment-allowed characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 22w43a
    • 22w42a
    • None
    • Plausible
    • Resource Packs
    • Normal
    • Platform

      Namespaced IDs' paths can have ASCII lowercase alphabets, ASCII digits, dots, underscores, slashes, and hyphens. However, the path segment of a directory-based resource pack only allows ASCII lowercase alphabets, ASCII digits, dots, or underscores, but not hyphens.

      This can potentially interfere with overriding assets/data using extracted resource pack/data pack if the path contains a hyphen. However, I am not aware of a vanilla stuff with a hyphen in the path. This mostly affects mods and potentially custom data packs.

      (Slashes are directory separators and thus does not cause issues.)

      See the following code:

      public class x {
      
      private static final Pattern d = Pattern.compile("[._a-z0-9]+"); // notice there is no hyphen
      

            boq [Mojang] Bartosz Bok
            apple502j apple502j
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: