diff --git a/out/artifacts/EaglerPluginInstaller_jar/EaglerPluginInstaller.jar b/out/artifacts/EaglerPluginInstaller_jar/EaglerPluginInstaller.jar index effefad..1be764f 100644 Binary files a/out/artifacts/EaglerPluginInstaller_jar/EaglerPluginInstaller.jar and b/out/artifacts/EaglerPluginInstaller_jar/EaglerPluginInstaller.jar differ diff --git a/src/main/java/tech/nully/PluginInstaller/InstallCommand.java b/src/main/java/tech/nully/PluginInstaller/InstallCommand.java index 1ecdc61..6ac6594 100644 --- a/src/main/java/tech/nully/PluginInstaller/InstallCommand.java +++ b/src/main/java/tech/nully/PluginInstaller/InstallCommand.java @@ -35,14 +35,14 @@ public class InstallCommand implements CommandExecutor { try (InputStream in = plugin.openStream()) { // 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!"); return true; } catch (IOException e) {} } else if (Install_Jar.equalsIgnoreCase("recommended")) { InputStream reco1 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/dupepatch.jar") .toURL().openStream(); - ins.InstallPlugin(reco1, "DupePatch", snder); + ins.InstallPlugin(reco1, "DupePatch"); } } catch (IOException e) { snder.sendMessage("\"" + Install_Jar + "\"" + "is not a valid plugin from the database"); diff --git a/src/main/java/tech/nully/PluginInstaller/Installer.java b/src/main/java/tech/nully/PluginInstaller/Installer.java index ea61a12..f2dca4a 100644 --- a/src/main/java/tech/nully/PluginInstaller/Installer.java +++ b/src/main/java/tech/nully/PluginInstaller/Installer.java @@ -16,7 +16,7 @@ import java.util.HashMap; 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"); 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") .toURL().openStream(); System.out.println("Check 3 passed"); - Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) {} + Installer ins = new Installer(); + ins.InstallPlugin(in, "EaglerPluginUpdater"); + } catch (IOException e) { + System.out.println("Invalid Link"); + } } } } diff --git a/target/classes/tech/nully/PluginInstaller/InstallCommand.class b/target/classes/tech/nully/PluginInstaller/InstallCommand.class index 666f54c..37f89d4 100644 Binary files a/target/classes/tech/nully/PluginInstaller/InstallCommand.class and b/target/classes/tech/nully/PluginInstaller/InstallCommand.class differ diff --git a/target/classes/tech/nully/PluginInstaller/Installer.class b/target/classes/tech/nully/PluginInstaller/Installer.class index 1d59703..e9f5cf4 100644 Binary files a/target/classes/tech/nully/PluginInstaller/Installer.class and b/target/classes/tech/nully/PluginInstaller/Installer.class differ