mirror of
https://github.com/CarmJos/MoeTeleport.git
synced 2024-09-19 21:35:56 +00:00
修正一个命名错误
This commit is contained in:
parent
e9d4e3f9bc
commit
33c2f9de78
@ -57,7 +57,7 @@ public class Main extends EasyPlugin {
|
|||||||
getInstance().log(messages);
|
getInstance().log(messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void serve(String... messages) {
|
public static void severe(String... messages) {
|
||||||
getInstance().error(messages);
|
getInstance().error(messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ public class Main extends EasyPlugin {
|
|||||||
|
|
||||||
info("加载配置文件...");
|
info("加载配置文件...");
|
||||||
if (!ConfigManager.initConfig()) {
|
if (!ConfigManager.initConfig()) {
|
||||||
serve("配置文件初始化失败,请检查。");
|
severe("配置文件初始化失败,请检查。");
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ public class Main extends EasyPlugin {
|
|||||||
|
|
||||||
storage = storageMethod.createStorage();
|
storage = storageMethod.createStorage();
|
||||||
if (!storage.initialize()) {
|
if (!storage.initialize()) {
|
||||||
serve("初始化存储失败,请检查配置文件。");
|
severe("初始化存储失败,请检查配置文件。");
|
||||||
storage.shutdown();
|
storage.shutdown();
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
return false; // 初始化失败,不再继续加载
|
return false; // 初始化失败,不再继续加载
|
||||||
|
@ -58,8 +58,8 @@ public class UserManager {
|
|||||||
|
|
||||||
return data;
|
return data;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Main.serve("无法正常读取玩家数据,玩家操作将不会被保存,请检查数据配置!");
|
Main.severe("无法正常读取玩家数据,玩家操作将不会被保存,请检查数据配置!");
|
||||||
Main.serve("Could not load user's data, please check the data configuration!");
|
Main.severe("Could not load user's data, please check the data configuration!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return new UserData(userUUID);
|
return new UserData(userUUID);
|
||||||
}
|
}
|
||||||
@ -77,8 +77,8 @@ public class UserManager {
|
|||||||
"耗时 " + (System.currentTimeMillis() - start) + "ms。");
|
"耗时 " + (System.currentTimeMillis() - start) + "ms。");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Main.serve("无法正常保存玩家数据,请检查数据配置!");
|
Main.severe("无法正常保存玩家数据,请检查数据配置!");
|
||||||
Main.serve("Could not save user's data, please check the data configuration!");
|
Main.severe("Could not save user's data, please check the data configuration!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,8 +143,8 @@ public class UserManager {
|
|||||||
try {
|
try {
|
||||||
task.run(MoeTeleport.getStorage());
|
task.run(MoeTeleport.getStorage());
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Main.serve("无法正常更改玩家数据,请检查数据配置!");
|
Main.severe("无法正常更改玩家数据,请检查数据配置!");
|
||||||
Main.serve("Could not edit user's data, please check the data configuration!");
|
Main.severe("Could not edit user's data, please check the data configuration!");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class WarpManager {
|
|||||||
try {
|
try {
|
||||||
MoeTeleport.getStorage().saveWarps();
|
MoeTeleport.getStorage().saveWarps();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Main.serve("保存地标数据失败,请检查配置文件。");
|
Main.severe("保存地标数据失败,请检查配置文件。");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ public class WarpManager {
|
|||||||
try {
|
try {
|
||||||
MoeTeleport.getStorage().setWarp(name, new WarpInfo(name,owner, location));
|
MoeTeleport.getStorage().setWarp(name, new WarpInfo(name,owner, location));
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Main.serve("保存地标数据 " + name + " 失败,请检查配置文件。");
|
Main.severe("保存地标数据 " + name + " 失败,请检查配置文件。");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public class WarpManager {
|
|||||||
try {
|
try {
|
||||||
MoeTeleport.getStorage().delWarp(name);
|
MoeTeleport.getStorage().delWarp(name);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Main.serve("删除地标数据 " + name + " 失败,请检查配置文件。");
|
Main.severe("删除地标数据 " + name + " 失败,请检查配置文件。");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ public class CustomStorage implements DataStorage {
|
|||||||
@Override
|
@Override
|
||||||
@TestOnly
|
@TestOnly
|
||||||
public boolean initialize() {
|
public boolean initialize() {
|
||||||
Main.serve("您选择使用自定义存储,但并没有应用成功。");
|
Main.severe("您选择使用自定义存储,但并没有应用成功。");
|
||||||
Main.serve("You are using CustomStorage, but not overwrite the methods.");
|
Main.severe("You are using CustomStorage, but not overwrite the methods.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class MySQLStorage implements DataStorage {
|
|||||||
);
|
);
|
||||||
this.sqlManager.setDebugMode(() -> Main.getInstance().isDebugging());
|
this.sqlManager.setDebugMode(() -> Main.getInstance().isDebugging());
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Main.serve("无法连接到数据库,请检查配置文件。");
|
Main.severe("无法连接到数据库,请检查配置文件。");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class MySQLStorage implements DataStorage {
|
|||||||
.build().execute();
|
.build().execute();
|
||||||
|
|
||||||
} catch (SQLException exception) {
|
} catch (SQLException exception) {
|
||||||
Main.serve("无法创建插件所需的表,请检查数据库权限。");
|
Main.severe("无法创建插件所需的表,请检查数据库权限。");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ public class MySQLStorage implements DataStorage {
|
|||||||
try {
|
try {
|
||||||
this.warpsMap = loadWarps();
|
this.warpsMap = loadWarps();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Main.serve("无法加载地标数据,请检查数据库权限和相关表。");
|
Main.severe("无法加载地标数据,请检查数据库权限和相关表。");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class JSONStorage extends FileBasedStorage {
|
|||||||
this.warpsMap = loadWarps();
|
this.warpsMap = loadWarps();
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Main.serve("无法加载地标数据,请检查文件权限和相关配置。");
|
Main.severe("无法加载地标数据,请检查文件权限和相关配置。");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ public class YAMLStorage extends FileBasedStorage {
|
|||||||
this.warpsMap = loadWarps();
|
this.warpsMap = loadWarps();
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Main.serve("无法加载地标数据,请检查文件权限和相关配置。");
|
Main.severe("无法加载地标数据,请检查文件权限和相关配置。");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,16 +18,16 @@ public class UpdateChecker {
|
|||||||
|
|
||||||
MoeTeleport.outputInfo();
|
MoeTeleport.outputInfo();
|
||||||
if (behindVersions == null) {
|
if (behindVersions == null) {
|
||||||
Main.serve("检查更新失败,请您定期查看插件是否更新,避免安全问题。");
|
Main.severe("检查更新失败,请您定期查看插件是否更新,避免安全问题。");
|
||||||
Main.serve("下载地址 " + downloadURL);
|
Main.severe("下载地址 " + downloadURL);
|
||||||
} else if (behindVersions == 0) {
|
} else if (behindVersions == 0) {
|
||||||
Main.info("检查完成,当前已是最新版本。");
|
Main.info("检查完成,当前已是最新版本。");
|
||||||
} else if (behindVersions > 0) {
|
} else if (behindVersions > 0) {
|
||||||
Main.info("发现新版本! 目前已落后 " + behindVersions + " 个版本。");
|
Main.info("发现新版本! 目前已落后 " + behindVersions + " 个版本。");
|
||||||
Main.info("最新版下载地址 " + downloadURL);
|
Main.info("最新版下载地址 " + downloadURL);
|
||||||
} else {
|
} else {
|
||||||
Main.serve("检查更新失败! 当前版本未知,请您使用原生版本以避免安全问题。");
|
Main.severe("检查更新失败! 当前版本未知,请您使用原生版本以避免安全问题。");
|
||||||
Main.serve("最新版下载地址 " + downloadURL);
|
Main.severe("最新版下载地址 " + downloadURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user