InventoryInterface Library 1.0

Simple API for using Inventories as Interfaces and creating user friendly plugins!

  1. patroclos
    InventoryInterface Library

    1. Overview
    2. How to use
    3. Source



    1. Overview
    Simple API to create awesome InventoryInterfaces
    Great for creating pretty much everything with an inventory.
    For example: Shop-Plugins, Polls, Hub-Swiching and all sorts of configuration.

    This plugin works by coupling Inventory Slots with InventoryRunnables.
    The Runnables have a run(InventoryClickEvent) method that gets
    called if a player clicks the slot.

    2. How to use:

    Create and register an IInventory:
    Code (Text):
    IInventory inv = InventoryInterface.registerInventory(int rows, String title);
    OR
    Code (Text):
    IInventory inv = new IInventory(int rows, String title, boolean temporal);
    InventoryInterface.registerInventory(inv);
    Create an InventoryRunnable:
    Code (Text):
    InventoryRunnable r = new InventoryRunnable()
    {
        @Override
        public void run(InventoryClickEvent event)
        {
                event.getWhoClicked().sendMessage("this is wood");
                    event.getWhoClicked().closeInventory();
        }
    };
    Add Items to the Inventory:
    Code (Text):
    inv.addActionItem(new ItemStack(Material.WOOD), r);
    Show the Inventory:
    Code (Text):
    inv.show(player)

    3. Source
    https://github.com/patroclos/iil


    These are the absolute basics, but I will put up a more in depth documentation soon.
    If you have any suggestions/ideas/problems feel free to leave a comment.