예제 #1
0
 public static void init() {
   selShow = new HashSet<String>();
   if (RegionsPlugin.getCfg().selectionShow)
     Server.getInstance()
         .getScheduler()
         .scheduleRepeatingTask(
             new Runnable() {
               public void run() {
                 Set<String> players = Regions.getSelector().getActivePlayers();
                 for (String name : players) {
                   Player player = Server.getInstance().getPlayer(name);
                   if (!selShow.contains(name)) continue;
                   showSelection(player);
                 }
               }
             },
             RegionsPlugin.getCfg().selectionTick);
 }
예제 #2
0
 public boolean tip(int seconds, CommandSender sender, Object... s) {
   if (sender == null) return Message.LNG_PRINT_FAIL.log(this.name());
   final Player player = sender instanceof Player ? (Player) sender : null;
   final String message = getText(s);
   if (player == null) sender.sendMessage(message);
   else
     for (int i = 0; i < seconds; i++)
       Server.getInstance()
           .getScheduler()
           .scheduleDelayedTask(
               new Runnable() {
                 public void run() {
                   if (player.isOnline()) player.sendTip(message);
                 }
               },
               20 * i);
   return true;
 }