Class LockedItemGroup
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
io.github.thebusybiscuit.slimefun4.api.items.groups.LockedItemGroup
- All Implemented Interfaces:
Keyed
Represents a
ItemGroup
that cannot be opened until the parent group(s)
are fully unlocked.
See ItemGroup
for the complete documentation.
- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLockedItemGroup
(NamespacedKey key, ItemStack item, int tier, NamespacedKey... parents) The constructor for a LockedItemGroup.LockedItemGroup
(NamespacedKey key, ItemStack item, NamespacedKey... parents) The basic constructor for a LockedItemGroup. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a parentItemGroup
to thisLockedItemGroup
.Gets the list of parent item groups for thisLockedItemGroup
.boolean
hasUnlocked
(Player p, PlayerProfile profile) Checks if thePlayer
has fully unlocked all parent categories.void
register
(SlimefunAddon addon) Registers thisItemGroup
.void
removeParent
(ItemGroup group) Removes aItemGroup
from the parents of thisLockedItemGroup
.Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
add, contains, equals, getAddon, getDisplayName, getItem, getItems, getKey, getTier, getUnlocalizedName, hashCode, isAccessible, isCrossAddonItemGroup, isHidden, isRegistered, isVisible, remove, setCrossAddonItemGroup, setTier, toString
-
Constructor Details
-
LockedItemGroup
@ParametersAreNonnullByDefault public LockedItemGroup(NamespacedKey key, ItemStack item, NamespacedKey... parents) The basic constructor for a LockedItemGroup. LikeItemGroup
, the default tier is automatically set to 3.- Parameters:
key
- A unique identifier for this groupitem
- The display item for this groupparents
- The parent categories for this group
-
LockedItemGroup
@ParametersAreNonnullByDefault public LockedItemGroup(NamespacedKey key, ItemStack item, int tier, NamespacedKey... parents) The constructor for a LockedItemGroup.- Parameters:
key
- A unique identifier for this groupitem
- The display item for this grouptier
- The tier of this groupparents
- The parent categories for this group
-
-
Method Details
-
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
-
getParents
Gets the list of parent item groups for thisLockedItemGroup
.- Returns:
- the list of parent item groups
- See Also:
-
addParent
Adds a parentItemGroup
to thisLockedItemGroup
.- Parameters:
group
- TheItemGroup
to add as a parent- See Also:
-
removeParent
Removes aItemGroup
from the parents of thisLockedItemGroup
.- Parameters:
group
- TheItemGroup
to remove from the parents of thisLockedItemGroup
- See Also:
-
hasUnlocked
Checks if thePlayer
has fully unlocked all parent categories.- Parameters:
p
- ThePlayer
to checkprofile
- ThePlayerProfile
that belongs to the givenPlayer
- Returns:
- Whether the
Player
has fully completed all parent categories, otherwise false
-