Removed credits for non-installed addons

It causes a lot of unnecessary GitHub API calls which can cause rate-limits.
This commit is contained in:
Florian CUNY 2020-06-21 17:51:19 +02:00
parent ad0b01fbc8
commit cffa294f0e
2 changed files with 2 additions and 12 deletions

View File

@ -94,18 +94,12 @@ public class WebManager {
}
List<String> repositories = new ArrayList<>();
// Gather all the repositories of installed addons and or catalog entries.
// Gather all the repositories of installed addons.
repositories.add("BentoBoxWorld/BentoBox");
repositories.addAll(plugin.getAddonsManager().getEnabledAddons()
.stream().map(addon -> addon.getDescription().getRepository())
.filter(repo -> !repo.isEmpty())
.collect(Collectors.toList()));
repositories.addAll(addonsCatalog.stream().map(CatalogEntry::getRepository)
.filter(repo -> !repositories.contains(repo))
.collect(Collectors.toList()));
repositories.addAll(gamemodesCatalog.stream().map(CatalogEntry::getRepository)
.filter(repo -> !repositories.contains(repo))
.collect(Collectors.toList()));
/* Download the contributors */
if (plugin.getSettings().isLogGithubDownloadData()) {

View File

@ -102,11 +102,7 @@ public class CatalogPanel {
// Send the link to the releases tab on click
itemBuilder.clickHandler((panel, user1, clickType, slot) -> {
if (clickType.equals(ClickType.MIDDLE)) {
CreditsPanel.openPanel(user1, addon.getRepository());
} else {
user1.sendRawMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + "https://github.com/" + addon.getRepository() + "/releases");
}
user1.sendRawMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + "https://github.com/" + addon.getRepository() + "/releases");
return true;
});