简体   繁体   English

我正在创建一个 spigot 插件,我的测试服务器上显示的配置文件与 Intellij 中的配置文件不匹配

[英]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:这就是它在 Intellij 中的样子,但是当我 package 插件并将其放入我的测试服务器时,配置文件如下所示:

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();在我的 OnEnable 方法中,我有这一行: getConfig().options().copyDefaults();

In my OnDisable method, I have: saveConfig();在我的 OnDisable 方法中,我有: saveConfig();

Does anyone know what I'm doing wrong?有谁知道我做错了什么? Thanks!谢谢!

I had to call saveDefaultConfig();我不得不调用saveDefaultConfig(); in my OnEnable method... whoops在我的 OnEnable 方法中...哎呀

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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