Class FlexItemGroup
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
io.github.thebusybiscuit.slimefun4.api.items.groups.FlexItemGroup
- All Implemented Interfaces:
Keyed
- Direct Known Subclasses:
NestedItemGroup
A
FlexItemGroup is a ItemGroup inside the SlimefunGuide that can
be completely modified.
It cannot hold any SlimefunItem but can be completely overridden
to perform any action upon being opened.- Author:
- TheBusyBiscuit
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFlexItemGroup(NamespacedKey key, ItemStack item) protectedFlexItemGroup(NamespacedKey key, ItemStack item, int tier) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidadd(SlimefunItem item) Adds the givenSlimefunItemto thisItemGroup.final booleancontains(SlimefunItem item) This method returns whether a givenSlimefunItemexists in thisItemGroup.final List<SlimefunItem>getItems()Returns all instances ofSlimefunItembound to thisItemGroup.final booleanabstract booleanisVisible(Player p, PlayerProfile profile, SlimefunGuideMode layout) This method returns whether thisFlexItemGroupis visible under the given context.abstract voidopen(Player p, PlayerProfile profile, SlimefunGuideMode layout) This method is called when aPlayeropens thisFlexItemGroup.final voidremove(SlimefunItem item) Removes the givenSlimefunItemfrom thisItemGroup.Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
equals, getAddon, getDisplayName, getItem, getKey, getTier, getUnlocalizedName, hashCode, isAccessible, isCrossAddonItemGroup, isHidden, isRegistered, register, setCrossAddonItemGroup, setTier, toString
-
Constructor Details
-
FlexItemGroup
-
FlexItemGroup
-
-
Method Details
-
isVisible
Description copied from class:ItemGroupThis method returns whether thisItemGroupcan be viewed by the givenPlayer. EmptyItemGroupswill not be visible. This includesItemGroupswhere everySlimefunItemis disabled. If anItemGroupis not accessible by thePlayer, seeItemGroup.isAccessible(Player), this method will also return false. -
isVisible
@ParametersAreNonnullByDefault public abstract boolean isVisible(Player p, PlayerProfile profile, SlimefunGuideMode layout) This method returns whether thisFlexItemGroupis visible under the given context. Implementing this method gives full flexibility over who can see the ItemGroup when and where.- Parameters:
p- ThePlayerwho opened hisSlimefunGuideprofile- ThePlayerProfileof thePlayerlayout- TheSlimefunGuideModein which thisFlexItemGroupis viewed- Returns:
- Whether to display this
FlexItemGroup
-
open
This method is called when aPlayeropens thisFlexItemGroup. This is an abstract method which needs to be implemented in order to determine what thisFlexItemGroupshould actually do as it cannot hold any items.- Parameters:
p- ThePlayerwho wants to open thisFlexItemGroupprofile- The correspondingPlayerProfilefor thatPlayerlayout- The currentSlimefunGuideMode
-
add
Description copied from class:ItemGroupAdds the givenSlimefunItemto thisItemGroup.- Overrides:
addin classItemGroup- Parameters:
item- theSlimefunItemthat should be added to thisItemGroup
-
getItems
Description copied from class:ItemGroupReturns all instances ofSlimefunItembound to thisItemGroup. -
contains
Description copied from class:ItemGroupThis method returns whether a givenSlimefunItemexists in thisItemGroup.- Overrides:
containsin classItemGroup- Parameters:
item- TheSlimefunItemto find- Returns:
- Whether the given
SlimefunItemwas found in thisItemGroup
-
remove
Description copied from class:ItemGroupRemoves the givenSlimefunItemfrom thisItemGroup.- Overrides:
removein classItemGroup- Parameters:
item- theSlimefunItemthat should be removed from thisItemGroup
-