Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. public class YouBuiltItCommand implements CommandExecutor {
  2.     YouBuiltIt plugin = null;
  3.     public YouBuiltItCommand(YouBuiltIt youBuiltIt) {
  4.         plugin=youBuiltIt;
  5.     }
  6.  
  7.     @Override
  8.     public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
  9.         String commandName = command.getName().toLowerCase();
  10.        
  11.         if (sender instanceof Player) {
  12.             Player player = (Player) sender;
  13.             if (commandName.equals("you")) {
  14.                 if (args.length == 0) {
  15.                     player.sendMessage(ChatColor.RED + "Add on or off");
  16.                 }else if(args.length == 1){
  17.                     System.out.println("arg[0]:"+args[0]);
  18.                     if(args[0].toLowerCase().equals("on")){
  19.                         plugin.enableFor(player);
  20.                     }else if(args[0].toLowerCase().equals("off")){
  21.                         plugin.disableFor(player);
  22.                     }
  23.                 }
  24.  
  25.             }
  26.  
  27.         }
  28.         return true;
  29.     }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement