Package com.github.zathrus_writer.commandsex.commands

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

package com.github.zathrus_writer.commandsex.commands;


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.Jails;
import com.github.zathrus_writer.commandsex.helpers.Permissions;
import com.github.zathrus_writer.commandsex.helpers.PlayerHelper;

public class Command_cex_jail extends Jails {
  /***
   * JAIL - freezes a player, making him unable to perform physical actions on the server and moves him to a jail location
   * @param sender
   * @param args
   * @return
   */
  public static Boolean run(CommandSender sender, String alias, String[] args) {
    if (PlayerHelper.checkIsPlayer(sender)) {
      Player player = (Player)sender;

      // check permissions and call to action
      if (args.length > 0) {
        if (Permissions.checkPerms(player, "cex.jail")) {
          jail(sender, args, "jail", alias);
        }
      } else {
        // show usage
        Commands.showCommandHelpAndUsage(sender, "cex_jail", alias);
      }
    }
        return true;
  }
}
TOP

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

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.