Skip to content

Commit

Permalink
调整代码
Browse files Browse the repository at this point in the history
  • Loading branch information
stevei5mc committed Sep 29, 2024
1 parent 1ed1ba7 commit 493b4e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/cn/stevei5mc/NewTipsVariables/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static Main getInstance() {
public void onLoad() {
instance = this;
this.loadConfigRes();//加载配置文件
this.saveConfig();
this.loadVarRes();//加载变量文档
if (config.getBoolean("updata.in-config.check")) {//从config.yml中获取updata.in-config.check为true则执行相关内容
ConfigUtils.checkVersion();
Expand Down Expand Up @@ -63,13 +64,16 @@ public void onDisable() {
this.getLogger().info("已停止运行,感谢你的使用");
}

public void loadConfigRes() {
public void saveConfig() {
this.getDataFolder().mkdirs();
this.saveDefaultConfig();
this.saveResource("server.yml",false);
this.saveResource("player.yml",false);
this.saveResource("world_name.yml",false);
this.saveResource("language.yml",false);
}

public void loadConfigRes() {
this.config = new Config(this.getDataFolder() + "/config.yml", Config.YAML);
this.configInServer = new Config(this.getDataFolder() + "/server.yml", Config.YAML);
this.configInPlayer = new Config(this.getDataFolder() + "/player.yml", Config.YAML);
Expand Down

0 comments on commit 493b4e3

Please sign in to comment.