From 7df34d73baf2fc8fed758b05c84cc0480f360bbc Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Thu, 11 Apr 2019 14:44:30 +0200 Subject: [PATCH] Made the ManagementPanel display hooks --- .../bentobox/panels/ManagementPanel.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/panels/ManagementPanel.java b/src/main/java/world/bentobox/bentobox/panels/ManagementPanel.java index fae7f4723..eee39cb99 100644 --- a/src/main/java/world/bentobox/bentobox/panels/ManagementPanel.java +++ b/src/main/java/world/bentobox/bentobox/panels/ManagementPanel.java @@ -5,6 +5,7 @@ import org.bukkit.Material; import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.api.addons.Addon; import world.bentobox.bentobox.api.addons.GameModeAddon; +import world.bentobox.bentobox.api.hooks.Hook; import world.bentobox.bentobox.api.panels.PanelItem; import world.bentobox.bentobox.api.panels.builders.PanelBuilder; import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder; @@ -83,7 +84,7 @@ public class ManagementPanel { for (Addon addon : addons) { PanelItem addonItem = new PanelItemBuilder() .icon(addon.getDescription().getIcon()) - .name(addon.getDescription().getName()) + .name(ChatColor.WHITE + addon.getDescription().getName()) .build(); builder.item(startSlot + i, addonItem); @@ -91,8 +92,19 @@ public class ManagementPanel { } break; case HOOKS: - looksEmpty(builder, user); + if (plugin.getHooks().getHooks().isEmpty()) { + looksEmpty(builder, user); + break; + } + for (Hook hook : plugin.getHooks().getHooks()) { + PanelItem hookItem = new PanelItemBuilder() + .icon(hook.getIcon()) + .name(ChatColor.WHITE + hook.getPluginName()) + .build(); + builder.item(startSlot + i, hookItem); + i++; + } break; }