This commit is contained in:
Luna 2022-07-11 13:20:16 -03:00
parent 7f5e706d5e
commit 9665017efc
3 changed files with 21 additions and 21 deletions

View File

@ -162,11 +162,11 @@ public class Plex extends PlexPlugin implements PlexApiProvider
this.setPermissionHandler(new NativePermissionHandler());
}
if (config.getBoolean("enable-updates"))
{
updateChecker = new UpdateChecker();
PlexLog.log("Update checking enabled");
}
if (config.getBoolean("enable-updates"))
{
updateChecker = new UpdateChecker();
PlexLog.log("Update checking enabled");
}
// https://bstats.org/plugin/bukkit/Plex/14143
Metrics metrics = new Metrics(this, 14143);

View File

@ -39,10 +39,10 @@ public class PlexCMD extends PlexCommand
send(sender, mmString("<light_purple>Authors: <gold>Telesphoreo, Taahh"));
send(sender, mmString("<light_purple>Built by: <gold>" + BuildInfo.getAuthor() + " <light_purple>on <gold>" + BuildInfo.getDate()));
send(sender, mmString("<light_purple>Run <gold>/plex modules <light_purple>to see a list of modules."));
if (plugin.config.getBoolean("enable-updates"))
{
plugin.getUpdateChecker().getUpdateStatusMessage(sender, true, 2);
}
if (plugin.config.getBoolean("enable-updates"))
{
plugin.getUpdateChecker().getUpdateStatusMessage(sender, true, 2);
}
return null;
}
if (args[0].equalsIgnoreCase("reload"))
@ -103,10 +103,10 @@ public class PlexCMD extends PlexCommand
{
return messageComponent("noPermissionRank", "an Owner or Developer");
}
if (!plugin.getConfig().getBoolean("enable-updates"))
{
return mmString("<red>Updating has been disabled in the config.");
}
if (!plugin.getConfig().getBoolean("enable-updates"))
{
return mmString("<red>Updating has been disabled in the config.");
}
for (PlexModule module : plugin.getModuleManager().getModules())
{
plugin.getUpdateChecker().updateJar(sender, module.getPlexModuleFile().getName(), true);
@ -121,10 +121,10 @@ public class PlexCMD extends PlexCommand
{
return messageComponent("noPermissionRank", "an Owner or Developer");
}
if (!plugin.getConfig().getBoolean("enable-updates"))
{
return mmString("<red>Updating has been disabled in the config.");
}
if (!plugin.getConfig().getBoolean("enable-updates"))
{
return mmString("<red>Updating has been disabled in the config.");
}
if (!plugin.getUpdateChecker().getUpdateStatusMessage(sender, false, 0))
{
return mmString("<red>Plex is already up to date!");

View File

@ -25,10 +25,10 @@ public class ServiceManager implements PlexBase
registerService(new GameRuleService());
registerService(new TimingService());
if (plugin.config.getBoolean("enable-updates"))
{
registerService(new UpdateCheckerService());
}
if (plugin.config.getBoolean("enable-updates"))
{
registerService(new UpdateCheckerService());
}
}
public void startServices()