72 lines
2.4 KiB
Java
72 lines
2.4 KiB
Java
package net.t2code.lib.Spigot.Lib.messages;
|
|
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
import java.util.logging.Level;
|
|
|
|
public class send {
|
|
|
|
/**
|
|
* Spigot
|
|
*/
|
|
|
|
public static void console(String msg) {
|
|
if (msg == null || msg.contains("[empty]")) return;
|
|
Bukkit.getConsoleSender().sendMessage(msg);
|
|
}
|
|
|
|
public static void player(Player player, String msg) {
|
|
if (msg == null || msg.contains("[empty]")) return;
|
|
HoverModule.module(msg,player);
|
|
}
|
|
|
|
public static void title(Player player, String msg, String msg2) {
|
|
if (msg == null || msg.contains("[empty]")) return;
|
|
if (msg2 == null || msg2.contains("[empty]")) return;
|
|
player.sendTitle(msg, msg2);
|
|
}
|
|
|
|
public static void title(Player player, String msg, String msg2, int i, int i1, int i2) {
|
|
if (msg == null || msg.contains("[empty]")) return;
|
|
if (msg2 == null || msg2.contains("[empty]")) return;
|
|
player.sendTitle(msg, msg2, i, i1, i2);
|
|
}
|
|
|
|
public static void sender(CommandSender sender, String msg) {
|
|
if (msg == null || msg.contains("[empty]")) return;
|
|
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")) Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
|
|
return;
|
|
}
|
|
if (plugin.getConfig().getInt("Plugin.Debug") >= stage) Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
|
|
}
|
|
|
|
public static void debugmsg(Plugin plugin, String msg) {
|
|
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §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);
|
|
}
|
|
}
|