2022-10-25 13:03:07 +00:00
|
|
|
package net.t2code.t2codelib.BUNGEE.api.messages;
|
2021-11-28 01:13:21 +00:00
|
|
|
|
|
|
|
import net.md_5.bungee.api.CommandSender;
|
|
|
|
import net.md_5.bungee.api.ProxyServer;
|
|
|
|
import net.md_5.bungee.api.Title;
|
|
|
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
|
|
import net.md_5.bungee.api.plugin.Plugin;
|
2022-11-14 17:45:54 +00:00
|
|
|
import net.t2code.t2codelib.BUNGEE.system.T2CodeBMain;
|
2021-11-28 01:13:21 +00:00
|
|
|
|
|
|
|
import java.util.logging.Level;
|
|
|
|
|
2022-10-25 13:03:07 +00:00
|
|
|
public class T2CBsend {
|
2021-11-28 01:13:21 +00:00
|
|
|
public static void console(String msg) {
|
2022-12-22 00:43:40 +00:00
|
|
|
if (T2CodeBMain.getMmIsLoad() && T2CodeBMain.getMmIsLoad()) {
|
2022-11-14 17:45:54 +00:00
|
|
|
T2CBminiMessage.sendConsoleMiniMessage(msg);
|
|
|
|
} else ProxyServer.getInstance().getConsole().sendMessage(msg);
|
2021-11-28 01:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void player(ProxiedPlayer player, String msg) {
|
2022-12-22 00:43:40 +00:00
|
|
|
if (T2CodeBMain.getMmIsLoad()&& T2CodeBMain.getMmIsLoad()) {
|
2022-11-14 17:45:54 +00:00
|
|
|
T2CBminiMessage.sendPlayerMiniMessage(msg, player);
|
|
|
|
} else player.sendMessage(msg);
|
2021-11-28 01:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void title(ProxiedPlayer player, Title msg) {
|
|
|
|
player.sendTitle(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void sender(CommandSender sender, String msg) {
|
2022-12-22 00:43:40 +00:00
|
|
|
if (T2CodeBMain.getMmIsLoad()&& T2CodeBMain.getMmIsLoad()) {
|
2022-11-14 17:45:54 +00:00
|
|
|
T2CBminiMessage.sendSenderMiniMessage(msg, sender);
|
|
|
|
} else sender.sendMessage(msg);
|
2021-11-28 01:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2022-11-14 17:45:54 +00:00
|
|
|
// if (stage == null) {
|
|
|
|
// if (plugin.getConfig().getBoolean("Plugin.Debug")) {
|
|
|
|
// ProxyServer.getInstance().getConsole().sendMessage(plugin.getDescription().getName() + " §5DEBUG: §6" + msg);
|
|
|
|
// }
|
|
|
|
// return;
|
|
|
|
//}
|
|
|
|
//if (plugin.getConfig().getInt("Plugin.Debug") >= stage) {
|
|
|
|
// ProxyServer.getInstance().getConsole().sendMessage(plugin.getDescription().getName() + " §5DEBUG: §6" + msg);
|
|
|
|
//}
|
2021-11-28 01:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void debugmsg(Plugin plugin, String msg) {
|
|
|
|
ProxyServer.getInstance().getConsole().sendMessage(plugin.getDescription().getName() + " §5DEBUG-MSG: §6" + msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void info(Plugin plugin, String msg) {
|
|
|
|
plugin.getLogger().log(Level.INFO, msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void warning(Plugin plugin, String msg) {
|
|
|
|
plugin.getLogger().log(Level.WARNING, msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void error(Plugin plugin, String msg) {
|
|
|
|
plugin.getLogger().log(Level.SEVERE, msg);
|
|
|
|
}
|
|
|
|
}
|