Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6225

Add a way to list all materials (except legacy ones)

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • 1.16.4
    • Yes

      Currently, I can obtain an array of all Materials using Material.values(), but unfortunately this includes all the legacy materials. There is no stable way of obtaining a list of all materials without including the legacy materials in your list, because the isLegacy() method on Material is deprecated with a comment saying "do not use for any reason". AFAIK the name of the legacy materials isn't stable either so I can't use material.name().startsWith("LEGACY_").

      This is the only use-case I can think of where I am tempted to use isLegacy(), so please can you add an API to list all (non-legacy) materials without needing to call this method?

            Unassigned Unassigned
            Earthcomputer Earthcomputer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: