简体   繁体   中英

I'm creating a spigot plugin, and the config file that appears on my test server doesn't match the one in Intellij

The part of my config file specifically is this:

Players:
  "examplePlayer1":
    - 10
    - 0
  "examplePlayer2":
    - 75
    - 3

That's what it looks like in Intellij, but when I package the plugin and put it in my test server, the config file looks like this:

Players:
- examplePlayer:
  - 10
  - 0

That's an older version that didn't work for a few reasons, so I changed it, but now the new config won't save to the server.

In my OnEnable method, I have this line: getConfig().options().copyDefaults();

In my OnDisable method, I have: saveConfig();

Does anyone know what I'm doing wrong? Thanks!

I had to call saveDefaultConfig(); in my OnEnable method... whoops

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM