Add siumpler alias updatepl

This commit is contained in:
libraryaddict 2020-11-02 04:20:14 +13:00
parent 32b5700562
commit 6530408282

View File

@ -27,7 +27,7 @@ public class LDUpdateProtocolLib implements LDCommand {
@Override @Override
public List<String> getTabComplete() { public List<String> getTabComplete() {
return Arrays.asList("updateprotocollib"); return Arrays.asList("updateprotocollib", "updatepl");
} }
@Override @Override
@ -61,8 +61,9 @@ public class LDUpdateProtocolLib implements LDCommand {
File dest = new File("plugins/update/" + theirFile.getName()); File dest = new File("plugins/update/" + theirFile.getName());
// We're connecting to spigot's API // We're connecting to spigot's API
URL url = new URL( URL url =
"https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/target/ProtocolLib" + new URL("https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/target" +
"/ProtocolLib" +
".jar"); ".jar");
// Creating a connection // Creating a connection
HttpURLConnection con = (HttpURLConnection) url.openConnection(); HttpURLConnection con = (HttpURLConnection) url.openConnection();
@ -79,8 +80,7 @@ public class LDUpdateProtocolLib implements LDCommand {
sender.sendMessage(ChatColor.RED + "Update success! Restart server to finish update!"); sender.sendMessage(ChatColor.RED + "Update success! Restart server to finish update!");
} }
}.runTask(LibsDisguises.getInstance()); }.runTask(LibsDisguises.getInstance());
} } catch (Exception ex) {
catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
new BukkitRunnable() { new BukkitRunnable() {
@ -89,8 +89,7 @@ public class LDUpdateProtocolLib implements LDCommand {
sender.sendMessage(ChatColor.RED + "Update failed, " + ex.getMessage()); sender.sendMessage(ChatColor.RED + "Update failed, " + ex.getMessage());
} }
}.runTask(LibsDisguises.getInstance()); }.runTask(LibsDisguises.getInstance());
} } finally {
finally {
updateInProgress.set(false); updateInProgress.set(false);
} }
} }