From 5857e0269500e9e9a71b3faedec12de18fa777b4 Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Mon, 14 Nov 2022 14:16:46 +0100 Subject: [PATCH] small fix --- .../SPIGOT/system/cmd/CreateReportLog.java | 14 +++++++++----- .../SPIGOT/system/cmd/ReportLogStorage.java | 13 +++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) 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 0410c69..127a13b 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 @@ -149,12 +149,16 @@ public class CreateReportLog { String fileType = obj.getString("fileType"); Integer fileSize = obj.getInt("size"); zipFile.delete(); - directory.delete(); if (sender instanceof Player) { - T2Csend.sender(sender, Util.getPrefix() + "A DebugLog zip has been created. You can download it Download the debug file'>here. Please enter the following key in the ticket: Copy to clipboard'>[key]
Do not share the download URL with anyone!
You can delte yor Debug-File by clicking me.".replace("[key]",fileID).replace("[url]",downloadURL)); - T2Csend.console(Util.getPrefix() + " §6A DebugLog zip has been created. You can download it here: url.\n§6Please enter the following key in the ticket: §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog key.".replace("[key]",fileID).replace("url",downloadURL)); - } else T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. You can download it here: url.\n§6Please enter the following key in the ticket: §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog key.".replace("[key]",fileID).replace("url",downloadURL)); - + T2Csend.sender(sender, Util.getPrefix() + ("A DebugLog zip has been created. You can download it " + + "Download the debug file'>here. Please enter the following key " + + "in the ticket: Copy to clipboard'>[key]" + + "
Do not share the download URL with anyone!
" + + "You can delte yor Debug-File by clicking me.").replace("[key]",fileID).replace("[url]",downloadURL)); + } + T2Csend.console(Util.getPrefix() + (" §6A DebugLog zip has been created. You can download it here: [url].\n§6Please enter the following key in the ticket:" + + " §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog [key].") + .replace("[key]",fileID).replace("[url]",downloadURL)); ReportLogStorage.add(fileID); } diff --git a/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/ReportLogStorage.java b/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/ReportLogStorage.java index f99d53d..55df04a 100644 --- a/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/ReportLogStorage.java +++ b/src/main/java/net/t2code/t2codelib/SPIGOT/system/cmd/ReportLogStorage.java @@ -2,6 +2,7 @@ package net.t2code.t2codelib.SPIGOT.system.cmd; import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain; import org.bukkit.configuration.file.YamlConfiguration; + import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -10,22 +11,22 @@ import java.util.List; public class ReportLogStorage { public static List list = new ArrayList<>(); - protected static File config = new File(T2CodeLibMain.getPath(),"T2CodeReportKeys.yml"); + protected static File config = new File(T2CodeLibMain.getPath(), "/DebugLogs/T2CodeReportKeys.yml"); protected static YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config); - public static void add(String key){ + public static void add(String key) { list.add(key); save(); } - public static void remove(String key){ + public static void remove(String key) { list.remove(key); save(); } - public static void save(){ + public static void save() { if (list == null) return; - yamlConfiguration.set("Keys",list); + yamlConfiguration.set("Keys", list); try { yamlConfiguration.save(config); @@ -34,7 +35,7 @@ public class ReportLogStorage { } } - public static void load(){ + public static void load() { if (!config.exists()) return; list = yamlConfiguration.getStringList("Keys"); }