Setup the basic Catalog panel

This commit is contained in:
Florian CUNY 2019-04-20 12:00:59 +02:00
parent d1732e4f20
commit 70f589538c
2 changed files with 25 additions and 1 deletions

View File

@ -1,6 +1,10 @@
package world.bentobox.bentobox.panels;
import org.bukkit.Material;
import org.eclipse.jdt.annotation.NonNull;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
/**
@ -9,7 +13,23 @@ import world.bentobox.bentobox.api.user.User;
*/
public class CatalogPanel {
private static final String LOCALE_REF = "catalog.panel.";
private static final int[] PANES = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53};
private CatalogPanel() {}
public static void openPanel(@NonNull User user) {
user.sendRawMessage("open the catalog (it's coming soon!)");
BentoBox plugin = BentoBox.getInstance();
PanelBuilder builder = new PanelBuilder()
.name(user.getTranslation(LOCALE_REF + "title"))
.size(54);
// Setup header and corners
for (int i : PANES) {
builder.item(i, new PanelItemBuilder().icon(Material.LIGHT_BLUE_STAINED_GLASS_PANE).name(" ").build());
}
builder.build().open(user);
}
}

View File

@ -1022,6 +1022,10 @@ management:
&cWeird behaviour and bugs can occur
&cand most features may be unstable.
catalog:
panel:
title: "Addons Catalog"
successfully-loaded: |
&6 ____ _ ____