public void setCooldown(String command, OfflinePlayer p) { ConfigurationSection cmdCds = plugin.getConfig().getConfigurationSection("command_cooldowns"); if (cmdCds == null) return; boolean contains = cmdCds.getKeys(false).contains(command); if (plugin.cooldownAliases) if (plugin.getCommand(command) != null) for (String alias : plugin.getCommand(command).getAliases()) if (cmdCds.getKeys(false).contains(alias)) { contains = true; break; } if (contains) { long cooldown = cmdCds.getLong(command); PConfManager.setPValLong( p, new Date().getTime() + (cooldown * 1000), "command_cooldowns." + command); } }
@EventHandler public void onKick(PlayerKickEvent e) { PConfManager.setPValLong(e.getPlayer(), new Date().getTime(), "seen"); if (AFKUtils.isAfk(e.getPlayer())) AFKUtils.unsetAfk(e.getPlayer()); if (AFKUtils.moveTimesContains(e.getPlayer())) AFKUtils.removeLastMove(e.getPlayer()); }