/**
* Loads all of the startup commands from the plugin's configuration file.
* @param plugin the StartupCommands plugin instance
*/
public static void loadCommands(StartupCommands plugin) {
FileConfiguration config = plugin.getConfig();
if (config.getConfigurationSection("commands") == null) {
plugin.getLogger().info("There are no startup commands present.");
} else {
int delay = 0;
for (String command : config.getConfigurationSection("commands").getKeys(false)) {
delay = config.getInt("commands." + command + ".delay", 0);
// Try to create the command
try {
plugin.getCommands().add(new Command(command, delay));
} catch (IllegalArgumentException e) {
plugin.getLogger().severe(e.getMessage());
}
}
}
}
Command.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:StartupCommands
作者:
评论列表
文章目录