T2CodeLib/src/main/java/net/t2code/t2codelib/SPIGOT/api/messages/T2Csend.java

110 lines
3.9 KiB
Java

package net.t2code.t2codelib.SPIGOT.api.messages;
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.Nullable;
import java.util.logging.Level;
public class T2Csend {
/**
* @deprecated reason this method is deprecated <br/>
* Please note that these methods will be rebuilt to MiniMessage in the future and from then on the T2Code Hover Module will be removed!
*/
@Deprecated
public static void console(String msg) {
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleConsole(msg);
}
/**
* @deprecated reason this method is deprecated <br/>
* Please note that these methods will be rebuilt to MiniMessage in the future and from then on the T2Code Hover Module will be removed!
*/
@Deprecated
public static void player(Player player, String msg) {
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.modulePlayer(msg, player);
}
/**
* @deprecated reason this method is deprecated <br/>
* Please note that these methods will be rebuilt to MiniMessage in the future and from then on the T2Code Hover Module will be removed!
*/
@Deprecated
public static void sender(CommandSender sender, String msg) {
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleSender(msg, sender);
}
/**
* @deprecated reason this method is deprecated <br/>
* Please note that these methods will be rebuilt to MiniMessage in the future and from then on the T2Code Hover Module will be removed!
*/
@Deprecated
public static void console(Object object) {
String msg = String.valueOf(object);
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleConsole(msg);
}
/**
* @deprecated reason this method is deprecated <br/>
* Please note that these methods will be rebuilt to MiniMessage in the future and from then on the T2Code Hover Module will be removed!
*/
@Deprecated
public static void player(Player player, Object object) {
String msg = String.valueOf(object);
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.modulePlayer(msg, player);
}
/**
* @deprecated reason this method is deprecated <br/>
* Please note that these methods will be rebuilt to MiniMessage in the future and from then on the T2Code Hover Module will be removed!
*/
@Deprecated
public static void sender(CommandSender sender, Object object) {
String msg = String.valueOf(object);
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleSender(msg, sender);
}
public static void title(Player player, @Nullable String title, @Nullable String subtitle) {
player.sendTitle(title, subtitle);
}
public static void title(Player player, @Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut) {
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
}
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;
T2Cdebug.debug(plugin, msg, stage);
}
public static void debugmsg(Plugin plugin, String msg) {
T2Cdebug.debugmsg(plugin, 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);
}
}