Close plugins internally when reloading them instead of externally
This commit is contained in:
parent
a0e0072f12
commit
4b6008299b
6 changed files with 23 additions and 26 deletions
|
|
@ -15,9 +15,9 @@ public abstract class AbstractPluginManager<T> extends PluginProvider<T> {
|
|||
|
||||
public abstract Result enablePlugin(T plugin);
|
||||
|
||||
public abstract CloseableResult reloadPlugin(String pluginName);
|
||||
public abstract Result reloadPlugin(String pluginName);
|
||||
|
||||
public abstract CloseableResult reloadPlugin(T plugin);
|
||||
public abstract Result reloadPlugin(T plugin);
|
||||
|
||||
public abstract CloseableResult unloadPlugin(String pluginName);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import net.frankheijden.serverutils.common.ServerUtilsApp;
|
|||
import net.frankheijden.serverutils.common.config.Config;
|
||||
import net.frankheijden.serverutils.common.config.Messenger;
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
import net.frankheijden.serverutils.common.entities.CloseableResult;
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin;
|
||||
import net.frankheijden.serverutils.common.managers.AbstractVersionManager;
|
||||
|
|
@ -181,9 +180,8 @@ public class UpdateCheckerTask implements Runnable {
|
|||
|
||||
if (isStartupCheck()) {
|
||||
plugin.getLogger().info(String.format(DOWNLOADED_RESTART, downloadedVersion));
|
||||
CloseableResult result = plugin.getPluginManager().reloadPlugin((Object)ServerUtilsApp.getPlatformPlugin());
|
||||
plugin.getPluginManager().reloadPlugin((Object)ServerUtilsApp.getPlatformPlugin());
|
||||
plugin.getLogger().info(String.format(UPGRADE_SUCCESS, downloadedVersion));
|
||||
result.tryClose();
|
||||
} else {
|
||||
broadcastDownloadStatus(downloadedVersion, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue