Example #1
0
 public static int getWarmupTime(Warp warp, CommandSender warper) {
   int time = warp.getWarmUp();
   if (time < 0) {
     return XWarp.permissions.getInteger(
         warper, Groups.TIMERS_WARMUP_GROUP.get(warp.getVisibility()));
   } else {
     return time;
   }
 }
Example #2
0
 private void sendPlayer(CommandSender warper, Warpable warped, Warp warp) {
   if (warped.teleport(warp.getLocation().toLocation(), TeleportCause.COMMAND)) {
     String rawMsg = warp.getRawWelcomeMessage();
     if (rawMsg == null) {
       rawMsg = this.properties.getDefaultMessage().replace("{NAME}", warp.getName());
     }
     if (MinecraftUtil.isSet(rawMsg)) {
       warped.sendMessage(ChatColor.AQUA + rawMsg);
     }
     this.down.addPlayer(warp, warper);
     this.players.remove(warper);
     if (!warped.equals(warper)) {
       warper.sendMessage(
           "Sucessfully warped '"
               + ChatColor.GREEN
               + MinecraftUtil.getName(warped)
               + ChatColor.WHITE
               + "'");
     }
   } else {
     warper.sendMessage(ChatColor.RED + "Unable to warp.");
   }
 }