mirror of
https://github.com/darverdevs/PluginInstaller.git
synced 2024-11-24 18:26:04 -08:00
bug fixes
This commit is contained in:
parent
214734c519
commit
aa0407ae2e
Binary file not shown.
|
@ -35,14 +35,14 @@ public class InstallCommand implements CommandExecutor {
|
||||||
try (InputStream in = plugin.openStream()) {
|
try (InputStream in = plugin.openStream()) {
|
||||||
|
|
||||||
// Installs the plugin
|
// Installs the plugin
|
||||||
ins.InstallPlugin(in, Install_Jar.toLowerCase(), snder);
|
ins.InstallPlugin(in, Install_Jar.toLowerCase());
|
||||||
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + Install_Jar.toUpperCase() + ChatColor.WHITE + " plugin!");
|
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + Install_Jar.toUpperCase() + ChatColor.WHITE + " plugin!");
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
} else if (Install_Jar.equalsIgnoreCase("recommended")) {
|
} else if (Install_Jar.equalsIgnoreCase("recommended")) {
|
||||||
InputStream reco1 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/dupepatch.jar")
|
InputStream reco1 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/dupepatch.jar")
|
||||||
.toURL().openStream();
|
.toURL().openStream();
|
||||||
ins.InstallPlugin(reco1, "DupePatch", snder);
|
ins.InstallPlugin(reco1, "DupePatch");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
snder.sendMessage("\"" + Install_Jar + "\"" + "is not a valid plugin from the database");
|
snder.sendMessage("\"" + Install_Jar + "\"" + "is not a valid plugin from the database");
|
||||||
|
|
|
@ -16,7 +16,7 @@ import java.util.HashMap;
|
||||||
|
|
||||||
public class Installer {
|
public class Installer {
|
||||||
|
|
||||||
public void InstallPlugin(InputStream in, String pluginName, CommandSender s) throws IOException {
|
public void InstallPlugin(InputStream in, String pluginName) throws IOException {
|
||||||
File f = new File(Main.getInstance().getDataFolder().getParent() + "/" + pluginName + ".jar");
|
File f = new File(Main.getInstance().getDataFolder().getParent() + "/" + pluginName + ".jar");
|
||||||
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,11 @@ public class Installer {
|
||||||
InputStream in = URI.create("https://github.com/darverdevs/EaglerPluginUpdater/raw/main/out/artifacts/EaglerPluginUpdater_jar/EaglerPluginUpdater.jar")
|
InputStream in = URI.create("https://github.com/darverdevs/EaglerPluginUpdater/raw/main/out/artifacts/EaglerPluginUpdater_jar/EaglerPluginUpdater.jar")
|
||||||
.toURL().openStream();
|
.toURL().openStream();
|
||||||
System.out.println("Check 3 passed");
|
System.out.println("Check 3 passed");
|
||||||
Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
Installer ins = new Installer();
|
||||||
} catch (IOException e) {}
|
ins.InstallPlugin(in, "EaglerPluginUpdater");
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("Invalid Link");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user