Ejemplo n.º 1
0
 public static void addSeconds(final Player player, final int seconds) {
   if (!b******g.fdsjfhkdsjfdsjhk().getServerHandler().isEOTW()
       && DTRBitmaskType.SAFE_ZONE.appliesAt(player.getLocation())) {
     return;
   }
   if (isTagged(player)) {
     final int secondsTaggedFor =
         (int)
             ((SpawnTagHandler.spawnTags.get(player.getName()) - System.currentTimeMillis())
                 / 1000L);
     final int newSeconds = Math.min(secondsTaggedFor + seconds, 60);
     SpawnTagHandler.spawnTags.put(
         player.getName(), System.currentTimeMillis() + newSeconds * 1000L);
   } else {
     player.sendMessage(
         ChatColor.YELLOW + "You have been spawn-tagged for §c" + seconds + " §eseconds!");
     SpawnTagHandler.spawnTags.put(player.getName(), System.currentTimeMillis() + seconds * 1000L);
   }
 }
Ejemplo n.º 2
0
 public static boolean isTagged(final Player player) {
   return SpawnTagHandler.spawnTags.containsKey(player.getName())
       && SpawnTagHandler.spawnTags.get(player.getName()) > System.currentTimeMillis();
 }
Ejemplo n.º 3
0
 public static long getTag(final Player player) {
   return SpawnTagHandler.spawnTags.get(player.getName()) - System.currentTimeMillis();
 }
Ejemplo n.º 4
0
 public static void removeTag(final Player player) {
   SpawnTagHandler.spawnTags.remove(player.getName());
 }