SimpleFlexGroup
In Slimefun, NestedItemGroups
allow you to condense your itemgroups into a single tile on the main guide pages. The downside of this is you cannot add a FlexItemGroup
to them. Currently the only way to make this work is to make your main ItemGroup
a FlexItemGroup
. SimpleFlexGroup
was made to make the process of setting up this type of FlexItemGroup
much easier and to ensure it's as standardised with Slimefun's guide as possible.
All of the sorting, pagination and formatting of the GUI are all handled for you meaning you can have a working FlexItemGroup
for your main guide item with just a few lines of code.
First, declare a new SimpleFlexGroup, this is no different to setting up a NestedItemGroup from Slimefun except a JavaPlugin
instance needs to be provided (this is required for handling search queries).
Then declare all of your other ItemGroups. ItemGroup
, NestedItemGroup
and FlexItemGroup
are all accepted here, SubItemGroup
is not, as they MUST be inside of a nested group. For normal ItemGroups, you will likely want to use DummyItemGroup
as this will stop the group being displayed on the front page of the SlimefunGuide.
Then you can just call MainItemGroup.addItemGroup(ItemGroup)
You can also add icons with custom effects by using the MenuItem
class. A MenuItem
class holds an ItemStack and a ClickHandler
, this can allow you add add more complex items to your Flex guide in a simple and straight-forward manner. You can mix and match ItemGroups and MenuItems freely and they will be displayed in the order they were added.
Last updated