mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-11-22 14:28:46 +00:00
add auto update repo while onEnable...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
parent
88cec09019
commit
38f1a66465
@ -59,6 +59,7 @@ public class Yum extends JavaPlugin {
|
|||||||
this.initCommands();
|
this.initCommands();
|
||||||
yumgr = new YumManager(this);
|
yumgr = new YumManager(this);
|
||||||
YumManager.repo.jsonToCache(config);
|
YumManager.repo.jsonToCache(config);
|
||||||
|
YumManager.updaterepo();
|
||||||
new VersionChecker(this);
|
new VersionChecker(this);
|
||||||
try {
|
try {
|
||||||
final Metrics metrics = new Metrics(this);
|
final Metrics metrics = new Metrics(this);
|
||||||
|
@ -18,10 +18,10 @@ public class YumManager {
|
|||||||
public static PluginsManager plugman;
|
public static PluginsManager plugman;
|
||||||
public static RepositoryManager repo;
|
public static RepositoryManager repo;
|
||||||
|
|
||||||
Plugin plugin;
|
protected static Plugin plugin;
|
||||||
|
|
||||||
public YumManager(final Plugin plugin) {
|
public YumManager(final Plugin plugin) {
|
||||||
this.plugin = plugin;
|
YumManager.plugin = plugin;
|
||||||
plugman = new PluginsManager(plugin);
|
plugman = new PluginsManager(plugin);
|
||||||
download = new DownloadManager(plugin);
|
download = new DownloadManager(plugin);
|
||||||
repo = new RepositoryManager(plugin);
|
repo = new RepositoryManager(plugin);
|
||||||
@ -65,4 +65,13 @@ public class YumManager {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void updaterepo() {
|
||||||
|
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
repo.updateRepositories(Bukkit.getConsoleSender());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user