Package com.github.zathrus_writer.commandsex.commands

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

package com.github.zathrus_writer.commandsex.commands;

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

import com.github.zathrus_writer.commandsex.api.afk.Afk;
import com.github.zathrus_writer.commandsex.helpers.Commands;
import com.github.zathrus_writer.commandsex.helpers.PlayerHelper;

/**
* A simple command to toggle AFK status
* @author iKeirNez
*/

public class Command_cex_afk {

  public static Boolean run(CommandSender sender, String alias, String[] args){
    if (!PlayerHelper.checkIsPlayer(sender)){
      return true;
    }
   
    Player player = (Player) sender;
   
    if (args.length > 0){
      Commands.showCommandHelpAndUsage(sender, "cex_afk", alias);
      return true;
    }
   
    Afk.toggleAfk(player);
   
    return true;
  }
 
}
TOP

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

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.