mirror of
https://github.com/darverdevs/PluginInstaller.git
synced 2024-11-22 01:06:06 -08:00
changed to adapt to PluginUpdater
This commit is contained in:
parent
fbc88b0737
commit
7f17ebd863
|
@ -29,11 +29,13 @@ public class Installer {
|
||||||
return huc.getResponseCode() == 200;
|
return huc.getResponseCode() == 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdatePlugin() throws IOException {
|
public static void InstallUpdater() throws IOException {
|
||||||
InputStream in = URI.create("https://github.com/darverdevs/PluginInstaller/raw/main/out/artifacts/PluginInstaller_jar/PluginInstaller.jar")
|
File file = new File(Main.getInstance().getDataFolder().getParent() + "/PluginUpdater.jar");
|
||||||
.toURL().openStream();
|
if (!(file.exists())) {
|
||||||
File f = new File(Main.getInstance().getDataFolder().getParent() + "/" + "PluginInstaller" + ".jar");
|
URL plugin = URI.create("https://github.com/darverdevs/PluginInstaller/tree/Updater/out/artifacts/PluginUpdater_jar")
|
||||||
f.delete();
|
.toURL();
|
||||||
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
InputStream in = plugin.openStream();
|
||||||
|
Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,7 @@ public class Main extends JavaPlugin {
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
instance = this;
|
||||||
try {
|
try {
|
||||||
Installer.UpdatePlugin();
|
Installer.InstallUpdater();
|
||||||
System.out.println(ChatColor.AQUA + "PluginInstaller has been udpated");
|
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
getCommand("install").setExecutor(new InstallCommand());
|
getCommand("install").setExecutor(new InstallCommand());
|
||||||
getCommand("plist").setExecutor(new plistCommand());
|
getCommand("plist").setExecutor(new plistCommand());
|
||||||
|
|
|
@ -2,6 +2,7 @@ name: EaglerPluginInstaller
|
||||||
version: 1.0.8
|
version: 1.0.8
|
||||||
main: tech.nully.PluginInstaller.Main
|
main: tech.nully.PluginInstaller.Main
|
||||||
prefix: [PluginInstaller]
|
prefix: [PluginInstaller]
|
||||||
|
loadbefore: [PluginUpdater]
|
||||||
authors: [BongoCat]
|
authors: [BongoCat]
|
||||||
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft
|
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft
|
||||||
website: nully.tech
|
website: nully.tech
|
||||||
|
|
Loading…
Reference in New Issue
Block a user