com.tchristofferson.pagedinventories.PagedInventoryAPI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of PagedInventories Show documentation
Show all versions of PagedInventories Show documentation
API for easily creating multi paged inventory GUIs in Spigot/Bukkit (Minecraft)
The newest version!
package com.tchristofferson.pagedinventories;
import org.bukkit.Bukkit;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
public class PagedInventoryAPI {
private final InventoryRegistrar registrar;
public PagedInventoryAPI(Plugin plugin) {
this.registrar = new InventoryRegistrar();
Bukkit.getPluginManager().registerEvents(new PagedInventoryListener(plugin, registrar), plugin);
}
/**
* Creates a new {@link IPagedInventory}
* @param nextButton The next button
* @param previousButton The previous button
* @param closeButton The close button
* @return The newly created {@link IPagedInventory}
*/
public IPagedInventory createPagedInventory(ItemStack nextButton, ItemStack previousButton, ItemStack closeButton) {
return new PagedInventory(registrar, nextButton, previousButton, closeButton);
}
/**
* Gets the inventory registrar for this API instance
* @return The {@link InventoryRegistrar}
*/
public InventoryRegistrar getRegistrar() {
return registrar;
}
}