Guest User

Untitled

a guest
Mar 21st, 2022
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. public class joinCommand implements CommandExecutor {
  2.  
  3.     Main plugin;
  4.     Game game;
  5.  
  6.     public joinCommand(Main plugin) { this.plugin = plugin; }
  7.  
  8.     @Override
  9.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  10.     Player player = (Player) sender;
  11.         if(sender == null) {
  12.             plugin.console.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "(!)" + ChatColor.RED + "Only players can execute this command.");
  13.         }
  14.  
  15.         if (player != null) {
  16.             if(plugin.ingame.contains(player.getUniqueId())) {
  17.                 player.sendMessage("You are already in a match. Type /blleave to leave.");
  18.             }
  19.             else if(!plugin.ingame.contains(player.getUniqueId())) {
  20.                 player.sendMessage("Sending you to BlockIn Practice!");
  21.  
  22.                 if(player.equals(null)) {
  23.                     player.sendMessage("null");
  24.                     plugin.console.sendMessage("null (joincmd)");
  25.                 }
  26.                 game.GameAdd(null);
  27.  
  28.  
  29.             }
  30.         }
  31.  
  32.  
  33.         return false;
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment