コード例 #1
0
 @Override
 public void process(CommandSender sender, String[] args) {
   if (args[0] != null) {
     Bukkit.getScheduler()
         .runTaskAsynchronously(Main.getInstance(), new LookupTask(args[0], sender));
   } else {
     Bukkit.getScheduler()
         .runTaskAsynchronously(Main.getInstance(), new LookupTask(sender.getName(), sender));
   }
 }
コード例 #2
0
 @Override
 public void process(CommandSender sender, String[] args) {
   if (args.length > 0 && args[0] != null && !args[0].equals("")) {
     Player p = getPlayer(args[0]);
     if (p != null) {
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(
               Main.getInstance(), new WakeUpTask(p, Sound.ENDERMAN_SCREAM), 20L);
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(
               Main.getInstance(), new WakeUpTask(p, Sound.ENDERDRAGON_DEATH), 10L);
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(Main.getInstance(), new WakeUpTask(p, Sound.DOOR_OPEN), 30L);
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(Main.getInstance(), new WakeUpTask(p, Sound.DOOR_CLOSE), 40L);
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(Main.getInstance(), new WakeUpTask(p, Sound.DOOR_OPEN), 50L);
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(Main.getInstance(), new WakeUpTask(p, Sound.DOOR_CLOSE), 60L);
       Bukkit.getScheduler()
           .scheduleSyncDelayedTask(
               Main.getInstance(), new WakeUpTask(p, Sound.AMBIENCE_THUNDER), 60L);
     }
   }
 }