TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/util/FSync.java
2017-10-13 23:38:05 +05:00

102 lines
2.4 KiB
Java

package me.totalfreedom.totalfreedommod.util;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class FSync
{
public static void playerMsg(final Player player, final String message)
{
final TotalFreedomMod plugin = TotalFreedomMod.plugin();
new BukkitRunnable()
{
@Override
public void run()
{
FUtil.playerMsg(player, message);
}
}.runTask(plugin);
}
public static void playerMsg(final CommandSender sender, final String message)
{
final TotalFreedomMod plugin = TotalFreedomMod.plugin();
new BukkitRunnable()
{
@Override
public void run()
{
sender.sendMessage(message);
}
}.runTask(plugin);
}
public static void playerKick(final Player player, final String reason)
{
final TotalFreedomMod plugin = TotalFreedomMod.plugin();
new BukkitRunnable()
{
@Override
public void run()
{
player.kickPlayer(reason);
}
}.runTask(plugin);
}
public static void adminChatMessage(final CommandSender sender, final String message)
{
final TotalFreedomMod plugin = TotalFreedomMod.plugin();
new BukkitRunnable()
{
@Override
public void run()
{
plugin.cm.adminChat(sender, message);
}
}.runTask(plugin);
}
public static void autoEject(final Player player, final String kickMessage)
{
final TotalFreedomMod plugin = TotalFreedomMod.plugin();
new BukkitRunnable()
{
@Override
public void run()
{
plugin.ae.autoEject(player, kickMessage);
}
}.runTask(plugin);
}
public static void bcastMsg(final String message, final ChatColor color)
{
final TotalFreedomMod plugin = TotalFreedomMod.plugin();
new BukkitRunnable()
{
@Override
public void run()
{
FUtil.bcastMsg(message, color);
}
}.runTask(plugin);
}
}