use of com.palmergames.bukkit.towny.object.gui.SelectionGUI in project Towny by TownyAdvanced.
the class ResidentUtil method openSelectionGUI.
public static void openSelectionGUI(Resident resident, SelectionGUI.SelectionType selectionType) {
String inventoryName = Translatable.of("gui_title_select_plot_type").forLocale(resident);
Inventory page = getBlankPage(inventoryName);
ArrayList<Inventory> pages = new ArrayList<>();
for (TownBlockType townBlockType : TownBlockTypeHandler.getTypes().values()) {
ItemStack item = new ItemStack(Material.GRASS_BLOCK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Colors.Gold + townBlockType.getFormattedName());
item.setItemMeta(meta);
if (page.firstEmpty() == 46) {
pages.add(page);
page = getBlankPage(inventoryName);
}
page.addItem(item);
}
pages.add(page);
resident.setGUIPageNum(0);
resident.setGUIPages(pages);
new SelectionGUI(resident, pages.get(0), inventoryName, selectionType);
}
Aggregations