kangarko / Foundation

Foundation™ helps you create highly customized Minecraft plugins (based on Spigot/Paper API) that support multiple MC versions.

Home Page:https://mineacademy.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YamlStaticConfig bug , paper 1.18.1 , Foundation 5.12.6

aaa8881 opened this issue · comments

paper 1.8.1 , java17 , foundation 5.12.6

yml

d1key1:
  d2key1:
    moo: 'aaa'
    boo: 'bbb'
d1key2:
  d2key2:
    moo: 'aaa'
    boo: 'bbb'

TestConfig extends YamlStaticConfig

    private static void init() {
        getMap("").keySet().forEach(key1->{
            SerializedMap map1 = getMap(key1);
            map1.keySet().forEach( key2 -> {
                SerializedMap map2 = map1.getMap(key2);
                map2.keySet().forEach( key3 -> {
                    Common.log( key3 + " : " + map2.getString(key3));
                });

            });
        });
    }

result

[03:32:21 INFO]: [null] moo : org.bukkit.configuration.SectionPathData@173ca392
[03:32:21 INFO]: [null] boo : org.bukkit.configuration.SectionPathData@440dd8b8
[03:32:21 INFO]: [null] moo : org.bukkit.configuration.SectionPathData@1470475d
[03:32:21 INFO]: [null] boo : org.bukkit.configuration.SectionPathData@66a25672

expected result

moo: aaa
boo: bbb
moo: aaa
boo: bbb

depth 1 yml works

example

key1:
  a: 'aaa'
  b: 'bbb'
key2:
  a: 'aaa'
  b: 'bbb'

more than depth 2 doesn't work.

commented

This is caused by an internal change in Bukkit in 1.18, we have already patched this for Foundation 6, which will come out as soon as possible in the coming weeks.