Class NestedItemGroup
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
io.github.thebusybiscuit.slimefun4.api.items.groups.FlexItemGroup
io.github.thebusybiscuit.slimefun4.api.items.groups.NestedItemGroup
- All Implemented Interfaces:
Keyed
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNestedItemGroup
(NamespacedKey key, ItemStack item) NestedItemGroup
(NamespacedKey key, ItemStack item, int tier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubGroup
(SubItemGroup group) This will add the givenSubItemGroup
to thisNestedItemGroup
.boolean
isVisible
(Player p, PlayerProfile profile, SlimefunGuideMode mode) This method returns whether thisFlexItemGroup
is visible under the given context.void
open
(Player p, PlayerProfile profile, SlimefunGuideMode mode) This method is called when aPlayer
opens thisFlexItemGroup
.void
removeSubGroup
(SubItemGroup group) This will remove the givenSubItemGroup
from thisNestedItemGroup
(if present).Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.groups.FlexItemGroup
add, contains, getItems, isVisible, remove
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
-
NestedItemGroup
-
NestedItemGroup
-
-
Method Details
-
addSubGroup
This will add the givenSubItemGroup
to thisNestedItemGroup
.- Parameters:
group
- TheSubItemGroup
to add.
-
removeSubGroup
This will remove the givenSubItemGroup
from thisNestedItemGroup
(if present).- Parameters:
group
- TheSubItemGroup
to remove.
-
isVisible
@ParametersAreNonnullByDefault public boolean isVisible(Player p, PlayerProfile profile, SlimefunGuideMode mode) Description copied from class:FlexItemGroup
This method returns whether thisFlexItemGroup
is visible under the given context. Implementing this method gives full flexibility over who can see the ItemGroup when and where.- Specified by:
isVisible
in classFlexItemGroup
- Parameters:
p
- ThePlayer
who opened hisSlimefunGuide
profile
- ThePlayerProfile
of thePlayer
mode
- TheSlimefunGuideMode
in which thisFlexItemGroup
is viewed- Returns:
- Whether to display this
FlexItemGroup
-
open
@ParametersAreNonnullByDefault public void open(Player p, PlayerProfile profile, SlimefunGuideMode mode) Description copied from class:FlexItemGroup
This method is called when aPlayer
opens thisFlexItemGroup
. This is an abstract method which needs to be implemented in order to determine what thisFlexItemGroup
should actually do as it cannot hold any items.- Specified by:
open
in classFlexItemGroup
- Parameters:
p
- ThePlayer
who wants to open thisFlexItemGroup
profile
- The correspondingPlayerProfile
for thatPlayer
mode
- The currentSlimefunGuideMode
-