Made plugin updating async
This commit is contained in:
parent
596c929ace
commit
854ba613b5
1 changed files with 9 additions and 6 deletions
|
@ -1,7 +1,9 @@
|
||||||
package buttondevteam.chat.commands.ucmds.admin;
|
package buttondevteam.chat.commands.ucmds.admin;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import buttondevteam.bucket.core.TBMCCoreAPI;
|
import buttondevteam.bucket.core.TBMCCoreAPI;
|
||||||
|
import buttondevteam.chat.PluginMain;
|
||||||
|
|
||||||
public class UpdatePlugin extends AdminCommandBase {
|
public class UpdatePlugin extends AdminCommandBase {
|
||||||
|
|
||||||
|
@ -27,12 +29,13 @@ public class UpdatePlugin extends AdminCommandBase {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("Updating plugin...");
|
sender.sendMessage("Updating plugin...");
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(PluginMain.Instance, () -> {
|
||||||
String ret = "";
|
String ret = "";
|
||||||
if ((ret = TBMCCoreAPI.UpdatePlugin(args[0])).length() > 0) {
|
if ((ret = TBMCCoreAPI.UpdatePlugin(args[0])).length() > 0) {
|
||||||
sender.sendMessage(ret);
|
sender.sendMessage(ret);
|
||||||
return true;
|
} else
|
||||||
}
|
|
||||||
sender.sendMessage("Updating done!");
|
sender.sendMessage("Updating done!");
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue