コード例 #1
0
ファイル: InvisibleCommands.java プロジェクト: BenCmd/BenCmd
 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
ファイル: InvisibleCommands.java プロジェクト: BenCmd/BenCmd
 public void allPoof(User user, String[] args) {
   if (args.length == 0) {
     if (user.isServer()) {
       BenCmd.getLocale().sendMessage(user, "basic.noServerUse");
       return;
     }
     if (!user.isPoofed()) {
       user.poof();
       user.allPoof();
       BenCmd.getLocale().sendMessage(user, "command.allpoof.poof");
     } else if (!user.isAllPoofed()) {
       user.allPoof();
       BenCmd.getLocale().sendMessage(user, "command.allpoof.poof");
     } else {
       user.unAllPoof();
       BenCmd.getLocale().sendMessage(user, "command.allpoof.unpoof");
     }
   } else if (args.length == 1) {
     if (!user.hasPerm("bencmd.poof.allpoof.other")) {
       BenCmd.getPlugin().logPermFail(user, "allpoof", 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();
       user2.allPoof();
       BenCmd.getLocale().sendMessage(user2, "command.allpoof.poof");
       BenCmd.getLocale().sendMessage(user, "command.allpoof.poofOther", user2.getName());
     } else if (!user.isAllPoofed()) {
       user2.allPoof();
       BenCmd.getLocale().sendMessage(user2, "command.allpoof.poof");
       BenCmd.getLocale().sendMessage(user, "command.allpoof.poofOther", user2.getName());
     } else {
       user2.unAllPoof();
       BenCmd.getLocale().sendMessage(user2, "command.allpoof.unpoof");
       BenCmd.getLocale().sendMessage(user, "command.allpoof.unpoofOther", user2.getName());
     }
   } else {
     BenCmd.showUse(user, "allpoof");
   }
 }