mirror of
https://github.com/plexusorg/Plex.git
synced 2025-01-09 08:47:37 +00:00
remove argument-less updateJar
This commit is contained in:
parent
a43072cd1d
commit
6e149d07c6
@ -135,22 +135,10 @@ public class UpdateChecker extends PlexBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateJar()
|
private void sendMini(CommandSender sender, String message)
|
||||||
{
|
|
||||||
updateJar(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendOrLog(CommandSender sender, String message)
|
|
||||||
{
|
|
||||||
if (sender == null)
|
|
||||||
{
|
|
||||||
PlexLog.log(message);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
sender.sendMessage(MiniMessage.miniMessage().deserialize(message));
|
sender.sendMessage(MiniMessage.miniMessage().deserialize(message));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void updateJar(CommandSender sender)
|
public void updateJar(CommandSender sender)
|
||||||
{
|
{
|
||||||
@ -162,7 +150,7 @@ public class UpdateChecker extends PlexBase
|
|||||||
JSONObject object = new JSONObject(EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8));
|
JSONObject object = new JSONObject(EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8));
|
||||||
JSONObject artifact = object.getJSONArray("artifacts").getJSONObject(0);
|
JSONObject artifact = object.getJSONArray("artifacts").getJSONObject(0);
|
||||||
String name = artifact.getString("fileName");
|
String name = artifact.getString("fileName");
|
||||||
sendOrLog(sender, "Downloading latest Plex jar file: " + name);
|
sendMini(sender, "Downloading latest Plex jar file: " + name);
|
||||||
CompletableFuture.runAsync(() ->
|
CompletableFuture.runAsync(() ->
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -171,7 +159,7 @@ public class UpdateChecker extends PlexBase
|
|||||||
new URL(DOWNLOAD_PAGE + "job/master/lastSuccessfulBuild/artifact/build/libs/" + name),
|
new URL(DOWNLOAD_PAGE + "job/master/lastSuccessfulBuild/artifact/build/libs/" + name),
|
||||||
new File(Bukkit.getUpdateFolderFile(), name)
|
new File(Bukkit.getUpdateFolderFile(), name)
|
||||||
);
|
);
|
||||||
sendOrLog(sender, "Saved new jar. Please restart your server.");
|
sendMini(sender, "Saved new jar. Please restart your server.");
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user