Gestion des couleurs dans /me + meilleure gestion des alias pour certaines commandes
This commit is contained in:
@@ -25,7 +25,7 @@ public class CommandMe implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (args.length == 0) return false;
|
||||
|
||||
|
||||
// nom qui doit être affiché
|
||||
String name;
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
@@ -39,7 +39,17 @@ public class CommandMe implements CommandExecutor {
|
||||
name = ChatColor.ITALIC+"Le serveur ";
|
||||
else
|
||||
name = ChatColor.ITALIC+"@ ";
|
||||
plugin.getServer().broadcastMessage(name + StringUtils.join(args, ' '));
|
||||
|
||||
// message à afficher
|
||||
String message;
|
||||
if (!(sender instanceof Player) || ((Player)sender).hasPermission("pandacraft.me.color")) {
|
||||
message = ChatColor.translateAlternateColorCodes('&', StringUtils.join(args, ' '));
|
||||
}
|
||||
else {
|
||||
message = StringUtils.join(args, ' ');
|
||||
}
|
||||
|
||||
plugin.getServer().broadcastMessage(name + message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user