From 2340b1991c13ed6f92bf2c2a146c3002729d89ba Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sun, 9 Jun 2019 09:07:18 +0200 Subject: [PATCH] Readded the description in CatalogEntry --- .../java/world/bentobox/bentobox/panels/CatalogPanel.java | 2 +- .../world/bentobox/bentobox/web/catalog/CatalogEntry.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java b/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java index 85106d202..109eddd9b 100644 --- a/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java +++ b/src/main/java/world/bentobox/bentobox/panels/CatalogPanel.java @@ -91,7 +91,7 @@ public static void openPanel(@NonNull User user, @NonNull View view) { itemBuilder.description(user.getTranslation(LOCALE_REF + "icon.description-template", "[topic]", StringUtils.capitalize(addon.getTopic()), "[install]", install, - "[description]", "WIP")); + "[description]", addon.getDescription())); // Send the link to the releases tab on click itemBuilder.clickHandler((panel, user1, clickType, slot) -> { diff --git a/src/main/java/world/bentobox/bentobox/web/catalog/CatalogEntry.java b/src/main/java/world/bentobox/bentobox/web/catalog/CatalogEntry.java index c5922fa3e..1d2cb66e4 100644 --- a/src/main/java/world/bentobox/bentobox/web/catalog/CatalogEntry.java +++ b/src/main/java/world/bentobox/bentobox/web/catalog/CatalogEntry.java @@ -20,6 +20,7 @@ public class CatalogEntry { */ private @NonNull Material icon; private @NonNull String name; + private @NonNull String description; private @Nullable String topic; private @NonNull List tags = new ArrayList<>(); private @NonNull String repository; @@ -29,6 +30,7 @@ public CatalogEntry(@NonNull JsonObject object) { Material material = Material.getMaterial(object.get("icon").getAsString()); this.icon = (material != null) ? material : Material.PAPER; this.name = object.get("name").getAsString(); + this.description = object.get("description").getAsString(); this.repository = object.get("repository").getAsString(); this.topic = object.get("topic").getAsString(); } @@ -47,6 +49,11 @@ public String getName() { return name; } + @NonNull + public String getDescription() { + return description; + } + @Nullable public String getTopic() { return topic;