Package com.github.zathrus_writer.commandsex.commands

Source Code of com.github.zathrus_writer.commandsex.commands.Command_cex_csudo

package com.github.zathrus_writer.commandsex.commands;

import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.github.zathrus_writer.commandsex.helpers.Commands;
import com.github.zathrus_writer.commandsex.helpers.LogHelper;
import com.github.zathrus_writer.commandsex.helpers.Utils;

public class Command_cex_csudo {

  /**
   * Csudo - Simple command to send a chat message as another player
   * @author iKeirNez
   */
 
  public static Boolean run(CommandSender sender, String alias, String[] args){
    if (args.length < 2){
      Commands.showCommandHelpAndUsage(sender, "cex_csudo", alias);
      return true;
    }
   
    Player target = Bukkit.getPlayer(args[0]);
   
    if (target == null){
      LogHelper.showWarning("invalidPlayer", sender);
      return true;
    }
   
    String message = Utils.collectArgs(args, 1);
    target.chat(message);
   
    return true;
  }
}
TOP

Related Classes of com.github.zathrus_writer.commandsex.commands.Command_cex_csudo

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.