Пример #1
0
 public void poof(User user, String[] args) {
   if (args.length == 0) {
     if (user.isServer()) {
       BenCmd.getLocale().sendMessage(user, "basic.noServerUse");
       return;
     }
     if (!user.isPoofed()) {
       user.poof();
       BenCmd.getLocale().sendMessage(user, "command.poof.poof");
     } else {
       if (user.isOffline()) {
         BenCmd.getLocale().sendMessage(user, "command.poof.selfOffline");
       } else if (BenCmd.getMonitorController().isMonitoring((Player) user.getHandle())) {
         BenCmd.getLocale().sendMessage(user, "command.poof.selfMonitor");
       } else if (user.isAllPoofed()) {
         user.unAllPoof();
         user.unPoof();
         BenCmd.getLocale().sendMessage(user, "command.poof.unpoof");
       } else {
         user.unPoof();
         BenCmd.getLocale().sendMessage(user, "command.poof.unpoof");
       }
     }
   } else if (args.length == 1) {
     if (!user.hasPerm("bencmd.poof.poof.other")) {
       BenCmd.getPlugin().logPermFail(user, "poof", args, true);
       return;
     }
     User user2 = User.matchUserAllowPartial(args[0]);
     if (user2 == null) {
       BenCmd.getLocale().sendMessage(user, "basic.userNotFound", args[0]);
       return;
     }
     if (!user2.isPoofed()) {
       user2.poof();
       BenCmd.getLocale().sendMessage(user2, "command.poof.poof");
     } else {
       if (user2.isOffline()) {
         BenCmd.getLocale().sendMessage(user, "command.poof.otherOffline");
       } else if (BenCmd.getMonitorController().isMonitoring((Player) user2.getHandle())) {
         BenCmd.getLocale().sendMessage(user, "command.poof.otherMonitor");
       } else if (user2.isAllPoofed()) {
         user2.unAllPoof();
         user2.unPoof();
         BenCmd.getLocale().sendMessage(user2, "command.poof.unpoof");
         BenCmd.getLocale().sendMessage(user, "command.poof.unpoofOther", user2.getName());
       } else {
         user2.unPoof();
         BenCmd.getLocale().sendMessage(user2, "command.poof.unpoof");
         BenCmd.getLocale().sendMessage(user, "command.poof.unpoofOther", user2.getName());
       }
     }
   } else {
     BenCmd.showUse(user, "poof");
   }
 }
Пример #2
0
 public void monitor(User user, String[] args) {
   if (args.length == 0) {
     BenCmd.showUse(user, "monitor");
   } else if (args[0].equalsIgnoreCase("none")) {
     BenCmd.getMonitorController().cancelMonitor(user.getPlayerHandle());
   } else {
     User user2 = User.matchUserAllowPartial(args[0]);
     if (user2 == null) {
       BenCmd.getLocale().sendMessage(user, "basic.userNotFound", args[0]);
       return;
     }
     BenCmd.getMonitorController().setMonitor(user.getPlayerHandle(), user2.getPlayerHandle());
     BenCmd.getLocale().sendMessage(user, "command.monitor.success", user2.getName());
   }
 }