68 lines
2.4 KiB
Java
68 lines
2.4 KiB
Java
package net.t2code.t2codelib.BUNGEE.api.messages;
|
|
|
|
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;
|
|
import net.t2code.t2codelib.BUNGEE.system.T2CodeBMain;
|
|
|
|
import java.util.logging.Level;
|
|
|
|
public class T2CBsend {
|
|
public static void console(String msg) {
|
|
if (T2CodeBMain.getMmIsLoad() && T2CodeBMain.getMmIsLoad()) {
|
|
T2CBminiMessage.sendConsoleMiniMessage(msg);
|
|
} else ProxyServer.getInstance().getConsole().sendMessage(msg);
|
|
}
|
|
|
|
public static void player(ProxiedPlayer player, String msg) {
|
|
if (T2CodeBMain.getMmIsLoad()&& T2CodeBMain.getMmIsLoad()) {
|
|
T2CBminiMessage.sendPlayerMiniMessage(msg, player);
|
|
} else player.sendMessage(msg);
|
|
}
|
|
|
|
public static void title(ProxiedPlayer player, Title msg) {
|
|
player.sendTitle(msg);
|
|
}
|
|
|
|
public static void sender(CommandSender sender, String msg) {
|
|
if (T2CodeBMain.getMmIsLoad()&& T2CodeBMain.getMmIsLoad()) {
|
|
T2CBminiMessage.sendSenderMiniMessage(msg, sender);
|
|
} else sender.sendMessage(msg);
|
|
}
|
|
|
|
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")) {
|
|
// 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);
|
|
//}
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|