Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on August 1, 2016 at 12:54 AM

Section 1 (Java)

public void openCatalog(Player player, int menuId)
{
	if(!pageView.containsKey(player.getUniqueId()))
		pageView.put(player.getUniqueId(), 0);
	
	InventoryMenu menu = new InventoryMenu("Banner Catalog: white", 45, Main.plug, new IMenuItemClicked()
	{	
		
		@Override
		public void onMenuItemClicked(MenuItemClicked clickEvent) 
		{
			clickEvent.setCanClose(false);
			ItemStack clicked = clickEvent.getItemClicked();
			
			if(clicked.getType() == Material.BANNER)
				player.getInventory().addItem(clicked);
			else if(clicked.getType() == Material.BARRIER)
			{
				player.closeInventory();
				pageView = null;
			}
			else if(clicked.getType() == Material.SPRUCE_DOOR_ITEM)
			{
				CatalogMenu.catalogSelect.open(player);
				pageView = null;
			}
			
			if(pageView.containsKey(player.getUniqueId()))
			{
				BTBUtil.log(Prefix.TEST + "UTIL " + pageView);
				if(clickEvent.getItemClicked().getType() == Material.STAINED_GLASS_PANE && clickEvent.getItemClicked().getItemMeta().getDisplayName().equalsIgnoreCase("Previous Page"))
				{
					Integer i = pageView.get(player.getUniqueId());
					BTBUtil.log(Prefix.TEST + "MOOMOO_PREV " + i);
					pageView.put(player.getUniqueId(), new Integer(i-1));
				}
				else if(clickEvent.getItemClicked().getType() == Material.STAINED_GLASS_PANE && clickEvent.getItemClicked().getItemMeta().getDisplayName().equalsIgnoreCase("Next Page"))
				{
					Integer i = pageView.get(player.getUniqueId());
					BTBUtil.log(Prefix.TEST + "MOOMOO_NEXT " + i);
					pageView.put(player.getUniqueId(), new Integer(i + 1));
				}
			}
			else
				pageView.put(player.getUniqueId(), new Integer(0));
		}
	});
	
	int pitemStart = menu.pageView.get(player.getUniqueId()) * 40;

	BTBUtil.log(Prefix.TEST + menu.pageView.get(player.getUniqueId()));
	YamlConfiguration banners = YamlConfiguration.loadConfiguration(Main.bannerCatalogs[menuId]);
	int x = (int) Math.ceil((double)banners.getConfigurationSection("Banners").getKeys(false).size()/40);
	int j = 0;
	for(int i = 0; i < 45; i++)
	{
		if(i == 8)
		{
			if(menu.pageView.get(player.getUniqueId()) != 0)
				menu.setInvOption(8, new ItemStack(Material.STAINED_GLASS_PANE, 1, DyeColor.RED.getData()), "Previous Page", "");
			else
				menu.setInvOption(8, new ItemStack(Material.STAINED_GLASS_PANE, 1, DyeColor.RED.getData()), "No More Pages", "");
			j = 1;
		}
		else if(i == 17)
		{
			if(menu.pageView.get(player.getUniqueId()) != x)
				menu.setInvOption(17, new ItemStack(Material.STAINED_GLASS_PANE, 1, DyeColor.LIME.getData()), "Next Page", "");
			else
				menu.setInvOption(17, new ItemStack(Material.STAINED_GLASS_PANE, 1, DyeColor.LIME.getData()), "No More Pages", "");
			j = 2;
		}
		else if(i == 26)
		{ 
			menu.setInvOption(26, new ItemStack(Material.STAINED_GLASS_PANE, 1, DyeColor.SILVER.getData()), " ", "");
			j = 3; 
		}
		else if(i == 35)
		{
			menu.setInvOption(35, new ItemStack(Material.BARRIER), "Exit", "");
			j = 4;
		}
		else if(i == 44)
		{
			menu.setInvOption(44, new ItemStack(Material.SPRUCE_DOOR_ITEM), "Back", "");
			j = 5;
		}
		else if(banners.getItemStack("Banners.entry_" + (((i+1) - j) + pitemStart)) != null)
				menu.setInvOption(i, banners.getItemStack("Banners.entry_" + (((i+1) - j) + pitemStart)), "banner_" + (((i+1) - j) + pitemStart), "");
	}
	if(menu.pageView.get(player.getUniqueId()) == 0)
	{
		menu.loadMenu();
		player.openInventory(menu.inventory);
	}
}