T2Csend.debug() -> T2Cdebug.debug() / add T2Cdebug.debugCode()

This commit is contained in:
JaTiTV 2023-04-23 12:30:56 +02:00
parent 65ff4ee24a
commit 3aee76ddb8
2 changed files with 40 additions and 13 deletions

View File

@ -0,0 +1,37 @@
package net.t2code.t2codelib.SPIGOT.api.debug;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import java.util.UUID;
public class T2Cdebug {
public static void debug(Plugin plugin, String msg) {
debug(plugin, msg, null);
}
public static void debug(Plugin plugin, String msg, Integer stage) {
// if (!new File(Main.getPath(), "config.yml").exists()) return;
if (stage == null) {
if (plugin.getConfig().getBoolean("Plugin.Debug") || plugin.getConfig().getBoolean("plugin.debug") || plugin.getConfig().getBoolean("Debug") || plugin.getConfig().getBoolean("debug")){
T2Csend.info(plugin, "");
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
}
return;
}
if (plugin.getConfig().getInt("Plugin.Debug") >= stage || plugin.getConfig().getInt("plugin.debug") >= stage || plugin.getConfig().getInt("Debug") >= stage || plugin.getConfig().getInt("debug") >= stage) {
T2Csend.info(plugin, "");
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
}
}
public static void debugmsg(Plugin plugin, String msg) {
T2Csend.warning(plugin, "");
Bukkit.getConsoleSender().sendMessage("§e[" + plugin.getDescription().getPrefix() + "] §5DEBUG-MSG: §6" + msg);
}
public static String debugCode(){
return UUID.randomUUID().toString().substring(0,7);
}
}

View File

@ -1,5 +1,6 @@
package net.t2code.t2codelib.SPIGOT.api.messages; package net.t2code.t2codelib.SPIGOT.api.messages;
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -61,22 +62,11 @@ public class T2Csend {
public static void debug(Plugin plugin, String msg, Integer stage) { public static void debug(Plugin plugin, String msg, Integer stage) {
// if (!new File(Main.getPath(), "config.yml").exists()) return; // if (!new File(Main.getPath(), "config.yml").exists()) return;
if (stage == null) { T2Cdebug.debug(plugin, msg, stage);
if (plugin.getConfig().getBoolean("Plugin.Debug") || plugin.getConfig().getBoolean("plugin.debug") || plugin.getConfig().getBoolean("Debug") || plugin.getConfig().getBoolean("debug")){
info(plugin, "");
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
}
return;
}
if (plugin.getConfig().getInt("Plugin.Debug") >= stage || plugin.getConfig().getInt("plugin.debug") >= stage || plugin.getConfig().getInt("Debug") >= stage || plugin.getConfig().getInt("debug") >= stage) {
info(plugin, "");
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
}
} }
public static void debugmsg(Plugin plugin, String msg) { public static void debugmsg(Plugin plugin, String msg) {
warning(plugin, ""); T2Cdebug.debugmsg(plugin, msg);
Bukkit.getConsoleSender().sendMessage("§e[" + plugin.getDescription().getPrefix() + "] §5DEBUG-MSG: §6" + msg);
} }
public static void info(Plugin plugin, String msg) { public static void info(Plugin plugin, String msg) {