Class SubItemGroup
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
io.github.thebusybiscuit.slimefun4.api.items.groups.SubItemGroup
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed
,org.bukkit.Keyed
- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSubItemGroup
(org.bukkit.NamespacedKey key, NestedItemGroup parent, org.bukkit.inventory.ItemStack item) SubItemGroup
(org.bukkit.NamespacedKey key, NestedItemGroup parent, org.bukkit.inventory.ItemStack item, int tier) -
Method Summary
Modifier and TypeMethodDescriptionfinal NestedItemGroup
This method returns the parentNestedItemGroup
which thisSubItemGroup
belongs to.final boolean
isAccessible
(org.bukkit.entity.Player p) This method returns whether thisItemGroup
can be accessed by the givenPlayer
.final boolean
isVisible
(org.bukkit.entity.Player p) This method returns whether thisItemGroup
can be viewed by the givenPlayer
.final boolean
isVisibleInNested
(org.bukkit.entity.Player p) This method returns whether thisSubItemGroup
can be viewed by the givenPlayer
in aNestedItemGroup
.final void
register
(SlimefunAddon addon) Registers thisItemGroup
.Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
add, contains, equals, getAddon, getDisplayName, getItem, getItems, getKey, getTier, getUnlocalizedName, hashCode, isCrossAddonItemGroup, isHidden, isRegistered, remove, setCrossAddonItemGroup, setTier, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bukkit.Keyed
key
-
Constructor Details
-
SubItemGroup
@ParametersAreNonnullByDefault public SubItemGroup(org.bukkit.NamespacedKey key, NestedItemGroup parent, org.bukkit.inventory.ItemStack item) -
SubItemGroup
@ParametersAreNonnullByDefault public SubItemGroup(org.bukkit.NamespacedKey key, NestedItemGroup parent, org.bukkit.inventory.ItemStack item, int tier)
-
-
Method Details
-
isVisible
public final boolean isVisible(@Nonnull org.bukkit.entity.Player p) Description copied from class:ItemGroup
This method returns whether thisItemGroup
can be viewed by the givenPlayer
. EmptyItemGroups
will not be visible. This includesItemGroups
where everySlimefunItem
is disabled. If anItemGroup
is not accessible by thePlayer
, seeItemGroup.isAccessible(Player)
, this method will also return false. -
isAccessible
public final boolean isAccessible(@Nonnull org.bukkit.entity.Player p) Description copied from class:ItemGroup
This method returns whether thisItemGroup
can be accessed by the givenPlayer
. If anItemGroup
is not accessible, it will not show up in theSlimefunGuide
nor will items from thisItemGroup
show up in the guide search.- Overrides:
isAccessible
in classItemGroup
- Parameters:
p
- ThePlayer
to check for- Returns:
- Whether this
ItemGroup
is accessible by the givenPlayer
-
isVisibleInNested
public final boolean isVisibleInNested(@Nonnull org.bukkit.entity.Player p) This method returns whether thisSubItemGroup
can be viewed by the givenPlayer
in aNestedItemGroup
. EmptyItemGroups
will not be visible. This includesItemGroups
where everySlimefunItem
is disabled. If anItemGroup
is not accessible by thePlayer
, seeisAccessible(Player)
, this method will also return false.- Parameters:
p
- ThePlayer
to check for- Returns:
- Whether this
SubItemGroup
is visible to the givenPlayer
in theNestedItemGroup
-
getParent
This method returns the parentNestedItemGroup
which thisSubItemGroup
belongs to.- Returns:
- The parent
NestedItemGroup
-
register
Description copied from class:ItemGroup
Registers thisItemGroup
.By default, an
ItemGroup
is automatically registered when aSlimefunItem
was added to it.- Overrides:
register
in classItemGroup
- Parameters:
addon
- TheSlimefunAddon
that wants to register thisItemGroup
-