From cffa294f0e154dba8969950b8f1ec26d31856ce5 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sun, 21 Jun 2020 17:51:19 +0200 Subject: [PATCH] Removed credits for non-installed addons It causes a lot of unnecessary GitHub API calls which can cause rate-limits. --- .../java/world/bentobox/bentobox/managers/WebManager.java | 8 +------- .../java/world/bentobox/bentobox/panels/CatalogPanel.java | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/WebManager.java b/src/main/java/world/bentobox/bentobox/managers/WebManager.java index e8450c2d3..5e09e993d 100644 --- a/src/main/java/world/bentobox/bentobox/managers/WebManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/WebManager.java @@ -94,18 +94,12 @@ public class WebManager { } List 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()) { diff --git a/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java b/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java index 411843208..0e6fb4316 100644 --- a/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java +++ b/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java @@ -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; });