mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 19:15:44 +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())
|
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();
|
updateCheck.scheduleUpdateTask();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
package com.earth2me.essentials.update;
|
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.InstallationFinishedEvent;
|
||||||
import com.earth2me.essentials.update.states.StateMachine;
|
import com.earth2me.essentials.update.states.StateMachine;
|
||||||
import com.earth2me.essentials.update.states.UpdateOrInstallation;
|
|
||||||
import com.earth2me.essentials.update.tasks.SelfUpdate;
|
import com.earth2me.essentials.update.tasks.SelfUpdate;
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
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)
|
public void onCommand(final CommandSender sender)
|
||||||
{
|
{
|
||||||
if (sender instanceof Player && sender.hasPermission("essentials.update"))
|
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…
Add table
Add a link
Reference in a new issue