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

WorldCreator API doesn't mesh with the rest of the Spigot API

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • Any

    • 1.16.4 (or any)
    • Yes

      The WorldCreator API breaks the conventions established by the Spigot API.

       

      The clearest example I can point to is worldCreator#environment .

       

      There's two versions of this: worldCreator#environment() and worldCreator#environment(World.Environment.SOMETHING) . The first is a getter, the second is a setter. As per the rest of the API, the format ought to be worldCreator.getEnvironment and #setEnvironment .

       

      I believe this specific issue is shared with #seed(), #generator(), #hardcore() and #type() .

       

      Additionally, and this is really just a suggestion, I believe that the WorldCreator(String name) constructor is a bit dangerous since it makes a lot of default assumptions which are not immediately obvious to devs.

       

      I'd like to suggest either deprecating the existing WorldCreator in favor of WorldCreator(String name, Environment environment) as Bukkit#createWorld(new WorldCreator(name)) method actually imports existing worlds, meaning that it is exceedingly easy for devs to overlook the environment and accidentally mass corrupt worlds OR adding that constructor alongside the WorldCreator(String name).

            Unassigned Unassigned
            MagmaGuy MagmaGuy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: