Package com.pridemc.games.commands

Source Code of com.pridemc.games.commands.PlayerLeave

package com.pridemc.games.commands;

import com.pridemc.games.arena.ArenaManager;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class PlayerLeave {

  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
   
    Player player = (Player) sender;

    if (ArenaManager.isInArena(player.getName())) {

      ArenaManager.cleanUpPlayer(player);
     
      player.teleport(ArenaManager.getGlobalSpawnPoint());
     
    }else{
     
      player.sendMessage(ChatColor.GOLD + "[" + ChatColor.AQUA + "Pride Games" + ChatColor.GOLD + "] " +
     
          ChatColor.RED + "You are not currently in an arena, and therefore cannot leave one.");
     
      }
   
    return true;
  }
}
TOP

Related Classes of com.pridemc.games.commands.PlayerLeave

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.