createExplorerMap doesn't accept the new Structure/StructureType options

XMLWordPrintable

    • CraftBukkit version 4582-Spigot-66411b9-ecdf5f6 (MC: 1.21.11) (Implementing API version 1.21.11-R0.1-SNAPSHOT)
    • Yes

      There are two StructureType classes:
      old: org.bukkit.StructureType
      new: org.bukkit.generator.structure.StructureType

      Around 1.19, these methods were updated to accept the new Structure and StructureType classes:
      World#locateNearestStructure(Location, Structure, int, boolean)
      World#locateNearestStructure(Location, StructureType, int, boolean)
      The old StructureType method was deprecated:
      World#locateNearestStructure(Location, StructureType, int, boolean)

      In 1.21.11, these methods still only allow using the old StructureType (which doesn't contain newer structures such as the Trial Chamber):
      Bukkit#createExplorerMap(World, Location, StructureType)
      Bukkit#createExplorerMap(World, Location, StructureType, int, boolean)

      I suggest deprecating the two old methods and adding a few new createExplorerMap methods in their place:
      createExplorerMap(World, Location, StructureType, int, boolean)
      createExplorerMap(World, Location, Structure, int, boolean)
      createExplorerMap(World, Location, StructureSearchResult, int, boolean)
      createExplorerMap(World, Location, Location, MapCursor.Type, int, boolean)

      That 4th option especially would've prevented this from being a problem by providing a convenient workaround for the outdated API, in addition to making custom maps easier to generate with the biome preview.

      The new StructureType doesn't contain a getMapIcon() method like the old StructureType did, so you'd need to resolve that somehow too (unless you only want to implement the 4th option, which would still be fantastic in my opinion).

            Assignee:
            Unassigned
            Reporter:
            iPyronic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: