From deeedcd40814a420d0b83c9fedce3528e8d04868 Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Sun, 20 Nov 2022 20:17:43 +0100 Subject: [PATCH] 13.6 --- pom.xml | 2 +- .../SPIGOT/api/update/T2CupdateAPI.java | 10 ++++++++++ .../SPIGOT/system/cmd/CreateReportLog.java | 17 ++++++++--------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index db7eed3..4ef502f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.t2code T2CodeLib - 13.5 + 13.6 jar T2CodeLib diff --git a/src/main/java/net/t2code/t2codelib/SPIGOT/api/update/T2CupdateAPI.java b/src/main/java/net/t2code/t2codelib/SPIGOT/api/update/T2CupdateAPI.java index 10fa05c..9b616e1 100644 --- a/src/main/java/net/t2code/t2codelib/SPIGOT/api/update/T2CupdateAPI.java +++ b/src/main/java/net/t2code/t2codelib/SPIGOT/api/update/T2CupdateAPI.java @@ -5,6 +5,7 @@ import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain; import net.t2code.t2codelib.UpdateType; import net.t2code.t2codelib.T2CupdateObject; import net.t2code.t2codelib.T2CupdateWebData; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; @@ -16,6 +17,15 @@ public class T2CupdateAPI { public static HashMap pluginVersions = new HashMap<>(); public static void join(Plugin plugin, String prefix, String perm, Player player, Integer spigotID, String discord) { + if (pluginVersions.get(plugin.getName()) == null){ + Bukkit.getScheduler().runTaskLaterAsynchronously(T2CodeLibMain.getPlugin(), new Runnable() { + @Override + public void run() { + join(plugin,prefix,perm,player,spigotID,discord); + } + },2*20L); + } + if (!pluginVersions.get(plugin.getName()).updateCheckOnJoin) { return; } diff --git a/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/CreateReportLog.java b/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/CreateReportLog.java index d5cfc56..acc1203 100644 --- a/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/CreateReportLog.java +++ b/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/CreateReportLog.java @@ -143,15 +143,14 @@ public class CreateReportLog { file.delete(); File zipFile = new File(zipPath); - if (!confirmUpload){ - if (sender instanceof Player) { - T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath); - } - T2Csend.console(Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath); - - Files.move(Paths.get(zipPath),Paths.get(directory+"/"+zipFile.getName())); - zipFile.delete(); + if (!confirmUpload) { + Files.move(Paths.get(zipPath), Paths.get(directory + "/" + zipFile.getName())); + zipFile.delete(); directoryTemp.delete(); + if (sender instanceof Player) { + T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + directory + "/" + zipFile.getName()); + } + T2Csend.console(Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + directory + "/" + zipFile.getName()); return; } @@ -179,7 +178,7 @@ public class CreateReportLog { "
[prefix] Do not share the download URL with anyone!" + "
Click to delete'>[prefix] You can delte yor Debug-File by clicking me." + "
[prefix] (If you do not delete the debug file, it will be deleted automatically after 14 days!)") - .replace("[key]", fileID).replace("[url]", downloadURL).replace("[prefix]",Util.getPrefix())); + .replace("[key]", fileID).replace("[url]", downloadURL).replace("[prefix]", Util.getPrefix())); } T2Csend.console(Util.getPrefix() + (" A DebugLog zip has been created. You can download it here: [url]" + "
Please enter the following key in the ticket: [key]." +