Package org.spout.api.command

Examples of org.spout.api.command.CommandSource


   * @param cmd to execute
   * @param cause of command, can be null
   */
  public void setCommand(String cmd, Cause<?> cause) {
    if (cause != null && cause.getSource() instanceof CommandSource) {
      CommandSource cmdSource = (CommandSource) cause.getSource();
      String prefix = VanillaPlugin.getInstance().getPrefix();
      if (!cmdSource.hasPermission("vanilla.commandblock." + cmd.split(" ")[0])) {
        cmdSource.sendMessage(prefix + ChatStyle.RED + " You don't have permission to do that.");
        return;
      }
      cmdSource.sendMessage(prefix + ChatStyle.WHITE + "CommandDescription set: " + ChatStyle.GREEN + cmd);
    }

    if (!cmd.startsWith("/")) {
      cmd = "say " + cmd;
    } else {
View Full Code Here

TOP

Related Classes of org.spout.api.command.CommandSource

Copyright © 2018 www.massapicom. 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.