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); } }
public static boolean isTagged(final Player player) { return SpawnTagHandler.spawnTags.containsKey(player.getName()) && SpawnTagHandler.spawnTags.get(player.getName()) > System.currentTimeMillis(); }
public static long getTag(final Player player) { return SpawnTagHandler.spawnTags.get(player.getName()) - System.currentTimeMillis(); }
public static void removeTag(final Player player) { SpawnTagHandler.spawnTags.remove(player.getName()); }