Archived
0

Added sendActionBar(CommandSender sender, String message) method

This commit is contained in:
Minenash
2018-09-24 00:01:00 -04:00
parent 743952132b
commit c895a81367
2 changed files with 16 additions and 0 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@
### Maven
target/
/bin/

View File

@@ -6,8 +6,10 @@ import java.util.Random;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import net.md_5.bungee.api.chat.TextComponent;
import net.nemez.chatapi.click.CallbackCommand;
import net.nemez.chatapi.click.Message;
import net.nemez.chatapi.click.PlayerQuitListener;
@@ -93,6 +95,19 @@ public class ChatAPI
sender.sendMessage(colorify(null, message));
}
/** Sends a colorified action bar message to the command sender.
*
* @param sender the command sender to whom to send the action bar message.
* @param message the message to send. */
public static void sendActionBar(CommandSender sender, String message)
{
if (sender instanceof Player)
{
sender.spigot().sendMessage(new TextComponent(colorify(sender, message)));
}
}
/** Checks if a command sender has the permission node required to send chat messages.
*
* @param sender the command sender to check.