use of net.dzikoysk.funnyguilds.config.tablist.TablistConfiguration in project FunnyGuilds by FunnyGuilds.
the class TablistBroadcastHandler method run.
@Override
public void run() {
UserManager userManager = plugin.getUserManager();
TablistConfiguration tablistConfig = plugin.getTablistConfiguration();
if (!tablistConfig.playerListEnable) {
return;
}
PandaStream.of(Bukkit.getOnlinePlayers()).flatMap(userManager::findByPlayer).flatMap(user -> user.getCache().getPlayerList()).forEach(IndividualPlayerList::send);
}
use of net.dzikoysk.funnyguilds.config.tablist.TablistConfiguration in project FunnyGuilds by FunnyGuilds.
the class ReloadRequest method execute.
@Override
public void execute() throws Exception {
this.plugin.reloadConfiguration();
this.plugin.getDataPersistenceHandler().reloadHandler();
this.plugin.getDynamicListenerManager().reloadAll();
Bukkit.getScheduler().runTaskAsynchronously(plugin, new HologramUpdateLocationHandler(plugin));
if (this.plugin.getTablistConfiguration().playerListEnable) {
PluginConfiguration config = this.plugin.getPluginConfiguration();
TablistConfiguration tablistConfig = this.plugin.getTablistConfiguration();
UserManager userManager = this.plugin.getUserManager();
DefaultTablistVariables.clearFunnyVariables();
PandaStream.of(Bukkit.getOnlinePlayers()).flatMap(userManager::findByPlayer).forEach(user -> {
IndividualPlayerList playerList = new IndividualPlayerList(user, plugin.getNmsAccessor().getPlayerListAccessor(), tablistConfig.playerList, tablistConfig.playerListHeader, tablistConfig.playerListFooter, tablistConfig.pages, tablistConfig.playerListPing, tablistConfig.playerListFillCells, config.top.enableLegacyPlaceholders);
user.getCache().setPlayerList(playerList);
});
}
long endTime = System.currentTimeMillis();
String diff = String.format("%.2f", ((endTime - startTime) / 1000.0));
sender.sendMessage(ChatColor.AQUA + "FunnyGuilds " + ChatColor.GRAY + "przeladowano! (" + ChatColor.AQUA + diff + "s" + ChatColor.GRAY + ")");
}
Aggregations