mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 13:13:24 +00:00
Removing automatic updates
It's a bad idea to automatically overwrite files, without asking the player first. This would be triggered by the selfupdate after the reload.
This commit is contained in:
parent
72596decba
commit
f6e56ce0f4
3 changed files with 0 additions and 78 deletions
|
@ -31,12 +31,6 @@ public class EssentialsUpdate extends JavaPlugin
|
|||
|
||||
if (updateCheck.isEssentialsInstalled())
|
||||
{
|
||||
final Version myVersion = new Version(getDescription().getVersion());
|
||||
if (updateCheck.getResult() == CheckResult.NEW_ESS && myVersion.equals(updateCheck.getNewVersion()))
|
||||
{
|
||||
Bukkit.getLogger().info("Versions of EssentialsUpdate and Essentials do not match. Starting automatic update.");
|
||||
updateProcess.doAutomaticUpdate();
|
||||
}
|
||||
updateCheck.scheduleUpdateTask();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package com.earth2me.essentials.update;
|
||||
|
||||
import com.earth2me.essentials.update.states.Changelog;
|
||||
import com.earth2me.essentials.update.states.EssentialsChat;
|
||||
import com.earth2me.essentials.update.states.InstallationFinishedEvent;
|
||||
import com.earth2me.essentials.update.states.StateMachine;
|
||||
import com.earth2me.essentials.update.states.UpdateOrInstallation;
|
||||
import com.earth2me.essentials.update.tasks.SelfUpdate;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -139,19 +135,6 @@ public class UpdateProcess extends PlayerListener
|
|||
}
|
||||
}
|
||||
|
||||
public void doAutomaticUpdate()
|
||||
{
|
||||
final VersionInfo info = updateCheck.getNewVersionInfo();
|
||||
final List<String> changelog = info.getChangelog();
|
||||
Bukkit.getLogger().log(Level.INFO, "Essentials changelog {0}", updateCheck.getNewVersion().toString());
|
||||
for (String line : changelog)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.INFO, " - {0}", line);
|
||||
}
|
||||
final UpdatesDownloader downloader = new UpdatesDownloader(plugin, info);
|
||||
downloader.start();
|
||||
}
|
||||
|
||||
public void onCommand(final CommandSender sender)
|
||||
{
|
||||
if (sender instanceof Player && sender.hasPermission("essentials.update"))
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
package com.earth2me.essentials.update;
|
||||
|
||||
import com.earth2me.essentials.update.tasks.InstallModule;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
public class UpdatesDownloader extends WorkListener implements Runnable
|
||||
{
|
||||
public UpdatesDownloader(final Plugin plugin, final VersionInfo newVersionInfo)
|
||||
{
|
||||
super(plugin, newVersionInfo);
|
||||
}
|
||||
|
||||
public void start()
|
||||
{
|
||||
iterator = getNewVersionInfo().getModules().entrySet().iterator();
|
||||
Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), this);
|
||||
}
|
||||
private transient Iterator<Entry<String, ModuleInfo>> iterator;
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (iterator.hasNext())
|
||||
{
|
||||
final Entry<String, ModuleInfo> entry = iterator.next();
|
||||
final Plugin plugin = Bukkit.getPluginManager().getPlugin(entry.getKey());
|
||||
if (plugin == null)
|
||||
{
|
||||
run();
|
||||
}
|
||||
else
|
||||
{
|
||||
new InstallModule(this, entry.getKey()).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorkAbort(final String message)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.SEVERE, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorkDone(final String message)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.INFO, message);
|
||||
Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue