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

MemoryConfiguration.addDefaults(Configuration) actually does set and not add

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • This server is running Paper version git-Paper-22 (MC: 1.18) (Implementing API version 1.18-R0.1-SNAPSHOT) (Git: 956124f)
    • Yes

      I wrote a buch of messy JUnit test in my plugin and figured out, that the method

      MemoryConfiguration.addDefaults(Configuration)

      does set the configuration, and the previous defaults are lost. More exactly, the root entries are fine, but a child section is overridden.

      The reason for that is, that the method calls

      addDefaults(defaults.getValues(true));

      and getValues(true) also returns the child sections, and and set them. This overrides previous child sections.

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

              Created:
              Updated:
              Resolved: