betterMe 1

white /me

  1. ohnx
    Contributors:
    ohnx
    betterMe
    This plugin only does 1 thing: change the color of /me
    For some reason, it's generally purple when you have Essentials:
    [​IMG]
    However, in vanilla minecraft, it's white.
    This plugin changes /me back to white, so it looks more like this:
    [​IMG]
    source
    the plugin is just 1 file:
    Code (Text):

    package tk.masonx.betterMe;

    import org.apache.commons.lang.StringUtils;
    import org.bukkit.Bukkit;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;

    public final class BetterMe extends JavaPlugin {

        @Override
        public void onEnable() {
            this.getCommand("me").setExecutor(this);
        }

        @Override
        public void onDisable() {
        }
       
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            try {
                if(cmd.getName().equalsIgnoreCase("me")){
                    if(args.length<1) {
                        return false;
                    }
                    if(sender instanceof Player){
                        Player player = (Player)sender;
                        String displayName = player.getDisplayName();
                        Bukkit.broadcastMessage("* "+displayName+" "+StringUtils.join(args, ' '));
                        return true;
                    } else {
                        Bukkit.broadcastMessage("* CONSOLE "+StringUtils.join(args, ' '));
                    }
                }
               } catch (Exception e) {
                   sender.sendMessage("Uhh, something went wrong.");
               }
            return false;
        }
    }