コード例 #1
0
ファイル: InvisibleCommands.java プロジェクト: BenCmd/BenCmd
 public void online(User user, String[] args) {
   if (args.length == 0) {
     if (user.isServer()) {
       BenCmd.getLocale().sendMessage(user, "basic.noServerUse");
       return;
     }
     if (!user.isOffline()) {
       BenCmd.getLocale().sendMessage(user, "command.online.selfAlready");
     } else {
       user.goOnline();
       BenCmd.getLocale().sendMessage(user, "command.online.self");
     }
   } else if (args.length == 1) {
     if (!user.hasPerm("bencmd.poof.offline.other")) {
       BenCmd.getPlugin().logPermFail(user, "online", args, true);
       return;
     }
     User user2 = User.matchUserAllowPartial(args[0]);
     if (user2 == null) {
       BenCmd.getLocale().sendMessage(user, "basic.userNotFound", args[0]);
       return;
     }
     if (!user2.isOffline()) {
       BenCmd.getLocale().sendMessage(user, "command.online.otherAlready", user2.getName());
     } else {
       user2.goOnline();
       BenCmd.getLocale().sendMessage(user2, "command.online.self");
       BenCmd.getLocale().sendMessage(user, "command.online.other", user2.getName());
     }
   } else {
     BenCmd.showUse(user, "online");
   }
 }
コード例 #2
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");
   }
 }