Sueta
IN

Inventory Toolkit

1.2

Hassle-free Inventory management, pagination, and InventoryClickEvents

·Plugin

!!! SERVER OWNERS !!!
This plugin does nothing on its own, and requires that plugin developers utilize it how they want. If a plugin you have requires this, download it. If not, well... don't. Unless you really want to.


Inventory Toolkit was made because I was frustrated with the current way of creating advanced, well-working inventory GUIs. Having to add an ugly amount of code to an InventoryClickEvent on top of the amount of code that is required for the inventory itself is something I feel no one should have to experience. This API makes it easy for developers to create good-looking, fully functional inventory GUIs without having to touch an InventoryClickListener.

  • Easy GUI creation
  • Built-in method for designating what items players should be able to click, as well as which ones they shouldn't be able to
  • All click types, including multiple ones per item event
  • Easy pagination, with the ability to create whole-inventory pages, or pages held within certain inventory rows, and automatically detect how many pages there are based on items that are created
  • Pagination item offsets and inline navigation buttons
  • The ability to conquer the world! do anything your heart desires upon clicking an item
  • The ability to store objects within an ItemStack, allowing for even more cool things!
  • The ability to add permissions to an ItemStack, so only players with those permissions can successfully click that item


It works by using a custom ItemStack class to store runnable events that are executed upon clicking a valid item. Because of this, creation of another InventoryClickEvent class isn't needed -- simply let the API handle it for you.


To start, add "InventoryToolkit" as a library in your project, and drop the jar in your plugins folder as well.

From here, check out the main page on the Examples GitHub Repository, as well as the classes inside the repo -- as they contain much more detailed info than the readme does.

  • Make setAllowCreative(true) obsolete by making sure creative actually works
  • Multiple paginated sections per inventory
  • Some more useful things included in ItemBuilder
  • Add permissions to a whole inventory
  • More/Improved documentation
  • Better object storage methods when using ItemBuilder#storeObject()
  • Default comparators for sorting
  • ItemStack animations for paging, opening, closing, etc.
  • Animated items (item cycling, color cycling, etc.)
  • More language support?
  • Allow for per-permission disallow messages (since 1.1)
  • Configurable page numbers in inventory title (since 1.1)
  • Static methods in ItemBuilder for getting custom skulls (since 1.0.2) and player skulls easily (since 1.1)

Known Issues:

- Creative mode has been a bit finicky with me, so I added a check to restrict clicks events to:

1: if you're not in creative, or
2: if you've used setAllowCreative(true) in your inventory class


If you're having trouble using this or have a suggestion, feel free to PM me on here, or add me on Discord: GamerBah#0811

Metrics:
This resource has metrics built in to collect some statistics. Feel free to disable it in the config.yml

Similar projects

Plugin →