The most (or at least one of) advanced GUI management library. Unlike other GUI libraries, SS-GuiLibrary supports any kind of GUI, in addition to inventory GUIs, while not currently supported by the library itself, it is entirely possible to create a kind of GUI that would use books instead, as an example. SS-GuiLibrary uses Kotlin for most of it's functions, while it is possible to use it from Java, I highly recommend Kotlin as there are a lot of things with this plugin that would not be as clean of solutions in Java as they can be in Kotlin. The most powerful part of this library is the GuiComponents with their state management.
There are multiple ways in which you can create a chest GUI with this library:
Using InventoryGuiController (I do not know any cases in which you would want to use this, unless building a custom solution):
Code (Kotlin):
class TestGui
: InventoryGuiController
(){ overridefun createInventory
()=this.
player.
server.
createInventory(null,
9,
"Test GUI")
overridefun update
(){ val stack
= ItemStack
(Material.
EMERALD_BLOCK)
val meta
= stack.
itemMeta meta.
setDisplayName("Test") stack.
itemMeta= meta
Here's a more advanced example of the GuiComponents:
Code (Kotlin):
class PlayerInfoComponent
( privateval player
: Player
): GuiComponent
(){ privatefun getMaxHealth
()= this@PlayerInfoComponent.
player.
getAttribute(Attribute.
GENERIC_MAX_HEALTH)?.
value
overridefun ComponentCanvas.
render(){ val playerName
=this@PlayerInfoComponent.
player.
name// The name of a player cannot change, no need to watch it. val playerHealth
= watch
{this@PlayerInfoComponent.
player.
health} val playerMaxHealth
= watch
{this@PlayerInfoComponent.
getMaxHealth()}